#include <bits/stdc++.h>
using namespace std;
struct node {
  int id, num;
} a[100005];
int b[100005], k[100005];
int n, l, r;
bool cmp(node a, node b) { return a.id > b.id; }
int main() {
  scanf("%d%d%d", &n, &l, &r);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i].num);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i].id);
    k[i] = a[i].id;
  }
  sort(a + 1, a + n + 1, cmp);
  b[1] = r;
  bool flag = 1;
  for (int i = 2; i <= n; i++) {
    if (b[i - 1] - a[i - 1].num - 1 + a[i].num >= l) {
      b[i] = b[i - 1] - a[i - 1].num - 1 + a[i].num;
      if (b[i] > r) b[i] = r;
    } else {
      flag = 0;
      break;
    }
  }
  if (!flag)
    printf("-1");
  else {
    for (int i = 1; i <= n; i++) {
      if (i - 1) printf(" ");
      printf("%d", b[n - k[i] + 1]);
    }
  }
  printf("\n");
  return 0;
}
