#include <bits/stdc++.h>
using namespace std;
multiset<int> A, B;
int m;
multiset<int>::iterator find(int value, const multiset<int> &ms) {
  return ms.lower_bound(-m + 1 - value);
}
int main() {
  int n, temp;
  cin >> n >> m, A.clear(), B.clear();
  for (int i = 0; i < (int)(n); i++) cin >> temp, A.insert(-temp);
  for (int i = 0; i < (int)(n); i++) cin >> temp, B.insert(-temp);
  vector<int> result;
  for (multiset<int>::iterator it = A.begin(); it != A.end();) {
    multiset<int>::iterator b = find(*it, B);
    if (b != B.end()) {
      multiset<int>::iterator a = find(*b, A);
      if (a == it) ++it;
      result.push_back(-*a - *b), A.erase(a), B.erase(b);
    } else
      ++it;
  }
  for (multiset<int>::iterator a = A.begin(), b = B.begin(); a != A.end();
       ++a, ++b)
    result.push_back(-*a - *b - m);
  sort((result).begin(), (result).end()),
      reverse((result).begin(), (result).end());
  for (int i = 0; i < (int)(n); i++) cout << result[i] << " ";
  cout << endl;
}
