#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 100;
vector<int> ans;
vector<int> a[2], c[2];
int n, m, pre[N], is[N];
int in() {
  int x;
  scanf("%d", &x);
  return x;
}
int main() {
  n = in(), m = in();
  for (int t = 0; t < 2; t++)
    for (int i = 0; i < n; i++) a[t].push_back(in()), pre[i] = i;
  sort(a[0].begin(), a[0].end(), greater<int>());
  sort(a[1].begin(), a[1].end());
  int j = -1;
  for (int i = 0; i < n; i++) {
    while (j < n - 1 && m - a[0][i] > a[1][j + 1]) j++;
    if (j != -1 && pre[j] != -1)
      ans.push_back(a[0][i] + a[1][pre[j]]),
          is[pre[j]] = 1, pre[j] = (pre[j] == 0 ? -1 : pre[pre[j] - 1]);
    else
      c[0].push_back(a[0][i]);
  }
  sort(ans.begin(), ans.end());
  for (int i = 0; i < n; i++)
    if (!is[i]) c[1].push_back(a[1][i]);
  for (int i = 0; i < c[0].size(); i++)
    ans.push_back((c[0][i] + c[1][c[0].size() - 1 - i]) % m);
  sort(ans.begin(), ans.end(), greater<int>());
  for (int i = 0; i < n; i++) cout << ans[i] << " ";
}
