#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100000 + 10;
const int INF = numeric_limits<int>::max();
const double EPS = 0.0001;
void files() {
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
}
int a[MAXN], b[MAXN];
pair<int, int> p[MAXN];
int main() {
  ios_base::sync_with_stdio(false);
  int n, l, r;
  cin >> n >> l >> r;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= n; i++) {
    cin >> p[i].first;
    p[i].second = i;
    p[i].first = -p[i].first;
  }
  sort(p + 1, p + n + 1);
  b[p[1].second] = r;
  int start = b[p[1].second] - a[p[1].second] - 1;
  for (int i = 2; i <= n; i++) {
    if (start + a[p[i].second] >= l && start + a[p[i].second] <= r) {
      b[p[i].second] = start + a[p[i].second];
    } else {
      if (start + a[p[i].second] > r) {
        start = r - a[p[i].second];
        b[p[i].second] = start + a[p[i].second];
      } else {
        cout << "-1";
        return 0;
      }
    }
    start--;
  }
  for (int i = 1; i <= n; i++) cout << b[i] << " ";
  return 0;
}
