#include <bits/stdc++.h>
using namespace std;
int n, l, r, tmp;
int a[100005], b[100005];
pair<int, int> c[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", &tmp);
    c[i] = make_pair(tmp, i);
  }
  sort(c, c + n);
  int cur, available = -(1 << 31);
  for (int j = 0; j < n; ++j) {
    int i = c[j].second;
    b[i] = l;
    cur = b[i] - a[i];
    if (cur > available)
      available = cur;
    else {
      int delta = available - cur + 1;
      b[i] += delta;
      if (b[i] > r) {
        printf("%d\n", -1);
        return 0;
      }
      available = b[i] - a[i];
    }
  }
  for (int i = 0; i < n; ++i) printf("%d ", b[i]);
  return 0;
}
