#import int N,i,j,a;main(){std::mape,s,A;for(;std::cin>>a;N?e[A[i]=a]=i++:N=a);for(;s[a=A[j]]=jfirst<<" ";}