#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  int n, l, r, i, j;
  long long f = 0;
  int a[100000], b[100000], c[100000];
  cin >> n >> l >> r;
  for (i = 0; i < (n); i++) cin >> a[i];
  for (i = 0; i < (n); i++) {
    cin >> j;
    c[j - 1] = i;
  }
  for (i = 0; i < (n); i++) b[i] = 0;
  for (i = 0; i < (n - 1); i++) b[i] = a[c[i + 1]] - a[c[i]] + 1;
  long long mincum = 0, maxcum = 0;
  for (i = 0; i < (n - 1); i++) {
    f += b[i];
    maxcum = max(maxcum, f);
    mincum = min(mincum, f);
  }
  if (maxcum - mincum > r - l)
    cout << -1;
  else {
    for (i = 0; i < (n); i++) {
      if (i == 0)
        a[c[i]] = l - mincum;
      else
        a[c[i]] = a[c[i - 1]] + b[i - 1];
    }
    for (i = 0; i < (n); i++) {
      cout << a[i] << " ";
    }
  }
  return 0;
}
