~!#~#@~!@~~~
import java.util.Base64;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int casee = 0;
int t = sc.nextInt();
while (t > 0) {
t--;
casee++;
int k = sc.nextInt();
String str = sc.next();
byte tt[] = str.getBytes(); //转成byte型
for (int i = 0; i < k; ++i) {
tt = Base64.getEncoder().encode(tt); //加密
//Base64.getDecoder().decode(tt); //解密
} //coder 编码器
System.out.println("Case #" + casee + ": " + (new String(tt)));
//输出要转回来
}
}
}