package algorithm;
import java.util.ArrayList;
import java.util.Scanner;
public class Solution_1228 {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
for(int test=0; test<10; test++) {
int N =input.nextInt();
ArrayList<Integer> originPassword = new ArrayList<>();
for(int i=0; i<N; i++) {
originPassword.add(input.nextInt());
}
int G = input.nextInt();
char in=' ';
int x=0;
int y=0;
int num=0;
ArrayList<Integer> put = new ArrayList<>();
for(int i=0; i<G; i++) {
in=input.next().charAt(0);
x=input.nextInt();
y=input.nextInt();
for(int j=0; j<y; j++) {
num=input.nextInt();
originPassword.add(x,num);
x++;
}
}
System.out.printf("#%d ",test+1);
for(int i=0; i<10; i++) {
System.out.print(originPassword.get(i)+" ");
}
System.out.println();
originPassword.clear();
}
}
}
댓글