#include <bits/stdc++.h>
using namespace std;
int a[100100], b[100100];
pair<int, int> p[100100];
inline void boostIO() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
int main() {
  boostIO();
  int n, l, r, i, mn;
  cin >> n >> l >> r;
  for (i = 0; i < n; ++i) cin >> a[i];
  for (i = 0; i < n; ++i) cin >> p[i].first, p[i].second = i;
  sort(p, p + n);
  b[p[0].second] = l;
  mn = l - a[p[0].second];
  for (i = 1; i < n; ++i) {
    int& x = b[p[i].second];
    int& y = a[p[i].second];
    x = max(l, y + mn + 1);
    mn = x - y;
    if (x > r) return cout << -1, 0;
  }
  for (i = 0; i < n; ++i) cout << b[i] << ' ';
  return 0;
}
