#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 100 * 1000 + 5;
int n, m, a[MAX_N], b[MAX_N];
void read_input() {
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++) cin >> b[i];
  sort(a, a + n);
  sort(b, b + n, greater<int>());
}
void solve() {
  vector<int> st_a, st_b, ans;
  int p = 0;
  for (int i = 0; i < n; i++) {
    while (p < n && a[p] + b[i] < m) st_a.push_back(a[p++]);
    if (st_a.empty())
      st_b.push_back(b[i]);
    else {
      ans.push_back(b[i] + st_a.back());
      st_a.pop_back();
    }
  }
  for (int i = p; i < n; i++) st_a.push_back(a[i]);
  reverse(st_b.begin(), st_b.end());
  for (int i = 0; i < (int)st_a.size(); i++)
    ans.push_back(st_a[i] + st_b[i] - m);
  sort(ans.begin(), ans.end(), greater<int>());
  for (auto i : ans) cout << i << ' ';
}
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  read_input();
  solve();
}
