#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100005;
int n, l, r;
int st;
int a[MAXN], c[MAXN], re[MAXN], res[MAXN];
int tem;
int jia;
int main() {
  scanf("%d %d %d", &n, &l, &r);
  int i;
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  for (i = 0; i < n; i++) {
    scanf("%d", &tem);
    c[tem] = i;
  }
  res[c[1] + 1] = re[1] = l;
  for (i = 2; i <= n; i++) {
    jia = 0;
    jia = a[c[i]] - a[c[i - 1]] + 1;
    re[i] = re[i - 1] + jia;
    if (re[i] < l) re[i] = l;
    if (re[i] > r) {
      printf("-1\n");
      return 0;
    }
    res[c[i] + 1] = re[i];
  }
  if (re[n] <= r) {
    for (i = 1; i <= n; i++) printf("%d ", res[i]);
  }
  printf("\n");
  return 0;
}
