import javax.swing.*;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.TreeSet;
public class Main9 {
public static void main(String[] args) throws IOException {
BufferedReader buff = new BufferedReader(new InputStreamReader(System.in));
String first;
while (null!=(first=buff.readLine())){
int n = Integer.parseInt(first);
String[] he = buff.readLine().split(" ");
String[] kg = buff.readLine().split(" ");
int[] h = new int[n];
int[] k = new int[n];
for(int i=0;i<n;i++){
h[i]=Integer.parseInt(he[i]);
k[i]=Integer.parseInt(kg[i]);
}
st[] sts = new st[n];
for(int i=0;i<n;i++){
sts[i]=new st(i+1,h[i],k[i] );
}
Arrays.sort(sts, new Comparator<st>() {
@Override
public int compare(st o1, st o2) {
if(o1.h==o2.h) return o1.k-o2.k;
else return o1.h-o2.h;
}
});
for (st s:
sts) {
System.out.print(s.n+" ");
}
}
}
}
class st{
int n;
int h;
int k;
st(int n, int h, int k ){
this.n=n;
this.h=h;
this.k=k;
}
}