#include <stdio.h> #include <string.h> #include <queue> using namespace std; int n; int vis[10000000]; int mode1,mode2; struct node { int step,status; }; void print(int x) { int tmp=x%2; if (!(x==0 || x==1)) print(x>>1); printf("%d",tmp); } int main() { int i,j,m,n; char str[100]; while (scanf("%d",&n)!=EOF) { memset(vis,0,sizeof(vis)); scanf("%s",str); scanf("%d",&m); // printf("!!1"); mode1=mode2=0; //printf("%s ",str); for (i=0;str[i]!='