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

public class chess_nn implements Runnable {
    public static void main(String[] args) {
        new chess_nn().run();
    }

    class FastScanner {
        BufferedReader br;
        StringTokenizer st;
        boolean eof;
        String buf;

        public FastScanner(String fileName) throws FileNotFoundException {
            br = new BufferedReader(new FileReader(fileName));
            nextToken();
        }

        public FastScanner(InputStream stream) {
            br = new BufferedReader(new InputStreamReader(stream));
            nextToken();
        }

        String nextToken() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (Exception e) {
                    eof = true;
                    break;
                }
            }
            String ret = buf;
            buf = eof ? "-1" : st.nextToken();
            return ret;
        }

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

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

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

        void close() {
            try {
                br.close();
            } catch (Exception e) {

            }
        }

        boolean isEOF() {
            return eof;
        }
    }

    FastScanner sc;
    PrintWriter out;

    private static final String FN = "chess";

    public void run() {
        Locale.setDefault(Locale.US);
        try {
            sc = new FastScanner(FN + ".in");
            out = new PrintWriter(FN + ".out");
            solve();
            sc.close();
            out.close();
        } catch (Throwable e) {
            e.printStackTrace();
            System.exit(1);
        }
    }

    void doAssert(boolean isRight, String s) {
        if (!isRight)
            throw new AssertionError(s);
    }

    boolean rookBeats(int rX, int rY, int x, int y) {
        return rX == x || rY == y;
    }

    boolean knightBeats(int kX, int kY, int x, int y) {
        final int[] DX = { 1, 2, 1, 2, -1, -2, -1, -2 };
        final int[] DY = { 2, 1, -2, -1, -2, -1, 2, 1 };
        for (int dir = 0; dir < DX.length; dir++) {
            int i = x + DX[dir];
            int j = y + DY[dir];
            if (i == kX && j == kY) {
                return true;
            }
        }
        return false;
    }

    boolean bishopBeats(int bX, int bY, int x, int y) {
        return bX - bY == x - y || bX + bY == x + y;
    }

    String toString(int x, int y) {
        return "" + (char) (x + 'a') + (y + 1);
    }

    private void solve() {
        String knightS = sc.nextToken();
        doAssert(knightS.length() == 2, "The string's length is not 2");
        int kX = knightS.charAt(0) - 'a';
        int kY = knightS.charAt(1) - '1';
        doAssert(0 <= kX && 0 <= kY && kX < 8 && kY < 8, "");
        for (int rX = 0; rX < 8; rX++) {
            for (int rY = 0; rY < 8; rY++) {
                if ((rX == kX && rY == kY) || (!rookBeats(rX, rY, kX, kY))
                        || (knightBeats(kX, kY, rX, rY))) {
                    continue;
                }
                for (int bX = 0; bX < 8; bX++) {
                    for (int bY = 0; bY < 8; bY++) {
                        if ((bX == kX && bY == kY)
                                || (!bishopBeats(bX, bY, kX, kY))
                                || (knightBeats(kX, kY, bX, bY))
                                || (rookBeats(rX, rY, bX, bY))
                                || (bishopBeats(bX, bY, rX, rY))) {
                            continue;
                        }
                        out.println(toString(rX, rY));
                        out.println(toString(bX, bY));
                        return;
                    }
                }
            }
        }
    }
}
