/*

  Made by Jelmer Firet.
  Competition manager for the game Tumbleweed (CodeCup 2027).
  For more information: www.codecup.org.
  This program is part of the Caia project for the CodeCup 2027.
  The code is "as it is".

*/

#include <iostream>
#include <random>
#include <utility>
using namespace std;

const int ORDER = 6;
const int SIZE = (2*ORDER-1);

std::random_device rd;
std::mt19937 rng(rd());

pair<int,int> generateStack() {
	int row, col;
	while(true) {
		row = 1 + rng() % (SIZE - 2);
		col = 1 + rng() % (SIZE - 2);
		if (abs(row-col) >= ORDER-1) continue;
		if (row == ORDER-1 and col == ORDER-1) continue;
		break;
	}
	return {row, col};
}

int main() {

	int redRow, redCol, whiteRow, whiteCol;
	while(true) {
		tie(redRow, redCol) = generateStack();
		tie(whiteRow, whiteCol) = generateStack();
		if (redRow == whiteRow and redCol == whiteCol) continue;
		if (abs(redRow-whiteRow) > 1) break;
		if (abs(redCol-whiteCol) > 1) break;
		if (redRow + redCol == whiteRow + whiteCol) break;
	}
	cout << (char)('A' + redCol) << (1 + redRow) << endl;
	cout << (char)('A' + whiteCol) << (1 + whiteRow) << endl;
	return 0;
}
