#include <bits/stdc++.h>
using namespace std;
const int oo = 0x3f3f3f3f;
vector<int> DigitsA, Answer;
multiset<int> DigitsB;
int N, Base;
void Solve() {
  vector<int> unused;
  for (int i = N - 1; i >= 0; --i) {
    multiset<int>::iterator pair = DigitsB.upper_bound(Base - 1 - DigitsA[i]);
    if (pair != DigitsB.begin()) --pair;
    if (DigitsA[i] + *pair < Base) {
      Answer.push_back(DigitsA[i] + *pair);
      DigitsB.erase(pair);
    } else {
      unused.push_back(DigitsA[i]);
    }
  }
  for (int i = 0; i < int(unused.size()); ++i) {
    multiset<int>::iterator pair = DigitsB.end();
    --pair;
    Answer.push_back((unused[i] + *pair) % Base);
    DigitsB.erase(pair);
  }
  sort(Answer.rbegin(), Answer.rend());
}
void Read() {
  cin >> N >> Base;
  DigitsA.resize(N);
  for (int i = 0; i < N; ++i) cin >> DigitsA[i];
  sort(DigitsA.begin(), DigitsA.end());
  for (int i = 0; i < N; ++i) {
    int digit;
    cin >> digit;
    DigitsB.insert(digit);
  }
}
void Print() {
  for (int i = 0; i < N; ++i) cout << Answer[i] << " ";
  cout << "\n";
}
int main() {
  Read();
  Solve();
  Print();
  return 0;
}
