#include <iostream>
using namespace std;
int main() {
int k1;
char k0;
cin >> k0 >> k1;
int n = 8; //Вводим n, чтобы иметь возможность изменить размер доски в случае необходимости
char mid = char (('a' + n) - n / 2); //Находим середину доски
if ( k1 != 1) {
if (k0 < mid) cout << char(k0 + 3) << k1 << "\n" << char(k0 + 1) << k1 - 1;
else cout << char(k0 - 3) << k1 << "\n" << char(k0 - 1) << k1-1;
}
else {
if (k0 < mid) cout << char(k0 + 3) << k1 << "\n" << char(k0 + 1) << k1 + 1;
else cout << char(k0 - 3) << k1 << "\n" << char(k0 - 1) << k1 + 1;
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CglpbnQgazE7CgljaGFyIGswOwoJY2luID4+IGswID4+IGsxOwoJaW50IG4gPSA4OyAvL9CS0LLQvtC00LjQvCBuLCDRh9GC0L7QsdGLINC40LzQtdGC0Ywg0LLQvtC30LzQvtC20L3QvtGB0YLRjCDQuNC30LzQtdC90LjRgtGMINGA0LDQt9C80LXRgCDQtNC+0YHQutC4INCyINGB0LvRg9GH0LDQtSDQvdC10L7QsdGF0L7QtNC40LzQvtGB0YLQuAoJY2hhciBtaWQgPSBjaGFyICgoJ2EnICsgbikgLSBuIC8gMik7IC8v0J3QsNGF0L7QtNC40Lwg0YHQtdGA0LXQtNC40L3RgyDQtNC+0YHQutC4CglpZiAoIGsxICE9IDEpIHsKCQlpZiAoazAgPCBtaWQpIGNvdXQgPDwgY2hhcihrMCArIDMpIDw8IGsxIDw8ICJcbiIgPDwgY2hhcihrMCArIDEpIDw8IGsxIC0gMTsKCQllbHNlIGNvdXQgPDwgY2hhcihrMCAtIDMpIDw8IGsxIDw8ICJcbiIgPDwgY2hhcihrMCAtIDEpIDw8IGsxLTE7Cgl9CgllbHNlIHsKCQlpZiAoazAgPCBtaWQpIGNvdXQgPDwgY2hhcihrMCArIDMpIDw8IGsxIDw8ICJcbiIgPDwgY2hhcihrMCArIDEpIDw8IGsxICsgMTsKCQllbHNlIGNvdXQgPDwgY2hhcihrMCAtIDMpIDw8IGsxIDw8ICJcbiIgPDwgY2hhcihrMCAtIDEpIDw8IGsxICsgMTsKCX0gCglyZXR1cm4gMDsKfQ==