#include <bits/stdc++.h>
using namespace ::std;
pair<pair<int, int>, int> L[100005];
vector<int> A, P;
int B[100005];
bool mysort(pair<pair<int, int>, int> a, pair<pair<int, int>, int> b) {
  if (a.first.second < b.first.second)
    return true;
  else if (a.first.second == b.first.second) {
    if (a.first.first < b.first.first)
      return true;
    else
      return false;
  } else
    return false;
}
int main(void) {
  int n, l, r, c;
  cin >> n >> l >> r;
  for (int i = 0; i < n; i++) {
    scanf("%d", &c);
    A.push_back(c);
  }
  for (int i = 0; i < n; i++) {
    scanf("%d", &c);
    P.push_back(c);
  }
  for (int i = 0; i < n; i++) L[i] = make_pair(make_pair(A[i], P[i]), i);
  sort(L, L + n, mysort);
  int aux, actual = L[n - 1].first.second;
  bool f = true;
  aux = r - L[n - 1].first.first;
  if (aux + L[n - 1].first.first >= l && aux + L[n - 1].first.first <= r) {
    B[L[n - 1].second] = aux + L[n - 1].first.first;
    for (int i = n - 2; i >= 0 && f; i--) {
      if (actual == L[i].first.second) {
        if (aux + L[i].first.first < l || aux + L[i].first.first > r)
          f = false;
        else
          B[L[i].second] = aux + L[i].first.first;
      } else {
        int aux2 = aux;
        aux = r - L[i].first.first;
        aux = min(aux, aux2 - 1);
        actual = L[i].first.second;
        if (aux + L[i].first.first < l || aux + L[i].first.first > r)
          f = false;
        else
          B[L[i].second] = aux + L[i].first.first;
      }
    }
  } else
    f = false;
  if (!f)
    cout << -1 << endl;
  else {
    for (int i = 0; i < n - 1; i++) cout << B[i] << " ";
    cout << B[n - 1] << endl;
  }
  return 0;
}
