#include<bits/stdc++.h>
using namespace std;
const int MAX = 100 * 1000;
int A[MAX], B[MAX];
bool ANS[MAX];
int main()
{
int n, x, y;
cin >> n >> x >> y;
vector<pair<int,int> > vec;
for(int i = 0; i < n; i++)
{
cin >> A[i] >> B[i];
vec.push_back({B[i] - A[i], i});
}
sort(vec.begin(), vec.end(), greater<pair<int,int> >());
int cnt = 0;
for(int i = 0; i < n; ++i)
{
if (vec[i].first > 0) cnt++;
}
cnt = min(cnt, y);
cnt = max(cnt, n - x);
for(int i = 0; i < cnt; ++i)
{
ANS[vec[i].second] = 1;
}
for(int i = 0; i < n; i++)
{
cout << (ANS[i] ? 'B' : 'A');
}
return 0;
}