#include <bits/stdc++.h>
using namespace std;
bool cmp(pair<long long int, long long int> a,
         pair<long long int, long long int> b) {
  if (a.first != b.first) return a.first > b.first;
  return a.second < b.second;
}
int a[200005], p[200005], b[200005];
int main() {
  vector<pair<int, pair<int, int> > > v;
  int n, l, r, maxx = 0, index, q, w, d, flag = 0;
  cin >> n >> l >> r;
  for (long long int i = 0; i < n; i++) cin >> a[i];
  for (long long int i = 0; i < n; i++) {
    cin >> p[i];
    if (p[i] > maxx) {
      maxx = p[i];
      index = i;
    }
  }
  if (n == 1) {
    cout << r << endl;
    return 0;
  }
  for (long long int i = 0; i < n; i++)
    v.push_back(make_pair(p[i], make_pair(a[i], i)));
  sort(v.begin(), v.end());
  b[index] = r;
  d = r - a[index] - 1;
  for (long long int i = (v.size() - 2); i >= 0; i--) {
    w = v[i].second.first;
    q = v[i].second.second;
    if (d + w <= r) {
      b[q] = d + w;
      d--;
    } else {
      b[q] = r;
      d = r - w - 1;
    }
  }
  for (long long int i = 0; i < n; i++) {
    if (b[i] < l || b[i] > r) {
      flag = 1;
      break;
    }
  }
  if (flag == 1)
    cout << -1 << endl;
  else {
    for (long long int i = 0; i < n; i++) cout << b[i] << " ";
  }
  return 0;
}
