#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:1024000000,1024000000")
using namespace std;
struct node {
  int x, y;
  int pai;
  int ans;
  int iu;
};
node a[200005], b[200005], c[200005];
int ct[200005];
int cmp(node a, node b) { return a.pai < b.pai; }
int cmp1(node a, node b) { return a.iu < b.iu; }
int main() {
  int n, l, r;
  scanf("%d", &n);
  scanf("%d", &l);
  scanf("%d", &r);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i].x);
    a[i].iu = i;
  }
  for (int i = 1; i <= n; i++) scanf("%d", &a[i].pai);
  sort(a + 1, a + 1 + n, cmp);
  int len = r - l;
  int flag = 1;
  int last = 0;
  for (int i = 1; i <= n; i++) {
    int ls = last + a[i].x;
    ls++;
    int kt;
    if (i == 1) ls = l - a[i].x;
    if (ls > r) {
      printf("-1\n");
      return 0;
    } else if (ls < l) {
      a[i].y = l;
      a[i].ans = a[i].y - a[i].x;
    } else {
      a[i].y = ls;
      a[i].ans = a[i].y - a[i].x;
    }
    last = a[i].ans;
  }
  sort(a + 1, a + 1 + n, cmp1);
  for (int i = 1; i <= n; i++) {
    i != 1 ? printf(" ") : printf("");
    printf("%d", a[i].y);
  }
  return 0;
}
