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
import java.util.*;
import java.io.*;
public class tcsF {
    static class OutputWriter
    {        private PrintWriter writer;
        public OutputWriter(OutputStream stream)
        {writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(stream)));}
        public OutputWriter(Writer writer)
        {
            this.writer = new PrintWriter(writer);
        }
        public void println(int x)
        {
            writer.println(x);
        }
        public void print(int x)
        {
            writer.print(x);
        }
        public void println(char x)
        {
            writer.println(x);
        }
        public void print(char x)
        {
            writer.print(x);
        }
        public void println(int array[], int size) {            for (int i = 0; i < size; i++)                println(array[i]);}
        public void print(int array[], int size) {            for (int i = 0; i < size; i++)                print(array[i] + " ");}
        public void println(long x)
        {
            writer.println(x);
        }
        public void print(long x)
        {
            writer.print(x);
        }
        public void println(long array[], int size) {            for (int i = 0; i < size; i++)                println(array[i]);}
        public void print(long array[], int size)        {            for (int i = 0; i < size; i++) print(array[i]);}
        public void println(float num)
        {
            writer.println(num);
        }
        public void print(float num)
        {
            writer.print(num);
        }
        public void println(double num)
        {
            writer.println(num);
        }
        public void print(double num)
        {            writer.print(num);}        public void println(String s)        {writer.println(s);}
        public void print(String s)
        {
            writer.print(s);
        }
        public void println()
        {
            writer.println();
        }
        public void printSpace()
        {
            writer.print(" ");
        }
        public void printf(String format, Object args)
        {
            writer.printf(format, args);
        }
        public void flush()
        {
            writer.flush();
        }
        public void close()
        {
            writer.close();
        }
    }
    static class Parser {
        final private int BUFFER_SIZE = 1 << 16;
        private DataInputStream din;
        private byte[] buffer;
        private int bufferPointer, bytesRead;

        public Parser(InputStream in) {
            din = new DataInputStream(in);
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public long nextLong() throws Exception {
            long ret = 0;
            byte c = read();
            while (c <= ' ') c = read();
            boolean neg = c == '-';
            if (neg) c = read();
            do {
                ret = ret * 10 + c - '0';
                c = read();
            } while (c > ' ');
            if (neg) return -ret;
            return ret;
        }

        //reads in the next string
        public String next() throws Exception {
            StringBuilder ret = new StringBuilder();
            byte c = read();
            while (c <= ' ') c = read();
            do {
                ret = ret.append((char) c);
                c = read();
            } while (c > ' ');
            return ret.toString();
        }

        public int nextInt() throws Exception {
            int ret = 0;
            byte c = read();
            while (c <= ' ') c = read();
            boolean neg = c == '-';
            if (neg) c = read();
            do {
                ret = ret * 10 + c - '0';
                c = read();
            } while (c > ' ');
            if (neg) return -ret;
            return ret;
        }

        private void fillBuffer() throws Exception {
            bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
            if (bytesRead == -1) buffer[0] = -1;
        }

        private byte read() throws Exception {
            if (bufferPointer == bytesRead) fillBuffer();
            return buffer[bufferPointer++];
        }
    }
    static class FenwickTree {
        int BIT[];
        int n;
        FenwickTree(int n){
            BIT=new int[n+1];
            this.n=n;
        }

        void update(int x, int val)
        {
            for(; x <= n; x += x&-x)
                BIT[x] += val;
        }
        int query(int x)
        {
            int sum = 0;
            for(; x > 0; x -= x&-x)
                sum += BIT[x];
            return sum;
        }
            }
            static int ans=-1;
            static void binsearch(int l,int h,int val,FenwickTree arr)
            {
                if(l>h)return;
                int mid=l+(h-l)/2;
                int freespace=arr.query(mid);
                if(freespace>=val){
                    ans=mid;
                    binsearch(l,mid-1,val,arr);
                }
                else{

                    binsearch(mid+1,h,val,arr);
                }

            }
    public static void main(String[] args)throws Exception {
        //  System.out.println(gcd(32767,2097151));
        Parser s = new Parser(System.in);
        OutputWriter out = new OutputWriter(System.out);
       int N=s.nextInt();
        int A[]=new int[N];
        int B[]=new int[N];
        for (int i = 0; i <N ; i++) {
            A[i]=s.nextInt();

        }
        int ans[]=new int[N];
        ArrayList<Integer> list=new ArrayList<>();
        HashMap<Integer,ArrayList<Integer>> map=new HashMap<>();
        for (int i = 0; i <N; i++) {
         B[i]=s.nextInt();
            if(map.containsKey(B[i])){
                ArrayList<Integer> list2=map.get(B[i]);
                list2.add(i);
                map.put(B[i],list2);
            }
            else{
                list.add(B[i]);
                ArrayList<Integer> lis=new ArrayList<>();
                lis.add(i);
                map.put(B[i],lis);
            }
        }
        Arrays.sort(A);
     //   System.out.println(Arrays.toString(A));
        for (int i = 0; i <A.length/2 ; i++) {
            int temp=A[i];
            A[i]=A[A.length-1-i];
            A[A.length-1-i]=temp;
        }
      //  System.out.println(Arrays.toString(A));
        Collections.sort(list);
        int k=0;
        for (int i = 0; i <list.size(); i++) {
            int key=list.get(i);
            ArrayList<Integer> l=map.get(key);
            for (int j = 0; j <l.size() ; j++) {
                int idx=l.get(j);
                ans[idx]=A[k++];
            }
        }
        for (int i = 0; i <N ; i++) {
            out.print(ans[i]+" ");
        }
       out.println();



out.close();

    }}







