#include #include using namespace std; int strToInt(string str) { stringstream sstream; int ret; sstream.str(str); sstream >> ret; return ret; } bool middleNumberIsEqual(string a, string b) { return (a[a.length()/2] == b[b.length()/2]); } int main() { int n, turn = 0; string a,b; cin >> n; cin >> a; for(int i = 1; i < 2*n; i++) { turn++; cin >> b; if(!(a.length() % 2)) { cout << "B" << endl; return 0; } else if(!(b.length() % 2)) { cout << "A" << endl; return 0; } if(!middleNumberIsEqual(a,b)) { if(turn % 2) { cout << "A" << endl; return 0; } cout << "B" << endl; return 0; } a = b; } cout << "=" << endl; return 0; }