#include <bits/stdc++.h>
using namespace std;
int n, l, r, a[1000005], p[1000005], order[1000005], sol[1000005];
inline bool cmp(const int A, const int B) { return p[A] < p[B]; }
int main() {
  int i, j;
  cin.sync_with_stdio(false);
  cin >> n >> l >> r;
  for (i = 1; i <= n; ++i) cin >> a[i];
  for (i = 1; i <= n; ++i) {
    cin >> p[i];
    order[i] = i;
  }
  sort(order + 1, order + n + 1, cmp);
  int st = -2000000000, dr = 2000000000;
  for (i = 1; i <= n; ++i) {
    int p = order[i];
    st = max(st, l - a[p] - i + 1);
    dr = min(dr, r - a[p] - i + 1);
  }
  if (st > dr) {
    cout << "-1\n";
    return 0;
  }
  for (i = 1; i <= n; ++i) {
    int p = order[i];
    sol[p] = st + i - 1;
  }
  for (i = 1; i <= n; ++i) cout << sol[i] + a[i] << " ";
  return 0;
}
