Leha like all kinds of strange things. Recently he liked the function F(n, k). Consider all possible k-element subsets of the set [1, 2, ..., n]. For subset find minimal element in it. F(n, k) — mathematical expectation of the minimal element among all k-element subsets.

But only function does not interest him. He wants to do interesting things with it. Mom brought him two arrays A and B, each consists of m integers. For all i, j such that 1 ≤ i, j ≤ m the condition Ai ≥ Bj holds. Help Leha rearrange the numbers in the array A so that the sum <image> is maximally possible, where A' is already rearranged array.

Input

First line of input data contains single integer m (1 ≤ m ≤ 2·105) — length of arrays A and B.

Next line contains m integers a1, a2, ..., am (1 ≤ ai ≤ 109) — array A.

Next line contains m integers b1, b2, ..., bm (1 ≤ bi ≤ 109) — array B.

Output

Output m integers a'1, a'2, ..., a'm — array A' which is permutation of the array A.

Examples

Input

5
7 3 5 3 4
2 1 3 2 3


Output

4 7 3 5 3


Input

7
4 6 5 8 8 2 6
2 1 2 2 1 1 2


Output

2 6 4 5 8 8 6
                                                                      //>>>BaZ<<<//
import java.util.*;
import java.io.*;
import static java.lang.Math.*;
public class RR {
    static int dx[] = {-1,1,0,0,};
    static int dy[] = {0,0,1,-1};
    static long MOD = 1000000007;
    static int INF = Integer.MAX_VALUE/10;
    static MyScanner scan;
    static PrintWriter out;
    static StringBuilder sb;
    //static MyFileReader scan;
    //static PrintWriter out;
    public static void main(String[] args) {
        new Thread(null,null,"BaZ",99999999)
        {
           public void run() 
           {
               try
               {
                   solve();
               }
               catch(Exception e)
               {   
                   e.printStackTrace();
                   System.exit(1);
               }
           }
        }.start();
    }
    static void solve() throws IOException
    { 
       Calendar CAL1 = Calendar.getInstance();
       CAL1.setTime(new Date());
       out = new PrintWriter(System.out,true);  
       scan = new MyScanner();
       sb = new StringBuilder();
       //scan = new MyFileReader();   //File input
       //out = new PrintWriter(new File("C://Users/Aman deep/Desktop/output.txt"));  //File output
       int t = 1;
       while(t-->0)
       {
           int m = ni();
           Pair p[] = new Pair[m];
           int arr[] = new int[m];
           int per[] = new int[m];
           for(int i=0;i<m;++i)
               arr[i] = ni();
           for(int i=0;i<m;++i)
           {
               p[i] = new Pair(ni(),i);
           }
           Arrays.sort(p);
           Arrays.sort(arr);
           for(int i=0;i<m;++i)
               per[p[i].y] = arr[m-1-i];
           for(int x:per)
               sb.append(x+" ");
           println(sb);
       }
       Calendar CAL2 = Calendar.getInstance();
       CAL2.setTime(new Date());
       double Execution_Time = (double)(CAL2.getTimeInMillis()-CAL1.getTimeInMillis())/1000.000;
       //System.out.println("Execution time : "+Execution_Time+" seconds");
       out.flush();   
       out.close();
    }
    static class MyCmp implements Comparator<Integer>
    {
        public int compare(Integer x,Integer y)
        {
            return y-x;
        }
    }
    static void print(StringBuilder sb)
    {
        out.print(sb);
    }
    static int ni() throws IOException
    {
        return scan.nextInt();
    }
    static long nl() throws IOException
    {
        return scan.nextLong();
    }
    static double nd() throws IOException
    {
        return scan.nextDouble();
    }
    static String next() throws IOException
    {
        return scan.next();
    }
    static void print(Object o)
    {
        out.print(o+" ");
    }
    static void println(Object o)
    {
        out.println(o);
    }
    static void println()
    {
        out.println();
    }
    static void add(TreeMap<Integer,Integer> tm,int val)
    {
        if(tm.containsKey(val))
            tm.put(val,1+tm.get(val));
        else tm.put(val,1);
    }
    static void remove(TreeMap<Integer,Integer> tm,int val)
    {
        int v = tm.get(val);
        if(v>1)
            tm.put(val, v-1);
        else tm.remove(val);
    }
    static void add(Map<Integer,Integer> map,int val)
    {
        if(map.containsKey(val))
            map.put(val,1+map.get(val));
        else map.put(val,1);
    }
    static void remove(Map<Integer,Integer> map,int val)
    {
        int v = map.get(val);
        if(v==1)
            map.remove(val);
        else map.put(val,v-1);
    }
    static class Pair implements Comparable<Pair>
    {
        int x,y;
        Pair(int x,int y)
        {
            this.x = x;
            this.y = y;
        }
        public int compareTo(Pair other)
        {
            if(other.x>this.x)
                return -1;
            else if(other.x<this.x)
                return 1;
            else 
            {
                if(other.y>this.y)
                    return 1;
                else if(other.y<this.y)
                    return -1;
                return 0;
            }
        }
        public String toString()
        {
            return "("+x+","+y+")";
        }
        public boolean equals(Object o)
        {
            if(o instanceof Pair)
            {
                Pair other = (Pair)o;
                return this.x==other.x && this.y==other.y;
            }
            return false;
        }
        public int hashCode()
        {
            return this.x+this.y;
        }
    }
    static class MyComparator implements Comparator<Pair>
    {
        public int compare(Pair a,Pair b)
        {
           if(a.x>b.x)
               return 1;
           else if(a.x<b.x)
               return -1;
           else if(a.y>b.y)
               return 1;
           else if(a.y<b.y)
               return -1;
           return 0;
        }
    }
    static class TupleD implements Comparable<TupleD>
    {
        int u,v;
        long w;
        TupleD(int u,int v,long w)
        {
            this.u = u;
            this.v = v;
            this.w = w;
        }
        public int compareTo(TupleD other)
        {
            if(this.w>other.w)
                return 1;
            else if(this.w==other.w)
                return 0;
            else return -1;
        }
        public String toString()
        {
            return "("+u+","+v+","+w+")";
        }
    }
        static class TupleI implements Comparable<TupleI>
    {
        int u,v,w;
        TupleI(int u,int v,int w)
        {
            this.u = u;
            this.v = v;
            this.w = w;
        }
        public int compareTo(TupleI other)
        {
            if(this.w>other.w)
                return 1;
            else if(this.w==other.w)
                return 0;
            else return -1;
        }
        public String toString()
        {
            return "("+u+","+v+","+w+")";
        }
    }
    static class TupleL implements Comparable<TupleL>
    {
        long u,v,w;
        TupleL(long u,long v,long w)
        {
            this.u = u;
            this.v = v;
            this.w = w;
        }
        public int compareTo(TupleL other)
        {
            if(this.w>other.w)
                return 1;
            else if(this.w==other.w)
                return 0;
            else return -1;
        }
        public String toString()
        {
            return "("+u+","+v+","+w+")";
        }
    }
    static class DSU
    {
        int arr[];
        int size[];
        DSU(int n)
        {
            size = new int[n];
            arr = new int[n];
            for(int i=0;i<n;++i)
            {
                arr[i] = i;
                size[i]++;
            }
        }
        int getroot(int A)
        {
            if(arr[A]==A)
                return A;
            return arr[A] = getroot(arr[A]);
        }
        boolean union(int A,int B)
        {
            int rootA = getroot(A);
            int rootB = getroot(B);
            if(rootA==rootB)
                return false;
            if(size[rootB]>size[rootA])
            {
                size[rootB]+=size[rootA];
                arr[rootA] = rootB;
            }
            else
            {
                size[rootA]+=size[rootB];
                arr[rootB] = rootA;
            }
            return true;
        }
    }
    static long gcd(long a,long b)
    {
        if(b==0)
            return a;
        return gcd(b,a%b);
    }
    static long modpow(long a,long b,long m)
    {
        if(b==0)
            return 1;
        if((b&1)==0)
            return modpow((a*a)%m,b>>1,m);
        else return (modpow((a*a)%m,b>>1,m)*a)%m;
    }
     static TupleL EEA(long A,long B)
    {
        if(B==0)
            return new TupleL(A,1,0);
        TupleL t = EEA(B,A%B);
        return new TupleL(t.u,t.w,t.v-(A/B)*t.w);
    }
     static long mulmodin(long A,long M)
     {
         long x = EEA(A,M).v;
         return (x+M)%M;
     } 
     static long divide(long A,long B,long M)       //Applicable only if A%B==0
     {  
         A%=M;
         long invB = mulmodin(B,M);
         return (A*invB)%M;
     }
     static long subtract(long A,long B,long M)
     {
         A%=M;
         B%=M;
         if(A>=B)
             return A-B;
         return (A-B+M)%M;
     }
    static class SegmentTree
    {
        int tree[];
        int arr[];
        int n;
        SegmentTree(int n,int a[])
        {  
            this.n = n;
            arr =  new int[n];
            for(int i=0;i<n;++i)
                arr[i] = a[i];
            int sz = (int)pow(2,(int)ceil(log(n)/log(2)));
            sz*=2;
            tree = new int[sz];
            build(0,n-1,1);
        }
        final void build(int low,int high,int treein)
        {
            if(low==high)
            {
                tree[treein] = arr[low];
            }
            else
            {
                int mid = (low+high)>>1;
                build(low,mid,2*treein);
                build(mid+1,high,2*treein+1);
                tree[treein] = min(tree[2*treein],tree[2*treein+1]);
            }
        }
        final void update(int index,int treein,int low,int high,int val)
        {
            if(low==high)
            {
                arr[index]=tree[treein]=val;
            }
            else
            {
                int mid = (low+high)>>1;
                if(index<=mid)
                    update(index,2*treein,low,mid,val);
                else update(index,2*treein+1,mid+1,high,val);
                tree[treein] = min(tree[2*treein],tree[2*treein+1]);
            }
        }
        final void update(int index,int val)
        {
            update(index,1,0,n-1,val);
        }
        final int query(int low,int high,int l,int r,int treein)
        {
            if(l<=low && high<=r)
                return tree[treein];
            else if(low>r || high<l)
                return Integer.MAX_VALUE;
            int mid = (low+high)>>1;
            int a = query(low,mid,l,r,2*treein);
            int b = query(mid+1,high,l,r,2*treein+1);
            return min(a,b);
        }
        final int query(int l,int r)
        {
            return query(0,n-1,l,r,1);
        }
        final int query(int index)
        {
            return query(0,n-1,0,index,1);
        }
    }
    static class MyFileReader                                          //File input template
    {
        StringTokenizer st;
        BufferedReader br;
        MyFileReader() throws IOException
        {
            br = new BufferedReader(new FileReader("C://Users/Aman deep/Desktop/input.txt"));
        }
        String nextLine() throws IOException
        {
            return br.readLine();
        }
        String next() throws IOException
        {
            if(st==null || !st.hasMoreTokens())
                st = new StringTokenizer(nextLine());
            return st.nextToken();
        }
        int nextInt() throws IOException
        {
            return Integer.parseInt(next());
        }
        long nextLong() throws IOException
        {
            return Long.parseLong(next());
        }
        double nextDouble() throws IOException
        {
            return Double.parseDouble(next());
        }
    }
        static class MyScanner    //Strings and numbers both reader
    {
        StringTokenizer st;
        BufferedReader br;
        MyScanner() throws IOException
        {
            br = new BufferedReader(new InputStreamReader(System.in));
        }
        String nextLine() throws IOException
        {
            return br.readLine();
        }
        String next() throws IOException
        {
            if(st==null || !st.hasMoreTokens())
                st = new StringTokenizer(nextLine());
            return st.nextToken();
        }
        int nextInt() throws IOException
        {
            return Integer.parseInt(next());
        }
        long nextLong() throws IOException
        {
            return Long.parseLong(next());
        }
        double nextDouble() throws IOException
        {
            return Double.parseDouble(next());
        }
    }
}
