import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.Arrays; import java.util.PriorityQueue; public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String[] sa = br.readLine().split(" "); int n = Integer.parseInt(sa[0]); int k = Integer.parseInt(sa[1]); sa = br.readLine().split(" "); Obj[] arr = new Obj[n]; for (int i = 0; i < n; i++) { Obj o = new Obj(); o.i = i; o.a = Integer.parseInt(sa[i]); arr[i] = o; } PriorityQueue que = new PriorityQueue<>((o1, o2) -> Long.compare(o2.v, o1.v)); sa = br.readLine().split(" "); for (int i = 0; i < n; i++) { Obj o = arr[i]; o.b = Integer.parseInt(sa[i]); o.v = o.a - o.b; que.add(o); } br.close(); char[] ans = new char[n]; Arrays.fill(ans, 'B'); for (int i = 0; i < k; i++) { Obj o = que.poll(); ans[o.i] = 'A'; } System.out.println(ans); } static class Obj { int i, a, b; long v; } }