#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, l, r;
  cin >> n >> l >> r;
  vector<long long int> a(n), b(n);
  vector<pair<long long int, long long int> > 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());
  reverse(p.begin(), p.end());
  long long int last = 1e15;
  bool ok = true;
  for (int i = 0; i < (n); i++) {
    if (!ok) break;
    long long int tb = min(last + a[p[i].second] - 1, r);
    if (tb < l) ok = false;
    last = tb - a[p[i].second];
    b[p[i].second] = tb;
  }
  if (!ok)
    cout << -1;
  else
    for (int i = 0; i < n; i++) cout << b[i] << ' ';
}
