#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:100000000,100000000")
using namespace std;
const long long inf = 1e18 + 7;
const long long mod = 1e8 + 7;
const double eps = 1e-9;
const double PI = 2 * acos(0.0);
const double E = 2.71828;
long long A[100005], B[100005];
multiset<long long, greater<long long> > x;
multiset<long long, greater<long long> > y;
long long ans[100005], sz = 0;
long long del[100005], size = 0;
int main(void) {
  long long n, m;
  cin >> n >> m;
  for (long long(i) = 0; (i) < (long long)(n); (i)++) cin >> A[i];
  for (long long(i) = 0; (i) < (long long)(n); (i)++) cin >> B[i];
  for (long long(i) = 0; (i) < (long long)(n); (i)++) x.insert(A[i]);
  for (long long(i) = 0; (i) < (long long)(n); (i)++) y.insert(B[i]);
  multiset<long long>::iterator a, b;
  for (a = x.begin(); a != x.end(); a++) {
    b = y.lower_bound(m - *a - 1);
    if (b != y.end() && *b + *a < m) {
      ans[sz++] = *b + *a;
      del[size++] = *a;
      y.erase(b);
    }
  }
  for (long long i = 0; i < size; i++) {
    x.erase(x.lower_bound(del[i]));
  }
  a = x.begin();
  b = y.begin();
  long long sub = sz;
  for (long long i = 0; i < n - sub; i++) ans[sz++] = *b + *a - m, a++, b++;
  sort(ans, ans + sz);
  reverse(ans, ans + sz);
  for (long long(i) = 0; (i) < (long long)(sz); (i)++) cout << ans[i] << " ";
  cout << endl;
  return 0;
}
