# Codeforces Round #182 (Div. 2) # Problem A # URL: https://codeforces.com/problemset/problem/1822/A def main(): cases = int(input()) for case in range(cases): video, lunch = input().split() videos_lengths = input().split() entertainment = input().split() print(video, lunch, videos_lengths, entertainment) if __name__ == '__main__': main() # Path: 1822B/main.py