#include using namespace std; int n, k; long long a[200000], b[200000]; pair c[200000]; char s[200001]; int main() { cin >> n >> k; for (int i = 0; i < n; i++) cin >> a[i]; for (int i = 0; i < n; i++) cin >> b[i]; for (int i = 0; i < n; i++) c[i] = { a[i] - b[i], i }; sort(c, c + n); for (int i = 0; i < n - k; i++) s[c[i].second] = 'B'; for (int i = n - k; i < n; i++) s[c[i].second] = 'A'; cout << s << endl; }