#include #include #include #include using namespace std; int a[15][15],tb[15][15],tras[15][15],nimerit[15][15],cnt,ok,x,y,i,j,A,B; char s[100]; int main() { cout<<7<<' '<<1<<' '<<1<<'\n'; cout.flush(); cout<<10<<' '<<3<<' '<<0<<'\n'; cout.flush(); cout<<9<<' '<<7<<' '<<0<<'\n'; cout.flush(); cout<<3<<' '<<9<<' '<<1<<'\n'; cout.flush(); cout<<1<<' '<<2<<' '<<1<<'\n'; a[1][2]=a[2][2]=a[3][2]=a[4][2]=a[5][2]=1; a[3][9]=a[4][9]=a[5][9]=a[6][9]=1; a[7][1]=a[8][1]=1; a[9][7]=a[9][8]=a[9][9]=1; a[10][3]=a[10][4]=a[10][5]=1; for(;;) { ok=cnt=0; while(!ok) { if(cnt==5000) break; x=rand()%10+1; y=rand()%10+1; if(!tras[x][y]) { tras[x][y]=1; ok=1; cout<>s; if(s[0]=='H') nimerit[x][y]=1,A++; else if(s[0]=='S') { A++; cin>>s; if(s[0]=='a') cin>>s; } } cnt++; } if(!ok) { for(i=1;i<=10;i++) { if(ok) break; for(j=1;j<=10;j++) if(!tras[i][j]) { tras[i][j]=1; ok=1; cout<>s; if(s[0]=='H') nimerit[i][j]=1,A++; else if(s[0]=='S') { A++; cin>>s; if(s[0]=='a') cin>>s; } } } } if(A==17) { cout<<"WINNER 0"<<'\n'; cout.flush(); return 0; } cin>>s; if(s[1]=='0') x=10; else x=s[0]-'0'; cin>>s; if(s[1]=='0') y=10; else y=s[0]-'0'; if(!tb[x][y]) { tb[x][y]=1; if(a[x][y]) B++; } if(B==17) { cout<<"WINNER 1"<<'\n'; cout.flush(); return 0; } } return 0; }