# Include <stdio. h> # include <string. h> # include <stdlib. h> # define max 100 char stack [Max]; int top; int empty () {If (Top = 0) return 1; return 0;} int main () {char in [Max], out [Max]; int N, J, Q [Max], l, I; while (scanf ("% d", & N )! = EOF) {Top = 0; memset (stack, 0, sizeof (stack); memset (Q,-1, sizeof (q); scanf ("% s ", in); scanf ("% s", out); for (I = 0, j = 0, L = 0; j <n;) {If (empty () | stack [Top-1]! = Out [J]) {stack [top ++] = in [I]; Q [L ++] = 1; I ++; // The reason why there is always no AC at the end, forgetting that both in and out are irregular changes} else {If (stack [Top-1] = out [J]) {top --; j ++; Q [L ++] = 0 ;}elsebreak ;}}if (empty () {printf ("yes. \ n "); for (I = 0; I <2 * n; I ++) {If (Q [I]) printf (" in \ n "); else printf ("Out \ n");} printf ("Finish \ n");} else {printf ("no. \ n "); printf (" Finish \ n ") ;}} return 0 ;}