#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, l, r;
  cin >> n >> l >> r;
  long long x[n + 5], y[n + 5];
  for (long long i = 1; i <= n; i++) {
    cin >> x[i];
  }
  map<long long, long long> mp;
  for (long long j = 1; j <= n; j++) {
    cin >> y[j];
    mp[y[j]] = j;
  }
  long long pre = -1e+16;
  long long ans = true;
  long long w[n + 5];
  for (long long i = 1; i <= n; i++) {
    long long o = pre + x[mp[i]] + 1;
    long long c = max(l, o);
    if (c > r) {
      ans = false;
    }
    w[mp[i]] = c;
    pre = w[mp[i]] - x[mp[i]];
  }
  if (ans == false) {
    cout << "-1" << endl;
  } else {
    for (long long i = 1; i <= n; i++) {
      cout << w[i] << " ";
    }
    cout << endl;
  }
}
