/*------------------------------------------------------------
TEAM50
A
238
Target: MSVC9; Platform: Win32; Comment: MS Visual C++ 9
------------------------------------------------------------*/
#pragma comment(linker,"/STACK:64000000")
#define _CRT_SECURE_NO_WARNINGS

#include<algorithm>
#include<cmath>
#include<ctime>
#include<iostream>
#include<map>
#include<memory.h>
#include<string>
#include<sstream>
#include<set>
#include<vector>

using namespace std;

#define WR printf
#define RE scanf
#define FI first
#define SE second
#define PB push_back
#define MP make_pair

#define FOR(i,a,b)  for(int i = (a);i<=(b);i++)
#define DFOR(i,a,b) for(int i = (a);i>=(b);i--)
#define SZ(a)       ((int)(a).size())
#define FA(i,a)     FOR(i,0,SZ(a)-1)
#define RFA(i,a)    DFOR(i,SZ(a)-1,0)
#define CLR(a)      memset(a,0,sizeof(a))

#define VI  vector<int>
#define PAR pair<int,int>
#define LL  long long
#define o_O 1000000000

void __never(int a){WR("%d",a);}
#define ass(s) {if(!(s)){__never(__LINE__);cout.flush();cerr.flush();abort();} }


int dx[2][3] = {1,1,1,-1,-1,-1};
int dy[2][3] = {-1,1,0,-1,1,0};
int la[2] = {7,0};
int pre_la[2] = {6,1};
int bo[8][8];
int ME = -1, VR = -1;


PAR get_xy(string s){
	ass(SZ(s)==2);
	return MP(s[1]-'1',s[0]-'a');
}
string make_xy(PAR a){
	string res = "  ";
	res[0] = a.second + 'a';
	res[1] = a.first + '1';
	return res;
}
void make_move(string s){
	PAR from = get_xy(s.substr(0,2));
	PAR to = get_xy(s.substr(2,2));
	bo[to.FI][to.SE] = bo[from.first][from.second];
	ass(bo[from.first][from.second]!=-1);
	bo[from.first][from.second] = -1;
}


int _me[10][10];
int _vr[10][10];
void calc(){
	CLR(_me);
	CLR(_vr);
	FOR(i,0,7) FOR(j,0,7) if (bo[i][j]==ME){
		FOR(k,0,1){
			int hx = i + dx[ME][k];
			int hy = j + dy[ME][k];
			if (0<=hx && hx<8 && 0<=hy && hy<8) {
				_me[hx][hy]++;
			}
		}
	}
	
	FOR(i,0,7) FOR(j,0,7) if (bo[i][j]==VR){
		FOR(k,0,1){
			int hx = i + dx[VR][k];
			int hy = j + dy[VR][k];
			if (0<=hx && hx<8 && 0<=hy && hy<8) {
				_vr[hx][hy]++;
			}
		}
	}
}



PAR ord[100];
bool flag[10][10];
int d[10][10];
int be, en;

PAR ord2[100];
bool flag2[10][10];
int d2[10][10];
int be2, en2;
PAR par2[10][10];
PAR can(int x, int y){
	CLR(flag2);
	flag2[x][y] = true;
	ord2[be2 = en2 = 1] = MP(x,y);
	FOR(i,0,7) FOR(j,0,7) d2[i][j] = o_O;
	d2[x][y] = 0;
	while (be2<=en2){
		PAR cur = ord2[be2++];
		FOR(k,0,2){
			int hx = cur.first + dx[ME][k];
			int hy = cur.second + dy[ME][k];
			if (0<=hx && hx<8 && 0<=hy && hy<8 && !flag2[hx][hy] && d[hx][hy]>d2[cur.first][cur.second]+1) {
				flag2[hx][hy] = true;
				d2[hx][hy] = d2[cur.first][cur.second]+1;
				ord2[++en] = MP(hx,hy);
				par2[hx][hy] = cur;
			}
		}
	}
	int MI = o_O;
	PAR cur;
	FOR(i,0,7) {
		MI = min(MI,d2[la[ME]][i]);
		cur = MP(la[ME],i);
	}
	if (MI<o_O){
		while (d2[cur.first][cur.second]>1) cur = par2[cur.first][cur.second];
		return cur;
	}
	return MP(-1,-1);
}
string halls(){
	be = 1;
	en = 0;
	CLR(flag);
	FOR(i,0,7) FOR(j,0,7) d[i][j] = o_O;
	FOR(i,0,7) FOR(j,0,7) if (bo[i][j]==VR) {
		ord[++en] = MP(i,j);
		flag[i][j] = true;
		d[i][j] = 0;
	}
	while(be<=en){
		PAR cur = ord[be++];
		FOR(k,0,2){
			int hx = cur.first + dx[VR][k];
			int hy = cur.second + dy[VR][k];
			if (0<=hx && hx<8 && 0<=hy && hy<8 && !flag[hx][hy]) {
				flag[hx][hy] = true;
				d[hx][hy] = d[cur.first][cur.second] + 1;
				ord[++en] = make_pair(hx,hy);
			}
		}
	}
	FOR(i,0,7) FOR(j,0,7) if (bo[i][j]==ME){
		PAR temp = can(i,j);
		if (temp.first!=-1) {
			return make_xy(MP(i,j)) + make_xy(temp);
		}
	}
	return "sorry";
}
string one_move(){
	FOR(i,0,7) if (bo[pre_la[ME]][i]==ME){
		if (i<7) {
			return make_xy(MP(pre_la[ME],i)) + make_xy(MP(la[ME],i+1));
		} else {
			return make_xy(MP(pre_la[ME],i)) + make_xy(MP(la[ME],i-1));
		}
	}
	return "sorry";
}
string __one_move(){
	int cc = 0;
	PAR last;
	FOR(i,0,7) FOR(j,0,7) if (bo[i][j]==VR) {
		cc++;
		last = MP(i,j);
	}
	if (cc==1) {
		calc();
		if (_me[last.first][last.second]>0){
			FOR(k,0,1) {
				int hx = last.first - dx[ME][k];
				int hy = last.second - dy[ME][k];
				if (0<=hx && hx<8 && 0<=hy && hy<8 && bo[hx][hy]==ME){
					return make_xy(MP(hx,hy)) + make_xy(last);
				}
			}
			ass(false);
		}
	}
	return "sorry";
}
string kill(){
	calc();
	FOR(i,0,7) FOR(j,0,7) if (bo[i][j]==VR){
		if (_me[i][j]>_vr[i][j]){
			FOR(k,0,1) {
				int hx = i - dx[ME][k];
				int hy = j - dy[ME][k];
				if (0<=hx && hx<8 && 0<=hy && hy<8 && bo[hx][hy]==ME){
					return make_xy(MP(hx,hy)) + make_xy(MP(i,j));
				}
			}
			ass(false);
		}
	}
	return "sorry";
}
int ___copy[10][10];
bool saved = false;
void Save_copy(){
	FOR(i,0,7) FOR(j,0,7) ___copy[i][j] = bo[i][j];
	saved = true;
}
void Back_up(){
	ass(saved);
	FOR(i,0,7) FOR(j,0,7) bo[i][j] = ___copy[i][j];
}

PAR check(){
	calc();
	int my = 0, vr = 0;
	FOR(i,0,7) FOR(j,0,7) {
		if (bo[i][j]==ME){
			my+=_me[i][j];
			vr+=_vr[i][j];
		}
	}
	return MP(my,-vr);
}

string movemove(){
	bool was = false;
	PAR res(0,0);
	string res_move = "?";
	FOR(i,0,7) FOR(j,0,7) if (bo[i][j]==ME){
		FOR(k,0,2) {
			int hx = i + dx[ME][k];
			int hy = j + dy[ME][k];
			if (0<=hx && hx<8 && 0<=hy && hy<8 && bo[hx][hy]==-1) {
				//проверка
				string tmove = make_xy(MP(i,j)) + make_xy(MP(hx,hy));
				Save_copy();
				make_move(tmove);
				PAR temp = check();
				Back_up();
				if (!was || res<=temp) {
					res_move = tmove;
					res = temp;
				}
				was = true;
			}
		}
	}
	if (res_move!="?") return res_move;
	//не смогли подвинуть свою
	FOR(i,0,7) FOR(j,0,7) if (bo[i][j]==ME){
		FOR(k,0,1) {
			int hx = i + dx[ME][k];
			int hy = j + dy[ME][k];
			if (0<=hx && hx<8 && 0<=hy && hy<8 && bo[hx][hy]==VR) {
				return make_xy(MP(i,j)) + make_xy(MP(hx,hy));
			}
		}
	}
	return "sorry";
}
string think(){
	string temp;
	//-2
	temp = one_move();
	if (temp!="sorry") {
		return temp;
	}
	//-1 убить последнюю ?
	temp = __one_move();
	if (temp!="sorry") {
		return temp;
	}
	//0 - коридоры
	temp = halls();
	if (temp!="sorry") {
		return temp;
	}
	//1 - шо срубить?
	temp = kill();
	if (temp!="sorry"){
		return temp;
	}
	//2 - куды подвинуть?
	temp = movemove();
	ass(temp!="sorry");
	return temp;
}

bool FIRST_MOVE = true;
void sol(){
	FOR(i,0,1) FOR(j,0,7) bo[i][j] = 0;
	FOR(i,2,5) FOR(j,0,7) bo[i][j] = -1;
	FOR(i,6,7) FOR(j,0,7) bo[i][j] = 1;


	for(;;) {
		char str[100];
		gets(str);
		if(!strcmp(str,"Name")) {
		  // Request for the bot name
		  printf("TC bot v3\n");
		  fflush(stdout);
		}
		else if(!strcmp(str,"Quit")) {
		  // Game is over
		  break;
		}
		else {
		  if(strcmp(str,"Start")) {
			// Enemy's move
			make_move(string(str));
		  }
		  // Our move
		  if (FIRST_MOVE) {
			  FIRST_MOVE = false;
			  if (strcmp(str,"Start")) {
				  ME = 1;
			  } else {
				  ME = 0;
			  }
			  VR = 1 - ME;
		  }

		  string temp = think();
		  make_move(temp);
		  cout << temp<<endl;
		  fflush(stdout);
		}
  }

}
int main(){
	//freopen("input.txt","r",stdin);
	//freopen("output.txt","w",stdout);
	sol();
	return 0;
}
