def main(): n = int(input()) st = input() for _ in range(int(input())): print(main())