use std::cmp::Reverse; fn main() { let mut nk = String::new(); std::io::stdin().read_line(&mut nk).ok(); let nk: Vec = nk.trim().split_whitespace().map(|s| s.parse().unwrap()).collect(); let n = nk[0]; let k = nk[1]; let mut a = String::new(); std::io::stdin().read_line(&mut a).ok(); let a: Vec = a.trim().split_whitespace().map(|s| s.parse().unwrap()).collect(); let mut b = String::new(); std::io::stdin().read_line(&mut b).ok(); let b: Vec = b.trim().split_whitespace().map(|s| s.parse().unwrap()).collect(); let mut orders = (0..n).collect::>(); orders.sort_by_key(|&i| Reverse(a[i] - b[i])); let mut result = vec!["B"; n]; for &i in orders.iter().take(k) { result[i] = "A"; } println!("{}", result.join("")); }