#include <bits/stdc++.h>
using namespace std;
const int MAX = 50;
const int MAX_VAL = 1000;
int main() {
  ios::sync_with_stdio(false);
  int n, L, r;
  cin >> n >> L >> r;
  vector<int> a(n);
  for (int i = 0; i < n; ++i) cin >> a[i];
  vector<pair<int, int> > p(n);
  for (int i = 0; i < n; ++i) {
    cin >> p[i].first;
    p[i].second = i;
  }
  sort(p.begin(), p.end());
  vector<int> b(n);
  b[p[0].second] = L;
  long long last = b[p[0].second] - a[p[0].second];
  for (int i = 1; i < n; ++i) {
    int j = p[i].second;
    long long curr = max((long long)a[j] + last + 1, (long long)L);
    if (curr > (long long)r) {
      cout << -1 << endl;
      return 0;
    }
    b[j] = (int)curr;
    last = b[j] - a[j];
  }
  for (int i = 0; i < n; ++i) cout << b[i] << " ";
  cout << endl;
  return 0;
}
