#include #include #include #include #include using namespace std; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); int32_t N, K, i; cin >> N >> K; vector A(N), B(N); for (i = 0; i != N; ++i) cin >> A[i]; for (i = 0; i != N; ++i) cin >> B[i]; vector> gap(N); int64_t bias = 0; for (i = 0; i != N; ++i) { gap[i] = { A[i] - B[i], i }; bias -= B[i]; } string S; S.resize(N, 'B'); sort(gap.begin(), gap.end(), greater>()); for (i = 0; i != K; ++i) S[gap[i].second] = 'A'; cout << S << '\n'; return 0; }