#include <bits/stdc++.h>
using namespace std;
const long long N = 1e9 + 7;
long long power(long long x, long long y) {
  long long res = 1;
  while (y > 0) {
    if (y & 1) res = ((res) * (x));
    res %= N;
    y = y >> 1;
    x = ((x) * (x));
  }
  return res;
}
long long powmod(long long a, long long b, long long n) {
  long long x = 1, y = a;
  while (b > 0) {
    if (b % 2 == 1) {
      x = (x * y) % n;
    }
    y = (y * y) % n;
    b /= 2;
  }
  return x % n;
}
bool sortbyval(pair<long long, long long>& p1, pair<long long, long long>& p2) {
  return p1.second < p2.second;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t = 1;
  while (t--) {
    long long n, l, r;
    cin >> n >> l >> r;
    long long a[n + 5], b = l, c[n + 5];
    for (long long i = 0; i < n; i++) cin >> a[i];
    vector<pair<long long, long long>> vec;
    for (long long i = 0; i < n; i++) {
      long long x;
      cin >> x;
      vec.push_back(make_pair(x, i));
    }
    stable_sort(vec.begin(), vec.end());
    long long pre, cur = vec[0].second;
    c[cur] = b - a[cur];
    for (long long i = 1; i < n; i++) {
      pre = cur;
      cur = vec[i].second;
      b = c[pre] + 1 + a[cur];
      if (b > r) {
        cout << -1;
        return 0;
      }
      if (b < l) b = l;
      c[cur] = b - a[cur];
    }
    for (long long i = 0; i < n; i++) cout << a[i] + c[i] << " ";
  }
  return 0;
}
