#include <bits/stdc++.h>
using namespace std;
int a[100005], b[100005], op[100005], c[100005], p[100005], pre[100005];
int n, m;
bool cmp(int x, int y) { return x > y; }
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  for (int i = 0; i < n; i++) scanf("%d", &b[i]);
  for (int i = 0; i < n; i++) pre[i] = i - 1;
  sort(a, a + n, cmp);
  sort(b, b + n);
  for (int i = 0; i < n; i++) {
    int k = upper_bound(b, b + n, m - a[i] - 1) - b - 1;
    int t = k;
    for (; k >= 0; k = pre[k])
      if (!op[k]) break;
    if (k >= 0) {
      op[k] = 1;
      p[i] = 1;
      c[i] = (a[i] + b[k]) % m;
      pre[t] = pre[k];
    }
  }
  int j = n - 1;
  for (int i = 0; i < n; i++) {
    if (p[i]) continue;
    while (op[j]) j--;
    c[i] = (a[i] + b[j--]) % m;
  }
  sort(c, c + n, cmp);
  for (int i = 0; i < n; i++) printf("%d ", c[i]);
  printf("\n");
}
