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

public class chess_av implements Runnable {
	public static void main(String[] args) {
		new Thread(new chess_av()).start();
	}

	BufferedReader br;

	StringTokenizer in;

	PrintWriter out;

	public String nextToken() throws IOException {
		while (in == null || !in.hasMoreTokens()) {
			in = new StringTokenizer(br.readLine());
		}

		return in.nextToken();
	}

	public int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	public long nextLong() throws IOException {
		return Long.parseLong(nextToken());
	}

	public double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}

	public class point{
		int x, y;
		
		public point(){
			x = 0;
			y = 0;
		}
		
		public point(String t){
			x = t.charAt(0) - 'a';
			y = t.charAt(1) - '1';
		}
		
		public boolean check(){
			if (x < 0 || x > 7)
				return false;
			
			if (y < 0 || y > 7)
				return false;
			
			return true;
		}
		
		public String toString(){
			return "" + (char)(x + 'a') + (char)(y + '1');
		}
	}
	
	public void solve() throws IOException {
		point knight = new point(nextToken());
		
		if (!knight.check())
			throw new AssertionError("Wrong input format!!!");
		
		point bishop = new point();
		point rook = new point();
				
		for (int i = -1; i <= 1; i += 2) {
			for (int j = -1; j <= 1; j += 2) {
				bishop.x = knight.x + 2 * i;
				bishop.y = knight.y + 2 * j;
				
				if (bishop.check())
					break;
			}
			if (bishop.check())
				break;
		}
		
		for (int i = -1; i <= 1; i += 2) {
			rook.x = knight.x + i;
			rook.y = knight.y;
			if (rook.check())
				break;
			
			rook.x = knight.x;
			rook.y = knight.y + i;
			if (rook.check())
				break;
		}
		
		out.println(rook.toString());
		out.println(bishop.toString());
	}

	public void run() {
		try {
			br = new BufferedReader(new FileReader("chess.in"));
			out = new PrintWriter("chess.out");

			solve();

			out.close();
		} catch (IOException e) {
			e.printStackTrace();
			System.exit(1);
		}
	}
}
