#include <bits/stdc++.h>
inline void in(int &MAGNUS) { scanf("%d", &MAGNUS); }
inline void out(int MAGNUS) { printf("%d\n", MAGNUS); }
inline void in(int &MAGNUS, int &CLAR) { scanf("%d%d", &MAGNUS, &CLAR); }
inline void out(int MAGNUS, int CLAR) { printf("%d %d\n", MAGNUS, CLAR); }
inline void inl(long long &LIV) { scanf("%lld", &LIV); }
inline void inl(long long &LIV, long long &MART) {
  scanf("%lld%lld", &LIV, &MART);
}
inline void outl(long long LIV) { printf("%lld\n", LIV); }
inline void outl(long long LIV, long long MART) {
  printf("%lld %lld\n", LIV, MART);
}
using namespace std;
int N;
long long low, hi, ans[100005];
struct dat {
  long long first, second, pos;
} a[100005];
bool cmp(dat a, dat b) { return a.pos < b.pos; }
int main() {
  in(N);
  inl(low, hi);
  for (int i = 1; i <= N; i++) inl(a[i].second);
  for (int i = 1; i <= N; i++) inl(a[i].pos);
  for (int i = 1; i <= N; i++) a[i].first = i;
  sort((a) + 1, (a) + (N) + 1, cmp);
  a[0].second = -1LL << 60;
  memset(ans, -1, sizeof(ans));
  for (int i = 1; i <= N; i++) {
    long long left = low, right = hi, mid;
    while (left <= right) {
      mid = (left + right) / 2;
      if (mid - a[i].second > a[i - 1].second) {
        ans[a[i].first] = mid;
        right = mid - 1;
      } else
        left = mid + 1;
    }
    a[i].second = ans[a[i].first] - a[i].second;
  }
  for (int i = 1; i <= N; i++) {
    if (ans[i] == -1) {
      out(-1);
      return 0;
    }
  }
  for (int i = 1; i <= N; i++) printf("%lld ", ans[i]);
  return 0;
}
