#define S s[(*p|p[1])%2000+404] s[9999];*p=s;main(){for(;gets(p+=4);)++S;for(p=s;--S<0?p+=4,*p:puts(p););}