#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 10;
const long long infll = 1e18 + 500;
const int mod = 1e9 + 7;
int a[100100];
pair<int, int> b[100100];
long long ans[100100];
int main(void) {
  int n;
  long long l, r;
  scanf("%d %lld %lld", &n, &l, &r);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &b[i].first);
    b[i].second = i;
  }
  sort(b + 1, b + n + 1);
  long long prev;
  for (int i = 1; i <= n; i++) {
    int id = b[i].second;
    if (i == 1) {
      ans[id] = l;
      prev = l - a[id];
    } else {
      long long req = prev + 1;
      int use = max(l, a[id] + req);
      if (use > r) {
        printf("-1\n");
        return 0;
      } else {
        ans[id] = use;
        prev = use - a[id];
      }
    }
  }
  for (int i = 1; i <= n; i++) printf("%lld ", ans[i]);
  printf("\n");
  return 0;
}
