#include<bits/stdc++.h> using namespace std; int p(char a){ if(a=='E')return 0; if(a=='W')return 1; if(a=='S')return 2; if(a=='N')return 3; } void ps(string a){ for(int i=0;i<a.size();i++)cout<<a[i];} int main(){ string command; int h[4]={0,0,1,-1},l[4]={1,-1,0,0},nh=50,nl=50; char ma[101][101],nf; for(int i=0;i<101;i++){ for(int j=0;j<101;j++){ ma[i][j]='#'; } } ma[nh][nl]='.'; command="LEFT"; int all_explored=0; while (true) { char feedback[2]; all_explored++; //command = ; // ps(command); cout <<endl; // cin >> feedback; // if (all_explored>15) { // cout << "END" << endl; cout << 101 << " " << 101 << endl; for (int i = 0; i < 101; i++) { for (int j = 0; j < 101; j++) { cout << ma[i][j]; } cout << endl; } break; // } else { if(command=="LEFT"){ nf=feedback[0]; command="GO"; } if(command=="RIGHT"){ nf=feedback[0]; } if(feedback[1]=='U'){ nh+=h[p(nf)]; nl+=l[p(nf)]; ma[nh][nl]='.'; command="LEFT"; } if(feedback[1]=='A'){ command="LEFT"; } } } return 0; }