#include <bits/stdc++.h>
using namespace std;
struct el {
  int i;
  long long a, c;
};
void solve() {
  long long n, l, r;
  cin >> n >> l >> r;
  vector<long long> itog(n);
  vector<el> mas(n);
  for (int i = 0; i < n; i++) {
    cin >> mas[i].a;
    mas[i].i = i;
  }
  for (int i = 0; i < n; i++) cin >> mas[i].c;
  sort(mas.begin(), mas.end(), [](el a, el b) -> bool { return a.c < b.c; });
  long long min = -1e10;
  for (int i = 0; i < n; i++) {
    long long now = min + 1;
    if (mas[i].a + now < l) now = l - mas[i].a;
    if (mas[i].a + now > r) {
      cout << -1;
      return;
    }
    min = now;
    itog[mas[i].i] = mas[i].a + now;
  }
  for (long long i : itog) cout << i << " ";
  cout << "\n";
}
int main() {
  int n = 1;
  for (int i = 1; i <= n; i++) {
    solve();
  }
}
