char s[];main(_,t){for(gets(t);gets(s);)s[strspn(t,s)]||puts(s);}