#include <bits/stdc++.h>
using namespace std;
void swap(long long int *a, long long int *b) {
  long long temp = *a;
  *a = *b;
  *b = temp;
}
long long pram(long long a, long long b, long long mod) {
  long long res = 0;
  while (b != 0) {
    if (b & 1) res += a;
    a <<= 1;
    a = a % mod;
    b >>= 1;
    res = res % mod;
  }
  return res;
}
unsigned long long mod_pow(unsigned long long b, unsigned long long p,
                           unsigned long long mod) {
  unsigned long long s = 1;
  b = b % mod;
  while (p) {
    if (p & 1) s = pram(s, b, mod);
    b = pram(b, b, mod);
    p >>= 1;
  }
  return s;
}
long long gcd(long long a, long long b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
long long sgn(long long x) {
  if (x < 0)
    return -1;
  else
    return 1;
}
long long exgcd(long long a, long long b, long long *x, long long *y) {
  if (a == 0) {
    *x = 1;
    *y = 1;
    return b;
  }
  long long p, q, g;
  g = exgcd(b % a, a, &p, &q);
  *x = q - (b / a) * p;
  *y = p;
  return g;
}
struct tb {
  long long id;
  long long a;
  long long p;
  long long b;
};
bool cmp1(tb x, tb y) { return (x.p > y.p); }
bool cmp2(tb x, tb y) { return (x.id < y.id); }
int main() {
  long long n, l, r, res = 0;
  cin >> n >> l >> r;
  vector<tb> v(n);
  for (long long i = 0; i <= n - 1; i++) {
    cin >> v[i].a;
    v[i].id = i;
  }
  for (long long i = 0; i <= n - 1; i++) {
    cin >> v[i].p;
  }
  sort(v.begin(), v.end(), cmp1);
  long long dif;
  dif = r - l;
  for (long long i = 0; i <= n - 1; i++) {
    if (dif + v[i].a > r) {
      dif = r - v[i].a;
      v[i].b = r;
      dif--;
    } else if (dif + v[i].a >= l) {
      v[i].b = v[i].a + dif;
      dif--;
    } else {
      cout << -1;
      return 0;
    }
  }
  sort(v.begin(), v.end(), cmp2);
  for (long long i = 0; i <= n - 1; i++) {
    cout << v[i].b << " ";
  }
  return 0;
}
