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

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

public class OSU_Champ_Bot
{
	
	public class MyMove implements Comparable<MyMove>{
		GameMove gamemove;
		int weight;
		MyMove(GameMove gamemove, int weigth) {
			this.gamemove = new GameMove(gamemove.sx, gamemove.sy, gamemove.ex, gamemove.ey);
			this.gamemove.is_capture=gamemove.is_capture;
			this.weight = weigth;
		}
		@Override
		public int compareTo(MyMove arg0) {
			if (weight!=arg0.weight) return arg0.weight-weight;
			return 0;
		}
		
		
	}
	public static void main(String[] argv) throws IOException
	{
		new OSU_Champ_Bot().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;

	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;
		random = new Random(314159265358L);
	}
	private void initBoard(int [][]v){
		board = new Cell[BOARD_SIZE][BOARD_SIZE];
		
		for (int i=0; i<BOARD_SIZE; i++){
			for (int j=0; j<BOARD_SIZE; j++){
				if (v[i][j]==0)
					board[i][j]=Cell.EMPTY;
				if (v[i][j]==1)
					board[i][j]=Cell.WHITE;
				if (v[i][j]==2)
					board[i][j]=Cell.BLACK;
							
			}
		}
		currentColor = Cell.WHITE;
		random = new Random(314159265358L);
	}

	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 ArrayList<GameMove> genMoves(Cell color){
		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] == color){
					for (int dj=-1; dj<=1; dj++){
						int ni = i + ((color == 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;
	}
	
	

	private GameMove getNextMove(){
		GameMove move = null;
		/*
		ArrayList<GameMove> moves = genMoves(currentColor);
		int max=0;
		for (GameMove mov:moves){
			int temp=getGoodMove(board, currentColor, 0).weight;
			if (move==null ||temp>max){
				max=temp;
				move=mov;
			}
		}
		*/
		move=getGoodMove(board, (currentColor==Cell.WHITE)?Cell.WHITE:Cell.BLACK, 0).gamemove;
		makeMove(move);
		return move;
	}
	
	private MyMove getGoodMove(Cell Board[][],Cell color, int deep){
		ArrayList<GameMove> moves = genMoves(color);
		GameMove ans=null;
		Cell B[][]=new Cell[BOARD_SIZE][BOARD_SIZE];
		for (int i=0;i<BOARD_SIZE;i++){
			for (int j=0;j<BOARD_SIZE;j++){
				B[i][j]=Board[i][j];
			}
		}
		MyMove weight[]=new MyMove[moves.size()];
		int cnt=0;
		for (GameMove move:moves){
			Cell temp=B[move.ex][move.ey];
			B[move.ex][move.ey]=B[move.sx][move.sy];
			B[move.sx][move.sy]=Cell.EMPTY;
			weight[cnt++]=new MyMove(move,calcWeight(B, color));
			if (weight[cnt-1].weight==Integer.MAX_VALUE){
				return weight[cnt-1];
			}
			B[move.sx][move.sy]=B[move.ex][move.ey];
			B[move.ex][move.ey]=temp;
		}
		Arrays.sort(weight);
		MyMove max=null;
		if (deep>=MAX_DEEP)
			return weight[0];
		int maxdeep=Math.min((int)Math.pow(2, 4-deep),weight.length);
		for (int i=0;i<maxdeep;i++){
			Cell temp=B[weight[i].gamemove.ex][weight[i].gamemove.ey];
			B[weight[i].gamemove.ex][weight[i].gamemove.ey]=B[weight[i].gamemove.sx][weight[i].gamemove.sy];
			B[weight[i].gamemove.sx][weight[i].gamemove.sy]=Cell.EMPTY;
			weight[i].weight=getGoodMove(B, (color==Cell.WHITE)?Cell.BLACK:color, deep+1).weight;
			B[weight[i].gamemove.sx][weight[i].gamemove.sy]=B[weight[i].gamemove.ex][weight[i].gamemove.ey];
			B[weight[i].gamemove.ex][weight[i].gamemove.ey]=temp;
		}
		Arrays.sort(weight);
		return weight[0];
		
	}
	
	
	
	private final int WEIGHT_FIGURE=100;
	private final int W_Second_Line=1000;
	private final int MAX_DEEP=3;
	private final int DIRKA=150;
	private int calcWeight(Cell B[][], Cell color){
	    int ans=0;
		for (int i=0;i<B.length;i++){
			for (int j=0;j<B.length;j++){
				if ((i==0 && B[i][j]==Cell.BLACK)|| (i==B.length-1 && B[i][j]==Cell.WHITE)){
					if (B[i][j]==color){
						return Integer.MAX_VALUE;
					}
					else
						return -Integer.MAX_VALUE;
				}
				if (B[i][j]!=Cell.EMPTY){
					if (color==B[i][j]){
						ans+=WEIGHT_FIGURE;
					}
					else
						ans-=WEIGHT_FIGURE;
				}
				if ((i==1 && B[i][j]==Cell.BLACK)||(i==6 && B[i][j]==Cell.WHITE)){
					if (color==B[i][j]){
						ans+=W_Second_Line;
					}
					else
						ans-=W_Second_Line;
				}
				
				//дырки
				if ((i<4 && color==Cell.WHITE)|| (i>=4 && color==Cell.BLACK)){
					int d=-1;
					if (color==Cell.BLACK)
						d=1;
					if ((i+d>=0 && i+d<B.length && j-1>=0 && j-1<B.length && B[i+d][j-1]!=color) ||
						(i+d>=0 && i+d<B.length && B[i+d][j]!=color) ||
						(i+d>=0 && i+d<B.length && j+1<B.length && B[i+d][j+1]!=color)){
						if (bitCell(B, i-d, j-1, color)>0 ||
								bitCell(B, i-d, j, color)>0 ||
								bitCell(B, i-d, j+1, color)>0){
							ans-=DIRKA;
						}
						
					}
						
				}
				
								
			}
		}
		return ans;
		
	}
	public int bitCell(Cell B[][],int x, int y, Cell color){
		int  ok=0;
		if (x>=0 && x<B.length && y>=0 && y<B.length){
			int d=1;
			if (color==Cell.BLACK){
				d=-1;
			}	
				if (x+d<B.length && y-1>=0 && B[x+d][y-1]==color)
				{
					ok++;
				}
				if (x+d<B.length && y+1<B.length && B[x+d][y+1]==color){
					ok++;
				}
			return ok;
	}
		else
			return 0;
	}
	/*
	public boolean Prohod(Cell B[][], Cell cell){
		
	}
	*/
	
	public int[][] readM(){
		int ans[][]=new int[BOARD_SIZE][BOARD_SIZE];
		try {
			BufferedReader br=new BufferedReader(new FileReader("input.txt"));
			for (int i=0;i<BOARD_SIZE;i++){
				StringTokenizer st=new StringTokenizer(br.readLine());
				for (int j=0;j<BOARD_SIZE;j++){
					ans[i][j]=Integer.valueOf(st.nextToken());
				}
			}
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return ans;
		
	}
	public void run() throws IOException
	{
		in = new Scanner(System.in);
		out = new PrintWriter(System.out);

		initBoard();
	//	int v[][]=readM();
	//	initBoard(v);
		while (true){
			String theirMove = in.nextLine();
			if (theirMove.equals("Name")){
				out.println("OSU_Champ");
				out.flush();
			}
			else if (theirMove.equals("Quit")){
				return;
			}
			else{
				if (!theirMove.equals("Start")){
					makeMove(new GameMove(theirMove));
				}
				// пишем свой ход, переопределяем getNextMove
			 	out.println(getNextMove().toString());
				out.flush();
			}
		}
	}
}
