#include <bits/stdc++.h>
using namespace std;
int n, l, r;
int a[100005], p[100005];
int where[100005];
int ans[100005];
int main() {
  scanf("%d%d%d", &n, &l, &r);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  for (int i = 0; i < n; i++) {
    scanf("%d", &p[i]);
    where[p[i]] = i;
  }
  int c = -1e9;
  c = l - a[where[1]];
  ans[where[1]] = l;
  vector<int> v;
  v.push_back(c);
  for (int i = 1; i < n; i++) {
    c++;
    int wh = where[i + 1];
    if (c + a[wh] > r) {
      printf("-1\n");
      return 0;
    }
    if (c + a[wh] < l) c = l - a[wh];
    ans[wh] = c + a[wh];
    v.push_back(c);
  }
  for (int i = 0; i < n; i++) {
    if (ans[i] < l || ans[i] > r) {
      printf("-1\n");
      return 0;
    }
    if (i && v[i] <= v[i - 1]) {
      printf("-1\n");
      return 0;
    }
  }
  for (int i = 0; i < n; i++) {
    if (i) printf(" ");
    printf("%d", ans[i]);
  }
  printf("\n");
  return 0;
}
