/*------------------------------------------------------------
TEAM33
A
230
Target: Java6; Platform: Win32; Comment: Java (JDK 6)
------------------------------------------------------------*/

import java.util.*;
import java.io.*;

public class STBot_6
{
	public static void main(String[] argv) throws IOException
	{
		new STBot_6().run();
	}
	
	Scanner in;
	PrintWriter out;

	public static final int BOARD_SIZE = 8;

	public static enum Cell{
		EMPTY, WHITE, BLACK;
		public static Cell opposite(Cell cell){
			return (cell == WHITE) ? BLACK : WHITE;
		}
	}

	Cell board[][] = new Cell[BOARD_SIZE][BOARD_SIZE];
	Cell currentColor;
	Random random;
	
	int white_here[][], black_here[][];
	
	public void where()
	{
		for (int i=0; i<BOARD_SIZE; i++)
		{
			for (int j=0; j<BOARD_SIZE; j++)
			{
				white_here[i][j] = 0;
				if (board[i][j] == Cell.WHITE)
				{
					white_here[i][j] = 1;
				}
				
				black_here[i][j] = 0;
				if (board[i][j] == Cell.BLACK)
				{
					black_here[i][j] = 1;
				}				
			}
		}
		
		for (int i=0; i<BOARD_SIZE; i++)
		{
			for (int j=0; j<BOARD_SIZE; j++)
			{
				if (board[i][j] == Cell.WHITE)
				{
					for (int k=i+1; k<BOARD_SIZE; k++)
					{
						int l = k-i;
						white_here[k][j] = 1;
						if (j-l >= 0)
						{
							white_here[k][j-l] = 1;
						}
						if (j+l<BOARD_SIZE)
						{
							white_here[k][j+l] = 1;
						}
					}
				}
				if (board[i][j] == Cell.BLACK)
				{
					for (int k=i-1; k>=0; k--)
					{
						int l = i-k;
						black_here[k][j] = 1;
						if (j-l >= 0)
						{
							black_here[k][j-l] = 1;
						}
						if (j+l<BOARD_SIZE)
						{
							black_here[k][j+l] = 1;
						}
					}
				}				
			}
		}

	}
	
	public GameMove getfree()
	{
		where();
		
		
			
		ArrayList<GameMove> gm = new ArrayList<GameMove>();
		
		if (currentColor==Cell.WHITE)
		{
			for (int i=0; i<BOARD_SIZE; i++)
			{
				for (int j=0; j<BOARD_SIZE; j++)
				{
					if (board[i][j] == currentColor)
					{		

						int ni = i + ((currentColor == Cell.WHITE) ? 1 : -1);
						int nj = j;
						
						if (black_here[i][j] == 0 && 
								(validForMove(ni, nj) && 
										board[ni][nj] == Cell.EMPTY))
						{
							//замечательная ситуация							
							gm.add(new GameMove(i,j,ni,nj));
						}
					
					}
				}
			}
		}
		
		if (currentColor==Cell.BLACK)
		{
			for (int i=0; i<BOARD_SIZE; i++)
			{
				for (int j=0; j<BOARD_SIZE; j++)
				{
					if (board[i][j] == currentColor)
					{		

						int ni = i + ((currentColor == Cell.WHITE) ? 1 : -1);
						int nj = j;
						
						if (white_here[i][j] == 0 && 
								(validForMove(ni, nj) && 
										board[ni][nj] == Cell.EMPTY))
						{
							//замечательная ситуация							
							gm.add(new GameMove(i,j,ni,nj));
						}
					
					}
				}
			}
		}
		
		if (gm.size()<1)
		{
			return null;
		} else
		{
			int t;
			int r;
			if (currentColor == Cell.WHITE)
			{
				t = 0;
				r = gm.get(0).sx;
				for (int i=0; i<gm.size(); i++)
				{
					if (gm.get(i).sx>r)
					{
						r = gm.get(i).sx;
						t = i;
					}
				}
			} else
			{
				t = 0;
				r = gm.get(0).sx;
				for (int i=0; i<gm.size(); i++)
				{
					if (gm.get(i).sx<r)
					{
						r = gm.get(i).sx;
						t = i;
					}
				}				
			}
			return gm.get(t);				
		}		
	}

	public class GameMove{
		int sx, sy, ex, ey;
		boolean is_capture;
		GameMove(String move){
			sx = (int)move.charAt(1) - '1';
			sy = (int)move.charAt(0) - 'a';
			ex = (int)move.charAt(3) - '1';
			ey = (int)move.charAt(2) - 'a';
			is_capture = (board[ex][ey] != Cell.EMPTY);
		}
		public String toString(){
			return  String.valueOf((char)(sy+'a')) + String.valueOf(sx+1) +
					String.valueOf((char)(ey+'a')) + String.valueOf(ex+1);
		}
		GameMove(int _sx, int _sy, int _ex, int _ey){
			sx = _sx;
			sy = _sy;
			ex = _ex;
			ey = _ey;
			is_capture = (board[ex][ey] != Cell.EMPTY);
		}
	}

	public boolean validForMove(int x, int y){
		return (x>=0 && x<BOARD_SIZE && y>=0 && y<BOARD_SIZE && board[x][y] != currentColor);
	}

	private void initBoard(){
		board = new Cell[BOARD_SIZE][BOARD_SIZE];
		for (int i=0; i<BOARD_SIZE; i++){
			for (int j=0; j<BOARD_SIZE; j++){
				if (i <= 1) board[i][j] = Cell.WHITE;
				else if (i >= BOARD_SIZE-2) board[i][j] = Cell.BLACK;
				else board[i][j] = Cell.EMPTY;
			}
		}
		currentColor = Cell.WHITE;
		Date d = new Date();
		long rnd = d.getTime();
		random = new Random(rnd);
	}

	private void makeMove(GameMove move){
		board[move.ex][move.ey] = board[move.sx][move.sy];
		board[move.sx][move.sy] = Cell.EMPTY;
		currentColor = Cell.opposite(currentColor);
	}

	private GameMove genMoves(){
	/*	ArrayList<GameMove> moves = new ArrayList<GameMove>();
		for (int i=0; i<BOARD_SIZE; i++){
			for (int j=0; j<BOARD_SIZE; j++){
				if (board[i][j] == currentColor){
					for (int dj=-1; dj<=1; dj++){
						int ni = i + ((currentColor == Cell.WHITE) ? 1 : -1);
						int nj = j + dj;
						if (validForMove(ni, nj) && (dj != 0 || board[ni][nj] == Cell.EMPTY)){
							moves.add(new GameMove(i,j,ni,nj));
						}
					}
				}
			}
		}
		return moves;
	*/
		
		//where();
		
		GameMove goodmove = getfree();
		if (goodmove!=null)
		{
			return goodmove;
		}
		GameMove m = null;
		boolean frag = false;
		
		for (int i=0; i<BOARD_SIZE; i++)
		{
			for (int j=0; j<BOARD_SIZE; j++)
			{

				if (board[i][j] == currentColor)
				{
					for (int dj=-1; dj<=1; dj++)
					{
						int ni = i +((currentColor == Cell.WHITE) ? 1 : -1);
						int nj = j + dj;
						if (validForMove(ni,nj) && dj !=0 && board[ni][nj] == Cell.opposite(currentColor))
						{
							m = new GameMove(i,j,ni,nj);
							frag = true;
						}
					}
				}
			}
		}
		
		int fi = -1;
		int fj  = -1;
		
		if (!frag)
		{
			for (int i=0; i<BOARD_SIZE; i++)
			{
				for (int j=0; j<BOARD_SIZE; j++)
				{
					if (board[i][j] == currentColor)
					{
						int ni = i +((currentColor == Cell.WHITE) ? 1 : -1);
						for (int dj=-1; dj<=1; dj++)
						{					
							int nj = j + dj;
							if (currentColor == Cell.WHITE)
							{
								if (((fi==-1)||(i<fi)) && 
										(validForMove(ni, nj) && (dj != 0 || board[ni][nj] == Cell.EMPTY)))
								{
									fj = j;
									fi = i;
								}								
							} else
							{
								if (((fi==-1)||(i>fi))&& 
										(validForMove(ni, nj) && (dj != 0 || board[ni][nj] == Cell.EMPTY)))
								{
									fj = j;
									fi = i;
								}
							}
						}
						
					}
				}
			}
			



			
			int d = ((currentColor == Cell.WHITE) ? 1 : -1);
			
			ArrayList<GameMove> cc = new ArrayList<GameMove>();
			for (int j=0; j<BOARD_SIZE; j++)
			{
				if (board[fi][j] == currentColor)
				{
					for (int dj=-1; dj<=1; dj++)
					{
						int nj = j+dj;
						int ni = fi + d;
						if (validForMove(ni,nj)&&(dj != 0 || board[ni][nj] == Cell.EMPTY))
						{
							cc.add(new GameMove(fi,j,ni,nj));
						}
					}
				}
			}
			
/*	
			
			ArrayList<Integer> Igr = new ArrayList<Integer>();
						
			if (validForMove(fi+d, fj-1))
			{
				Igr.add(-1);
			}
			if (validForMove(fi+d, fj)&&(board[fi+d][fj] == Cell.EMPTY))
			{
				Igr.add(0);
			}
			if (validForMove(fi+d, fj+1))
			{
				Igr.add(1);
			}			
			
			int dj = Igr.get(random.nextInt(Igr.size()));
			//int dj = 0;
*/			
			m = cc.get(random.nextInt(cc.size()));
			
		}
		
		
		return m;
	}

	private GameMove getNextMove(){
		//ArrayList<GameMove> moves = genMoves();
		//GameMove move = moves.get(random.nextInt(moves.size()));
		
		GameMove move = genMoves();		
		
		makeMove(move);
		return move;
	}

	public void run() throws IOException
	{
		black_here = new int[BOARD_SIZE][BOARD_SIZE];
		white_here = new int[BOARD_SIZE][BOARD_SIZE];
		
		in = new Scanner(System.in);
		out = new PrintWriter(System.out);

		initBoard();
		while (true){
			String theirMove = in.nextLine();
			if (theirMove.equals("Name")){
				out.println("SyktSUSuperTeam_v6");
				out.flush();
			}
			else if (theirMove.equals("Quit")){
				return;
			}
			else{
				if (!theirMove.equals("Start")){
					makeMove(new GameMove(theirMove));
				}
				out.println(getNextMove().toString());
				out.flush();
			}
		}
	}
}
