for(;[i,s]=readline()[S='split'](' ');print(a.join('')))for each(v in a=s[S](''),i[S](','))a[v]=' '+a[v]