char*p;main(x,a){for(;p=p&&*p?(index(p+1,*p)?:index(a,*p))+1:gets(a);)putchar(*p?:10);}