#include <bits/stdc++.h>
using namespace std;
const int maxn = 100000;
const int INF = 100000000;
const double pi = acos(-1.0);
struct node {
  int x;
  int tag;
  int v;
} a[200050], b[200050], c[200050];
int m;
bool cmp1(node x, node y) { return x.x > y.x; }
bool cmp2(node x, node y) { return x.x < y.x; }
int main() {
  while (scanf("%d", &m) != EOF) {
    for (int i = 0; i < m; i++) {
      scanf("%d", &a[i].x);
      a[i].tag = i;
    }
    for (int i = 0; i < m; i++) {
      scanf("%d", &b[i].x);
      b[i].tag = i;
      c[i] = b[i];
    }
    sort(a, a + m, cmp1);
    sort(b, b + m, cmp2);
    for (int i = 0; i < m; i++) {
      c[b[i].tag].v = a[i].x;
    }
    for (int i = 0; i < m; i++) {
      if (i == 0)
        printf("%d", c[i].v);
      else
        printf(" %d", c[i].v);
    }
    printf("\n");
  }
  return 0;
}
