#include <bits/stdc++.h>
using namespace std;
multiset<int, greater<int> > up, down;
int n, m;
int match(bool type, int x) {
  multiset<int, greater<int> >::iterator i;
  if (type) {
    i = down.lower_bound(m - 1 - x);
    if (i != down.end()) return *i;
    return *down.begin();
  } else {
    i = up.lower_bound(m - 1 - x);
    if (i != up.end()) return *i;
    return *up.begin();
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m;
  int x;
  for (auto i = 0; i < (long long)(n); i++) {
    cin >> x;
    up.insert(x);
  }
  for (auto i = 0; i < (long long)(n); i++) {
    cin >> x;
    down.insert(x);
  }
  vector<int> yay;
  while (n--) {
    int temp = *up.begin();
    int ta7t = match(1, temp);
    int foo2 = match(0, ta7t);
    yay.push_back((foo2 + ta7t) % m);
    up.erase(up.find(foo2));
    down.erase(down.find(ta7t));
  }
  sort(yay.rbegin(), yay.rend());
  for (auto i = 0; i < (long long)(((int)((yay).size()))); i++)
    cout << yay[i] << " ";
  return 0;
}
