import java.util.*;
public class MyClass { public static void main(String args[]) {
Scanner sc=new Scanner(System.in);
String boy=new String();
String crush=new String();
int test=sc.nextInt();
sc.nextLine();
int found;
while(test!=0){
boy=sc.nextLine();
sc.nextLine();
crush=sc.nextLine();
System.out.println(boy);
System.out.println(crush);
--test;
}
sc.close();
}
}