#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e12;
signed main() {
  long long n, l, r;
  cin >> n >> l >> r;
  long long a[n], b[n], o[n];
  for (long long i = 0; i < (n); i++) cin >> a[i];
  for (long long i = 0; i < (n); i++) {
    long long p;
    cin >> p;
    p--;
    o[p] = i;
  }
  long long last = -INF;
  bool ok = true;
  for (long long i = 0; i < (n); i++) {
    b[o[i]] = max(last + a[o[i]] + 1, l);
    if (b[o[i]] > r) {
      ok = false;
      break;
    }
    last = b[o[i]] - a[o[i]];
  }
  if (ok)
    for (long long i = 0; i < (n); i++) cout << b[i] << " \n"[i == n - 1];
  else
    cout << -1 << endl;
}
