#include #include using namespace std; using LL = long long; using P = pair; using Graph = vector>; const int INF = 1 << 29; const long long LINF = 1LL << 60; #define all(x) (x).begin(), (x).end() #define rep(i,n) for(int i = 0; i < (n); ++i) templatevoid chmin(T&a, T b){if(a > b) a = b;} templatevoid chmax(T&a, T b){if(a < b) a = b;} int main(){ int N, K; cin >> N >> K; vector A(N), B(N); for(int i = 0; i < N; ++i) cin >> A[i]; for(int i = 0; i < N; ++i) cin >> B[i]; string ans = ""; for(int i = 0; i < N; ++i) ans += "A"; vector> A_B(N); for(int i = 0; i < N; ++i){ A_B[i] = make_pair(A[i]-B[i], i); } sort(A_B.begin(), A_B.end()); for(int i = 0; i < N-K; ++i){ ans[A_B[i].second] = 'B'; } cout << ans << endl; }