using System.Linq; using System; public class P { public int amb { get; set; } public int id { get; set; } } public class Hello { static void Main() { string[] line = Console.ReadLine().Trim().Split(' '); var n = int.Parse(line[0]); var k = int.Parse(line[1]); line = Console.ReadLine().Trim().Split(' '); var a = Array.ConvertAll(line, int.Parse); line = Console.ReadLine().Trim().Split(' '); var b = Array.ConvertAll(line, int.Parse); var ps = new P[n]; var ans = new char[n]; for (int i = 0; i < n; i++) { ps[i] = new P { id = i, amb = a[i] - b[i] }; ans[i] = 'B'; } getAns(n, k, ps, ans); } static void getAns(int n, int k, P[] ps, char[] ans) { foreach (var x in ps.OrderByDescending(x => x.amb).Take(k)) ans[x.id] = 'A'; Console.WriteLine(new string(ans)); } }