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 javax.print.attribute.standard.MediaPrintableArea;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.math.RoundingMode;
import java.io.*;
import java.util.*;
/**
 * Created by Firеfly on 1/1/2017.
 */
public class Task {
    public static void main(String[] args) throws IOException {
        Emaxx emaxx = new Emaxx();
    }
}


class Emaxx {
    FScanner fs;
    int n, k, x, y, EXISTS;
    static int maxim =0;
    int[][] results;
    TreeSet<Integer>[] Graph;
    int[] sizes;
    static double ans = 0;
    boolean[] were;
    Emaxx() throws IOException {
        FScanner fs = new FScanner(new InputStreamReader(System.in));
        // pw = new PrintWriter(new FileWriter("arithnumbers.out"));
        //  fs = new FScanner(new FileReader("C:\\Users\\Firеfly\\Desktop\\New Text Document.txt"));
        //     fs = new FScanner(new FileReader("input.txt"));;
        //       pw = new PrintWriter("output.txt");
        PrintWriter pw = new PrintWriter(System.out);
        int n = fs.nextInt();
        int[] a = new int[n];
        for (int i =0 ; i<n; i++)
            a[i] = fs.nextInt();
        Pair[] b = new Pair[n];
        for (int i = 0; i<n; i++)
            b[i] = new Pair(fs.nextInt(), i);
        Arrays.sort(b);
        int[] ans = new int[n];
        Arrays.sort(a);
        for (int i = 0; i<n; i++) {
            ans[b[i].y] = a[n-1-i];
        }
        for (int i =0 ; i<n; i++)
            pw.print(ans[i] + " ");
        pw.close();
    }

    int gcd (int a, int b) {
        if (b == 0)
            return a;
        else
            return gcd (b, a % b);
    }





    int BIN_SEARCH(ArrayList<Integer> list, FScanner fs) throws IOException {
        int l = 0;
        int r = list.size()-1;
        while (l<r) {
            int mid = (l+r)/2;
            System.out.print("? ");
            System.out.flush();
                for (int i = l; i<=mid; i++) {
                    System.out.print(list.get(i) + " ");
                    System.out.flush();
                }
            System.out.println();
System.out.flush();
            int ans = fs.nextInt();
            if (ans == y || ans == EXISTS)
                r = mid;
            else l = mid+1;
        }
        return r;
    }


    int gcd (int a, int b, INt x, INt y) {
        if (a == 0) {
            x.x = 0; y.x = 1;
            return b;
        }
        INt x1 = new INt(0), y1= new INt(0);
        int d = gcd (b%a, a, x1, y1);
        x.x = y1.x - (b / a) * x1.x;
        y.x = x1.x;
        return d;
    }


}

class INt implements Comparable<INt> {
    int x;
    INt(int x1) {
        x = x1;
    }

    @Override
    public int compareTo(INt iNt) {
        return Integer.compare(x, iNt.x);
    }
}

class Triple {
    int x, y, c;
    Triple(int x1, int y1, int c1) {
        x = x1; y = y1; c = c1;
    }


}
class Pair implements Comparable<Pair>{
    int x, y;
    Pair(int x1, int y1) {x = x1; y = y1;}
    Pair(){}
    @Override
    public int compareTo(Pair o) {
        return Integer.compare(x, o.x);
    }
}

class Algs {
    public static int[] Z_f(char[] s) {
        int[] zf = new int[s.length];
        zf[0] = -1;
        int l = 0, r= 0;
        for (int i = 1; i<s.length; i++) {
            if (i>r)
            {
                int g = i;
                while (g < s.length && s[g] == s[g-i])
                    g++;
                if (g == i)
                    continue;
                l = i;
                r = g-1;
                zf[i] = g-i;
            } else {
                if (zf[i-l]<=r-i+1)
                    zf[i] = zf[i-l];
                else {
                    int g = r+1;
                    while (g <s.length && s[g] == s[g-i])
                        g++;
                    if (g == r+1)
                        zf[i] = r-i+1;
                    else {
                        zf[i] = g-i;
                        r = g-1;
                        l = i;
                    }
                }
            }
        }
        return zf;
    }
}



class FScanner {
    BufferedReader br;
    StringTokenizer st;
    FScanner(InputStreamReader isr) {
        br = new BufferedReader(isr);
    }

    FScanner(FileReader fr) {
        br = new BufferedReader(fr);
    }

    String nextToken() throws IOException{
        while (st == null || !st.hasMoreTokens()) {
            String s = br.readLine();
            if (s == null)
                return null;
            st = new StringTokenizer(s);
        }
        return st.nextToken();
    }

    int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }

    double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }

    String nextLine() throws IOException {
        return br.readLine();
    }

    char nextChar() throws IOException {
        return (char) br.read();
    }
}
