#include <bits/stdc++.h>
using namespace std;
long long n, l, r, a[100005], b[100005], sum, jum;
pair<long long, long long> p[100005];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> l >> r;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  for (int i = 1; i <= n; i++) {
    cin >> p[i].first;
    p[i].second = i;
  }
  sort(p + 1, p + 1 + n);
  for (int i = n; i >= 1; i--) {
    if (i == n) {
      sum = r - a[p[i].second];
      b[p[i].second] = r;
    } else {
      jum = sum + a[p[i].second];
      if (jum > r) {
        b[p[i].second] = r;
        sum = r - a[p[i].second];
      } else if (jum < l) {
        cout << -1 << '\n';
        return 0;
      } else {
        b[p[i].second] = jum;
      }
    }
    sum--;
  }
  for (int i = 1; i <= n; i++) {
    cout << b[i] << " ";
  }
  cout << '\n';
}
