#include <bits/stdc++.h>
using namespace std;
const int MAX = 100010;
int a[MAX], p[MAX], b[MAX];
int n, l, r;
bool solve() {
  int x = p[1];
  int tmp = l - a[x];
  b[x] = l;
  for (int i = 2; i <= n; i++) {
    x = p[i];
    tmp++;
    if (a[x] + tmp >= l && a[x] + tmp <= r) {
      b[x] = a[x] + tmp;
    } else if (a[x] + tmp < l) {
      b[x] = l;
      tmp = l - a[x];
    } else {
      return false;
    }
  }
  return true;
}
int main(int argc, char const *argv[]) {
  while (scanf("%d%d%d", &n, &l, &r) != EOF) {
    for (int i = 1; i <= n; i++) {
      scanf("%d", &a[i]);
    }
    int tmp;
    for (int i = 1; i <= n; i++) {
      scanf("%d", &tmp);
      p[tmp] = i;
    }
    if (solve()) {
      printf("%d", b[1]);
      for (int i = 2; i <= n; i++) {
        printf(" %d", b[i]);
      }
      printf("\n");
    } else {
      printf("-1\n");
    }
  }
  return 0;
}
