#include <bits/stdc++.h>
using namespace std;
template <typename T>
bool chmax(T& a, const T& b) {
  return a < b ? (a = b, true) : false;
}
template <typename T>
bool chmin(T& a, const T& b) {
  return b < a ? (a = b, true) : false;
}
int N, L, R;
const int INF = 2e9;
int main() {
  scanf("%d%d%d", &N, &L, &R);
  vector<int> A(N);
  for (int i = (int)(0); i < (int)(N); i++) {
    scanf("%d", &A[i]);
  }
  vector<pair<int, int> > P(N);
  for (int i = (int)(0); i < (int)(N); i++) {
    scanf("%d", &P[i].first);
    P[i].second = i;
  }
  sort(P.begin(), P.end());
  vector<int> B(N);
  int prev = -INF;
  for (int i = (int)(0); i < (int)(N); i++) {
    int idx = P[i].second;
    B[idx] = prev + A[idx] + 1;
    if (B[idx] > R) {
      printf("-1\n");
      return 0;
    }
    chmax(B[idx], L);
    prev = B[idx] - A[idx];
  }
  for (int i = (int)(0); i < (int)(N); i++) {
    printf("%d%s", B[i], i == N - 1 ? "\n" : " ");
  }
  return 0;
}
