a=map(int,input().split()) b=list(input().split()) a=list(a) a=sorted(a) b=sorted(b) c=dict(zip(b,a)) for i in b: print(c[i],end=' ')