#include <bits/stdc++.h>
using namespace std;
bool debug = false;
int n, m, k;
int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
long long ln, lk, lm;
multiset<int> s[2];
int ff(int t, int x) {
  auto it = s[t].upper_bound(x);
  if (it == s[t].begin()) return *s[t].rbegin();
  it--;
  return *it;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int(j) = 0; (j) < (int)(2); (j)++)
    for (int(i) = 0; (i) < (int)(n); (i)++) {
      scanf("%d", &k);
      s[j].insert(k);
    }
  vector<int> v;
  for (int(i) = 0; (i) < (int)(n); (i)++) {
    int a = *s[0].rbegin();
    int b = ff(1, m - 1 - a);
    a = ff(0, m - 1 - b);
    v.push_back((a + b) % m);
    s[0].erase(s[0].find(a));
    s[1].erase(s[1].find(b));
  }
  sort(v.begin(), v.end());
  for (int i = n - 1; i >= 0; i--) printf("%d ", v[i]);
  return 0;
}
