#include <bits/stdc++.h>
using namespace std;
int n, m, x;
multiset<int, greater<int> > a, b;
vector<int> ans, g;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    cin >> x;
    a.insert(x);
  }
  for (int i = 1; i <= n; i++) {
    cin >> x;
    b.insert(x);
  }
  for (auto it : a) {
    auto t = b.lower_bound(m - it - 1);
    if (t != b.end() && *t + it < m) {
      ans.push_back(*t + it);
      b.erase(t);
      g.push_back(it);
    }
  }
  for (auto it : g) {
    a.erase(a.find(it));
  }
  for (auto it1 = a.rbegin(), it2 = b.rbegin(); it1 != a.rend(); it1++, it2++) {
    ans.push_back((*it1 + *it2) % m);
  }
  sort(ans.rbegin(), ans.rend());
  for (auto it : ans) {
    cout << it << " ";
  }
}
