#include <iostream>
#include <bitset>
#include <cassert>
using namespace std;
int n, m;
bool encode(int x, int y, int dir, int& res) {
res = dir * 64 + x * m + y;
return x >= 0 && x + dir < n && y >= 0 && y + !dir < m;
}
bool go(bitset<128> cur, int x, int y) {
int res = 0;
int move;
if (!res && encode(x - 1, y, 1, move) && !cur[move]) cur[move] = 1, res |= !go(cur, x - 1, y), cur[move] = 0;
if (!res && encode(x, y - 1, 0, move) && !cur[move]) cur[move] = 1, res |= !go(cur, x, y - 1), cur[move] = 0;
if (!res && encode(x, y, 1, move) && !cur[move]) cur[move] = 1, res |= !go(cur, x + 1, y), cur[move] = 0;
if (!res && encode(x, y, 0, move) && !cur[move]) cur[move] = 1, res |= !go(cur, x, y + 1), cur[move] = 0;
return res;
}
int main() {
cin >> n >> m;
assert(n * m < 64);
bitset<128> bs;
cout << (go(bs, 0, 0) ? 'A' : 'B') << endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8Yml0c2V0PgojaW5jbHVkZSA8Y2Fzc2VydD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCBuLCBtOwpib29sIGVuY29kZShpbnQgeCwgaW50IHksIGludCBkaXIsIGludCYgcmVzKSB7CiAgICByZXMgPSBkaXIgKiA2NCArIHggKiBtICsgeTsKICAgIHJldHVybiB4ID49IDAgJiYgeCArIGRpciA8IG4gJiYgeSA+PSAwICYmIHkgKyAhZGlyIDwgbTsKfQpib29sIGdvKGJpdHNldDwxMjg+IGN1ciwgaW50IHgsIGludCB5KSB7CiAgICBpbnQgcmVzID0gMDsKICAgIGludCBtb3ZlOwogICAgaWYgKCFyZXMgJiYgZW5jb2RlKHggLSAxLCB5LCAxLCBtb3ZlKSAmJiAhY3VyW21vdmVdKSBjdXJbbW92ZV0gPSAxLCByZXMgfD0gIWdvKGN1ciwgeCAtIDEsIHkpLCBjdXJbbW92ZV0gPSAwOwogICAgaWYgKCFyZXMgJiYgZW5jb2RlKHgsIHkgLSAxLCA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