#include <bits/stdc++.h>
using namespace ::std;
int NEGINF = -1e9;
int main() {
  ifstream fin("input.txt");
  int n, l, r;
  cin >> n >> l >> r;
  vector<int> a(n), b(n), p(n), c(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  vector<int> ppos(n);
  for (int i = 0; i < n; i++) {
    cin >> p[i];
    ppos[p[i] - 1] = i;
  }
  int loc, csmall = NEGINF;
  for (int i = 0; i < n; i++) {
    loc = ppos[i];
    if (csmall + 1 + a[loc] < l) {
      b[loc] = l;
      csmall = b[loc] - a[loc];
    } else if (csmall + 1 + a[loc] > r) {
      cout << "-1\n";
      return 0;
    } else {
      csmall++;
      b[loc] = a[loc] + csmall;
    }
  }
  for (int i = 0; i < n; i++) {
    cout << b[i] << " ";
  }
}
