#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 101 * 1001, MOD = 1e9 + 7;
long long a[MAXN], ind[MAXN], b[MAXN];
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long n, l, r;
  cin >> n >> l >> r;
  for (long long i = 0; i < n; i++) cin >> a[i];
  long long x;
  for (long long i = 0; i < n; i++) cin >> x, ind[--x] = i;
  long long pre = r, v = 1e18;
  for (long long i = 0; i < n; i++) {
    long long val = v + a[ind[i]] + 1;
    if (val < l) val = l;
    if (i == 0) val = l;
    if (val > r) return cout << -1, 0;
    b[ind[i]] = val;
    v = b[ind[i]] - a[ind[i]];
  }
  for (long long i = 0; i < n; i++) cout << b[i] << ' ';
}
