#include<iostream> #include<cstdio> #include<cstring> #include<cstdlib> #include<cmath> #include<cctype> #include<queue> #include<stack> #include<vector> #include<algorithm> using namespace std; typedef long long LL; #define N 100100 #define INF 0x3f3f3f3f char a[N], b[N]; int ans[N]; stack<char> s; int main() { int n; while(~scanf("%d%s%s", &n, a, b)) { while(s.size()) s.pop(); memset(ans, 0, sizeof(ans)); int i, j, k; i=j=k=0; while(i<n) { s.push(a[i]); ans[k++]=1; while(s.size()&&s.top()==b[j]) { s.pop(); j++; ans[k++]=0; } i++; } if(k!=n) printf("No. "); else { printf("Yes. "); for(i=0; i<k; i++) { if(ans[i]) printf("in "); else printf("out "); } } printf("FINISH "); } return 0 ; }