import scala.annotation.tailrec import scala.io.StdIn.* @main def main = val Array(n, k) = readLine().split(' ').map(_.toInt) val a = readLine().split(' ').map(_.toLong) val b = readLine().split(' ').map(_.toLong) val result = Array.fill(n){'B'} for i <- (0 until n).sortWith{(i, j) => (a(j) - b(j)) < (a(i) - b(i))}.take(k) do result(i) = 'A' println(result.mkString)