let T = Int(readLine()!)!
(0..<T).forEach { _ in
let input = readLine()!.split(separator: " ")
let R = Int(input[0])!
let S = input[1]
S.forEach { s in
print(String(repeating: s, count: R), terminator: "")
}
print() //👉 Test case 별로 구분이 되도록 줄바꿈 해주어야 한다!
}