import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
while(T>0) {
int N = sc.nextInt();
Stack<Integer> s = new Stack<>();
if(N==2) {
int S = sc.nextInt();
s.push(S);
}
if(N==1) {
if(!s.isEmpty()) {
int rv = s.pop();
System.out.println(rv);
}
else if(s.isEmpty()){
System.out.println("No Code");
}
}
T--;
}
}
}
// My this code is note working can please tell what is wrong in the code