#include <stdio.h>#include <iostream>#include <stack>#include <string>#include <string.h>using namespace std;int main(){ int n; //string in,out; char in[1000],out[1000]; while(cin>>n>>in>>out) { //stack<char> s; char s[1000]; memset(s,'\0',sizeof(s) ); int mark[20]; int i=0,j=0; int count=0; while(i<n) { //if(s.empty() ) if(strlen(s)==0) { //s.push(in[i]); s[count++]=in[i]; mark[i+j]=0; i++; } //if(!s.empty() && s.top()!=out[j] ) if(strlen(s)!=0 && s[strlen(s)]!=out[j] ) { //s.push(in[i]); s[count++]=in[i]; mark[i+j]=0; i++; } //while(!s.empty() &&s.top() ==out[j] ) while(strlen(s)!=0 && s[strlen(s)-1]==out[j] ) { //s.pop(); s[strlen(s)-1]='\0'; mark[i+j]=1; j++; } } //if( s.empty() ) if(strlen(s)==0 ) { cout<<"Yes."<<endl; for(int i=0;i<2*n;i++) { if(mark[i]==0) cout<<"in"<<endl; else cout<<"out"<<endl; } cout<<"FINISH"<<endl; } else cout<<"No."<<endl<<"FINISH"<<endl; } return 0;}