local n, k = io.read("*n", "*n") local a = {} for i = 1, n do a[i] = io.read("*n") end local t = {} for i = 1, n do t[i] = "B" end local idx = {} for i = 1, n do a[i] = a[i] - io.read("*n") idx[i] = i end table.sort(idx, function(x, y) return a[x] > a[y] end) for i = 1, k do t[idx[i]] = "A" end print(table.concat(t))