#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
int n, l, r;
int a[maxn], b[maxn], c[maxn], s[maxn];
int main() {
  cin >> n >> l >> r;
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &c[i]);
    s[c[i]] = i;
  }
  b[s[1]] = l;
  int biu = b[s[1]] - a[s[1]];
  for (int i = 2; i <= n; i++) {
    biu++;
    b[s[i]] = a[s[i]] + biu;
    if (b[s[i]] > r) {
      cout << -1 << endl;
      return 0;
    }
    if (b[s[i]] < l) {
      b[s[i]] = l;
      biu = b[s[i]] - a[s[i]];
    }
  }
  for (int i = 1; i < n; i++) printf("%d ", b[i]);
  cout << b[n] << endl;
}
