#include <bits/stdc++.h>
using namespace std;
struct triplet {
  int a, b, c;
};
bool cmp_triplet(const triplet& a, const triplet& b) { return a.b < b.b; }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, l, r;
  cin >> n >> l >> r;
  vector<triplet> v(n);
  for (triplet& x : v) cin >> x.a;
  for (triplet& x : v) cin >> x.b;
  for (int i = 0; i < n; ++i) v[i].c = i;
  vector<int> ans(n);
  int min_allowed = -999999999;
  sort(v.begin(), v.end(), cmp_triplet);
  for (triplet t : v) {
    min_allowed = max(min_allowed + 1, l - t.a);
    if (min_allowed + t.a > r) {
      cout << -1 << endl;
      return 0;
    }
    ans[t.c] = min_allowed + t.a;
  }
  for (int x : ans) cout << x << ' ';
  cout << endl;
}
