#include <bits/stdc++.h>
using namespace std;
int n, l, r, temp, a[100005], b[100005];
bool ada = true;
vector<pair<int, int> > p;
int main() {
  memset(b, -1, sizeof b);
  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", &temp);
    p.push_back(make_pair(temp, i));
  }
  sort(p.begin(), p.end());
  b[p[0].second] = l;
  temp = l - a[p[0].second];
  for (int i = 1; i < n; i++) {
    b[p[i].second] = a[p[i].second] + temp + 1;
    if (b[p[i].second] < l) {
      b[p[i].second] = l;
      temp = l - a[p[i].second];
    } else
      temp++;
    if (b[p[i].second] > r) {
      ada = false;
      break;
    }
  }
  if (!ada)
    printf("-1\n");
  else
    for (int i = 0; i < n; i++) {
      printf("%d", b[i]);
      if (i == n - 1)
        printf("\n");
      else
        printf(" ");
    }
  return 0;
}
