#include #define rep(i, l, r) for (int i = (l); i < (r); i++) using namespace std; typedef long long ll; int main() { int N, K; cin >> N >> K; vector A(N), B(N); rep(i, 0, N) cin >> A[i]; rep(i, 0, N) cin >> B[i]; vector> C(N); rep(i, 0, N) { C[i] = make_pair(B[i] - A[i], i); } sort(C.begin(), C.end()); vector ans(N, 'B'); rep(i, 0, K) ans[C[i].second] = 'A'; rep(i, 0, N) cout << ans[i]; cout << endl; }