Problem: Kolya has a turtle and a field of size 2 × n. The field rows are numbered from 1 to 2 from top to bottom, while the columns are numbered from 1 to n from left to right.

Suppose in each cell of the field there is a lettuce leaf. The energy value of lettuce leaf in row i and column j is equal to a_{i,j}. The turtle is initially in the top left cell and wants to reach the bottom right cell. The turtle can only move right and down and among all possible ways it will choose a way, maximizing the total energy value of lettuce leaves (in case there are several such paths, it will choose any of them).

Kolya is afraid, that if turtle will eat too much lettuce, it can be bad for its health. So he wants to reorder lettuce leaves in the field, so that the energetic cost of leaves eaten by turtle will be minimized.

Input

The first line contains an integer n (2 ≤ n ≤ 25) — the length of the field.

The second line contains n integers a_{1, i} (0 ≤ a_{1, i} ≤ 50 000), the energetic cost of lettuce leaves in the first row of the field.

The third line contains n integers a_{2, i} (0 ≤ a_{2, i} ≤ 50 000), the energetic cost of lettuce leaves in the second row of the field.

Output

Print two lines with n integers in each — the optimal reordering of lettuce from the input data.

In case there are several optimal ways to reorder lettuce, print any of them.

Examples

Input


2
1 4
2 3


Output


1 3 
4 2 


Input


3
0 0 0
0 0 0


Output


0 0 0 
0 0 0 


Input


3
1 0 1
0 0 0


Output


0 0 1
0 1 0

Note

In the first example, after reordering, the turtle will eat lettuce with total energetic cost 1+4+2 = 7.

In the second example, the turtle will eat lettuce with energetic cost equal 0.

In the third example, after reordering, the turtle will eat lettuce with total energetic cost equal 1.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e4 + 1, mod = 1e9 + 7, MAXN = 1e6 + 7;
const double eps = 1e-9;
const long long inf = 1e9;
mt19937 rnd(time(0));
int n;
vector<int> value;
const int L = 26;
int dp[L][maxn * L];
void solve() {
  cin >> n;
  int ALL = 0;
  for (int i = 0; i < 2 * n; ++i) {
    int a;
    cin >> a;
    ALL += a;
    value.push_back(a);
  }
  sort(value.begin(), value.end());
  for (int i = 0; i < L; ++i) {
    for (int j = 0; j < maxn * L; ++j) dp[i][j] = -1;
  }
  dp[1][value[0]] = value[0];
  for (int i = 2; i < 2 * n; ++i) {
    for (int ctr = n; ctr >= 1; --ctr) {
      for (int sum = value[i]; sum < maxn * L; ++sum) {
        if (dp[ctr][sum] == -1 && dp[ctr - 1][sum - value[i]] != -1) {
          dp[ctr][sum] = value[i];
        }
      }
    }
  }
  int ans = inf;
  int sum = 0;
  for (int i = 0; i < maxn * L; ++i) {
    if (dp[n][i] != -1) {
      int p = max(i + value[1], ALL - i + value[0]);
      ans = min(ans, p);
      if (ans == p) sum = i;
    }
  }
  vector<int> path;
  int n1 = n;
  while (n1) {
    int t = dp[n1][sum];
    path.push_back(t);
    --n1;
    sum -= t;
  }
  sort(path.begin(), path.end());
  for (auto v : path) cout << v << " ";
  cout << '\n';
  multiset<int> p;
  for (auto v : value) p.insert(v);
  for (auto v : path) {
    if (p.find(v) == p.end()) {
      cout << "no";
      return;
    }
    p.erase(p.find(v));
  }
  vector<int> kek;
  for (auto v : p) kek.push_back(v);
  reverse(kek.begin(), kek.end());
  for (auto v : kek) cout << v << " ";
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.precision(20);
  cout << fixed;
  int t = 1;
  for (int i = 0; i < t; ++i) {
    solve();
  }
  return 0;
}