#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  long long int n, l, r;
  cin >> n >> l >> r;
  long long int a[n], p[n], b[n];
  for (long long int i = 0; i < n; i++) cin >> a[i];
  for (long long int i = 0; i < n; i++) cin >> p[i];
  priority_queue<pair<long long int, pair<long long int, long long int> > > q;
  for (int i = 0; i < n; i++) q.push(make_pair(p[i], make_pair(a[i], i)));
  long long int k, f;
  pair<long long int, long long int> diff;
  int flag = 1;
  diff.first = l - r, diff.second = r - l;
  while (!q.empty()) {
    pair<long long int, pair<long long int, long long int> > p = q.top();
    k = p.second.second;
    f = p.second.first;
    long long int c = diff.first + f;
    long long int d = diff.second + f;
    if (d < l || c > r) {
      flag = 0;
      break;
    }
    if (d >= r) {
      b[k] = r;
      diff.second = r - f - 1;
    } else {
      b[k] = d;
      diff.second = d - f - 1;
    }
    q.pop();
  }
  if (flag == 1) {
    for (int i = 0; i < n; i++) cout << b[i] << " ";
  } else
    cout << "-1";
  cout << endl;
  return 0;
}
