#include <bits/stdc++.h>
using namespace std;
multiset<int> up, down;
int n, m;
int getBest(const multiset<int>& s, int x) {
  multiset<int>::iterator it = s.upper_bound(m - 1 - x);
  if (it != s.begin()) {
    it--;
    return *it;
  }
  multiset<int>::iterator itt = s.end();
  itt--;
  return *itt;
}
int main() {
  int c, c2;
  scanf("%d%d", &n, &m);
  for (c = 0; c < n; c++) {
    int x;
    scanf("%d", &x);
    up.insert(x);
  }
  for (c = 0; c < n; c++) {
    int x;
    scanf("%d", &x);
    down.insert(x);
  }
  vector<int> ret;
  while (ret.size() < n) {
    int A = *up.begin();
    int B = getBest(down, A);
    int C = getBest(up, B);
    ret.push_back((B + C) % m);
    up.erase(up.find(C));
    down.erase(down.find(B));
  }
  sort(ret.rbegin(), ret.rend());
  printf("%d", ret[0]);
  for (c = 1; c < ret.size(); c++) printf(" %d", ret[c]);
  printf("\n");
  return 0;
}
