#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, l, r;
  cin >> n >> l >> r;
  int a[100100], b[100100];
  int p[100100];
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++) {
    int num;
    cin >> num;
    p[num - 1] = i;
  }
  int possible = 1;
  int ind = p[0];
  b[ind] = l;
  int prev = b[ind] - a[ind];
  for (int _i = 1; _i < n; _i++) {
    int i = p[_i];
    b[i] = max(prev + 1 + a[i], l);
    if (b[i] > r) {
      possible = 0;
      break;
    }
    prev = b[i] - a[i];
  }
  if (!possible)
    cout << "-1";
  else
    for (int i = 0; i < n; i++) cout << b[i] << " ";
  cout << endl;
  return 0;
}
