#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
long long powmod(long long a, long long b) {
  long long res = 1;
  a %= mod;
  assert(b >= 0);
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
  }
  return res;
}
long long n, l, r, dee, a[100010], ans[100010];
pair<long long, long long> p[100010];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  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;
  }
  sort(p + 1, p + n + 1);
  int ind = p[1].second;
  ans[ind] = l;
  for (int i = 2; i <= n; ++i) {
    int dee = ans[ind] - a[ind] + 1;
    if (a[p[i].second] + dee >= l && a[p[i].second] + dee <= r) {
      ans[p[i].second] = a[p[i].second] + dee;
    } else if (a[p[i].second] + dee < l) {
      ans[p[i].second] = l;
    } else {
      cout << "-1";
      return 0;
    }
    ind = p[i].second;
  }
  for (int i = 1; i <= n; ++i) {
    cout << ans[i] << ' ';
  }
  return 0;
}
