#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const long long MOD = 998244353;
inline long long add(long long x, long long y) {
  x += y;
  if (x >= mod) x -= mod;
  return x;
}
inline long long sub(long long x, long long y) {
  x -= y;
  if (x < 0) x += mod;
  return x;
}
inline long long mul(long long x, long long y) { return (x * 1ll * y) % mod; }
signed main() {
  long long n, l, r;
  cin >> n >> l >> r;
  long long a[n], c[n];
  for (long long i = 0; i < n; i++) cin >> a[i];
  for (long long i = 0; i < n; i++) cin >> c[i];
  vector<pair<long long, long long>> v;
  for (long long i = 0; i < n; i++) v.push_back({c[i], a[i]});
  sort(v.begin(), v.end());
  long long next = 0, x, y, ans, ok = 0;
  vector<long long> b(n + 5);
  for (long long i = 0; i < n; i++) {
    x = v[i].second;
    y = v[i].first;
    if (i == 0) {
      b[y] = l;
      next = l - x + 1;
    } else {
      ans = x + next;
      if (ans < l) {
        next = l - x + 1;
        b[y] = l;
      } else {
        b[y] = ans;
        next++;
      }
      if (ans > r) ok = 1;
    }
  }
  if (ok)
    cout << -1;
  else
    for (long long i = 0; i < n; i++) {
      long long k = c[i];
      cout << b[k] << " ";
    }
}
