#include <bits/stdc++.h>
long long a[100005], b[100005];
int p[100005], rp[100005];
long long max(long long x, long long y) { return x > y ? x : y; }
int main(int argc, char** argv) {
  int i, n, ok = 1;
  long long l, r;
  scanf("%d%I64d%I64d", &n, &l, &r);
  for (i = 1; i <= n; i++) scanf("%I64d", &a[i]);
  for (i = 1; i <= n; i++) {
    scanf("%d", &p[i]);
    rp[p[i]] = i;
  }
  long long min_allowed = 0x8000000000000000LL;
  for (i = 1; i <= n; i++) {
    b[rp[i]] = max(l, min_allowed + a[rp[i]]);
    if (b[rp[i]] > r) {
      ok = 0;
      break;
    }
    min_allowed = b[rp[i]] - a[rp[i]] + 1;
  }
  if (ok) {
    for (i = 1; i <= n; i++) printf("%I64d ", b[i]);
    putchar('\n');
  } else
    puts("-1");
  return 0;
}
