#include <bits/stdc++.h>
using namespace std;
const long long mod = 998244353;
inline long long ksm(long long a, long long b) {
  a %= mod;
  long long ans = 1;
  for (; b; b >>= 1, a = a * a % mod)
    if (b & 1) ans = ans * a % mod;
  return ans;
}
template <typename T>
inline void read(T &x) {
  x = 0;
  long long fu = 1;
  char c = getchar();
  while (c > 57 || c < 48) {
    if (c == 45) fu = -1;
    c = getchar();
  }
  while (c <= 57 && c >= 48) {
    x = (x << 3) + (x << 1) + c - 48;
    c = getchar();
  }
  x *= fu;
}
template <typename T, typename... Args>
inline void read(T &x, Args &...arg) {
  read(x);
  read(arg...);
}
template <typename T>
inline void write(T x) {
  if (x < 0) putchar('-'), x = -x;
  if (x >= 10) write(x / 10);
  putchar(x % 10 + '0');
}
long long n;
long long p[500000];
long long a[500000];
long long b[500000];
long long pos[500000];
void work() {
  read(n);
  long long l, r;
  read(l, r);
  for (long long i = 1; i <= n; i++) read(a[i]);
  for (long long i = 1; i <= n; i++) read(p[i]), pos[p[i]] = i;
  long long base = l - a[pos[1]];
  for (long long i = 1; i <= n; i++) {
    long long t = pos[i];
    b[t] = a[t] + base;
    base++;
  }
  long long ok = 1;
  long long sum = 0;
  for (long long i = 2; i <= n; i++) {
    long long t = pos[i];
    b[t] += sum;
    if (b[t] > r)
      ok = 0;
    else if (b[t] < l) {
      long long tmp = l - b[t];
      sum += tmp;
      b[t] = l;
    }
  }
  if (ok == 0)
    cout << -1 << endl;
  else {
    for (long long i = 1; i <= n; i++) cout << b[i] << " ";
  }
}
signed main() {
  work();
  getchar();
  getchar();
  return 0;
}
