#include <bits/stdc++.h>
using namespace std;
long long int MAXN = 5000001;
const long long int mod = 1000000007;
const long long int INF = INT_MAX;
inline long long int gcd(long long int a, long long int b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
inline long long int pow(long long int a, long long int n, long long int mod) {
  if (n == 0) return 1;
  long long int p = pow(a, n / 2, mod);
  p = (p % mod * p % mod) % mod;
  if (n % 2)
    return (p % mod * a % mod) % mod;
  else
    return p;
}
bool comp(pair<pair<long long int, long long int>, long long int> &a,
          pair<pair<long long int, long long int>, long long int> &b) {
  return a.first.second > b.first.second;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int t = 1;
  long long int l = 1;
  while (t--) {
    long long int n, l, r;
    cin >> n >> l >> r;
    vector<pair<pair<long long int, long long int>, long long int> > v(n);
    for (long long int i = 0; i < n; i++) {
      cin >> v[i].first.first;
      v[i].second = i;
    }
    for (long long int i = 0; i < n; i++) cin >> v[i].first.second;
    sort(v.begin(), v.end(), comp);
    long long int lmt = r - v[0].first.first;
    vector<long long int> b(n);
    b[v[0].second] = r;
    for (long long int i = 1; i < n; i++) {
      long long int d = lmt + v[i].first.first - 1;
      long long int low = l;
      long long int high = r;
      long long int ans = -1;
      while (low <= high) {
        long long int mid = (low + high) / 2;
        if (mid <= d) {
          ans = mid;
          low = mid + 1;
        } else
          high = mid - 1;
      }
      if (ans == -1) {
        cout << -1;
        return 0;
      }
      b[v[i].second] = ans;
      lmt = ans - v[i].first.first;
    }
    for (long long int i = 0; i < n; i++) cout << b[i] << " ";
  }
}
