import java.util.Hashtable;
import java.util.Scanner;
public class Main {//促销购物
private plan plan[];
private Hashtable ha=new Hashtable();
private static int pl[][],n,m;
private Node t[][][][][][];
private static boolean b[];
public void setT(int a,int b,int c,int d,int e,int f) {
t=new Node[a][b][c][d][e][f];
}
public void setPlan(int n) {
plan=new plan[n];
}
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc=new Scanner(System.in);
Main ps=new Main();
int i,j;
n=Integer.parseInt(sc.next());
b=new boolean[n];
ps.setPlan(n);
for(i=0;i