#include <bits/stdc++.h>
using namespace std;
long long int n, l, r;
pair<long long int, pair<long long int, long long int>> a[100005];
long long int b[100005];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n >> l >> r;
  for (long long int i = 0; i < n; i++) cin >> a[i].second.first;
  for (long long int i = 0; i < n; i++) {
    cin >> a[i].first;
    a[i].second.second = i;
  }
  sort(a, a + n);
  long long int top = r - a[n - 1].second.first;
  bool flag = true;
  for (long long int i = n - 1; i >= 0; i--) {
    b[a[i].second.second] = top + a[i].second.first;
    long long int sum = r - a[i - 1].second.first;
    top = min(sum, top - 1);
    if (b[a[i].second.second] < l) flag = false;
    if (!flag) break;
  }
  if (!flag) {
    cout << -1;
    return 0;
  }
  for (long long int i = 0; i < n; i++) cout << b[i] << " ";
  return 0;
}
