#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 100;
const int INF = 1e9;
vector<pair<int, int> > pp;
int n, l, r, a[N], p[N], b[N], now = -INF;
int main() {
  cin >> n >> l >> r;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= n; i++) {
    cin >> p[i];
    pp.push_back(make_pair(p[i], i));
  }
  sort(pp.begin(), pp.end());
  for (int i = 0; i < n; i++) {
    b[pp[i].second] = max(l, now + a[pp[i].second] + 1);
    if (b[pp[i].second] > r) {
      cout << "-1";
      return 0;
    }
    now = b[pp[i].second] - a[pp[i].second];
  }
  for (int i = 1; i <= n; i++) cout << b[i] << " ";
  return 0;
}
