#include <bits/stdc++.h>
using namespace std;
const long long mod = (long long)1e9 + 7;
long long modpow(long long base, long long exp) {
  if (exp == 0) return (long long)1;
  long long a = modpow(base, exp / 2) % mod;
  if (exp % 2) {
    return ((a * a) % mod) * base % mod;
  }
  return (a * a) % mod;
}
int main(int argc, char const *argv[]) {
  ios::sync_with_stdio(0);
  long long n, l, r;
  cin >> n >> l >> r;
  pair<long long, pair<long long, long long> > arr[n + 1];
  long long ans[n + 1];
  for (long long i = 1; i <= n; ++i) {
    cin >> arr[i].second.first;
    arr[i].second.second = i;
  }
  for (long long i = 1; i <= n; ++i) {
    cin >> arr[i].first;
  }
  sort(arr + 1, arr + n + 1);
  long long min = l;
  long long diff = min - arr[1].second.first;
  ans[arr[1].second.second] = min;
  for (long long i = 2; i <= n; ++i) {
    min = l;
    if (min - arr[i].second.first <= diff) {
      min = diff + 1 + arr[i].second.first;
      if (min < l || min > r) {
        cout << "-1\n";
        return 0;
      }
    }
    ans[arr[i].second.second] = min;
    diff = min - arr[i].second.first;
  }
  for (long long i = 1; i <= n; ++i) {
    cout << ans[i] << ' ';
  }
  return 0;
}
