#include <bits/stdc++.h>
using namespace std;
using uint = unsigned int;
using ll = long long;
const int M = 1e9 + 7;
const ll MLL = 1e18L + 9;
#pragma unused(M)
#pragma unused(MLL)
template <class... T>
void printl(T&&...) {}
template <class... T>
void printc(T&&...) {}
template <class... T>
void prints(T&&...) {}
template <class... T>
void printd(T&&...) {}
struct Elem {
  pair<int, int> pa;
  int idx;
  bool operator<(const Elem& e) const { return pa < e.pa; }
};
int main() {
  int n, l, r;
  cin >> n >> l >> r;
  vector<int> as(n), ps(n), bs(n);
  vector<Elem> pa(n);
  for (int i = 0; i < n; i++) {
    pa[i].idx = i;
  }
  for (int i = 0; i < n; i++) {
    scanf("%d", &pa[i].pa.second);
  }
  for (int i = 0; i < n; i++) {
    scanf("%d", &pa[i].pa.first);
  }
  sort(pa.begin(), pa.end());
  int prev = -M;
  for (int i = 0; i < n; i++) {
    int b = l, a = pa[i].pa.second;
    if (prev != -M && b - a <= prev) {
      b = a + prev + 1;
      if (b > r) {
        cout << -1 << '\n';
        return 0;
      }
    }
    prev = b - a;
    bs[i] = b;
  }
  prints(bs);
  vector<int> ans(n);
  for (int i = 0; i < n; i++) {
    ans[pa[i].idx] = bs[i];
  }
  for (int i = 0; i < n; i++) {
    cout << ans[i] << (i == n - 1 ? '\n' : ' ');
  }
  return 0;
}
