#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int getrnd(int l, int r) { return uniform_int_distribution<int>(l, r)(rng); }
template <typename T1, typename T2>
bool relax(T1& a, const T2& b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <typename T1, typename T2>
bool strain(T1& a, const T2& b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
void solve() {
  ll n, l, r;
  cin >> n >> l >> r;
  vector<ll> a(n);
  vector<pair<ll, ll>> p(n);
  for (int i = 0; i < n; ++i) cin >> a[i];
  for (int i = 0; i < n; ++i) cin >> p[i].first, p[i].second = i;
  sort(p.begin(), p.end());
  vector<ll> b(n), c(n);
  ll prev = -1e10;
  for (int i = 0; i < n; ++i) {
    int ind = p[i].second;
    ll cur = l;
    if (cur - a[ind] <= prev) {
      cur = max(a[ind] + prev + 1, l);
    }
    if (cur - a[ind] <= prev || cur > r || cur < l) {
      cout << "-1\n";
      return;
    }
    b[ind] = cur;
    prev = b[ind] - a[ind];
  }
  for (int i = 0; i < n; ++i) cout << b[i] << ' ';
  cout << '\n';
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(nullptr);
  cout.tie(nullptr);
  srand(time(0));
  int t = 1;
  while (t--) solve();
  return 0;
}
