#include <bits/stdc++.h>
using namespace std;
void ga(int N, int *A) {
  for (int i(0); i < N; i++) scanf("%d", A + i);
}
int N, L, R, A[(1 << 18)], P[(1 << 18)], G[(1 << 18)], l = -2e9 - 1, a, b,
                                                       B[(1 << 18)], I, W;
int main(void) {
  scanf("%d%d%d", &N, &L, &R), ga(N, A), ga(N, P);
  for (int i(0); i < N; i++) G[P[i] - 1] = i;
  for (int i(0); i < N; i++) {
    a = A[I = G[i]], W = l + a + 1;
    if (W < L)
      B[I] = L, l = a - L;
    else if (W > R)
      return puts("-1"), 0;
    else
      B[I] = l + a + 1;
    l = B[I] - a;
  }
  for (int i(0); i < N; i++) printf("%d%c", B[i], i + 1 == N ? 10 : 32);
  return 0;
}
