#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int maxn = 2e6 + 11;
const int mod = 200907;
struct IN {
  long long a, b, c, d;
} x[100005];
bool cmp(IN p1, IN p2) { return p1.b < p2.b; }
bool cmp2(IN p1, IN p2) { return p1.c < p2.c; }
int main() {
  long long n, l, r;
  while (~scanf("%lld%lld%lld", &n, &l, &r)) {
    for (long long i = 0; i < n; i++) {
      scanf("%lld", &x[i].a);
      x[i].c = i;
    }
    for (long long i = 0; i < n; i++) {
      scanf("%lld", &x[i].b);
    }
    sort(x, x + n, cmp);
    long long p = l, q = l - x[0].a;
    x[0].d = l;
    int k = 1;
    for (long long i = 1; i < n; i++) {
      if (p - x[i].a > q) {
        long long m = q + 1 + x[i].a;
        if (m <= l) {
          x[i].d = l;
          q = x[i].d - x[i].a;
          p = l;
        } else {
          x[i].d = m;
          q = q + 1;
          p = m;
        }
      } else {
        q = q + 1;
        p = q + x[i].a;
        x[i].d = p;
      }
      if (x[i].d > r || x[i].d < l) {
        k = 0;
        break;
      }
    }
    if (k) {
      sort(x, x + n, cmp2);
      for (int i = 0; i < n; i++) {
        printf("%d ", x[i].d);
      }
      printf("\n");
    } else {
      printf("-1\n");
    }
  }
  return 0;
}
