#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-6;
const int INF = 2e9;
const long long LNF = 9e18;
const int mod = 1e9 + 7;
const int maxn = 1e5 + 10;
int A[maxn], a[maxn], b[maxn], p[maxn];
int n, l, r;
void init() {
  scanf("%d%d%d", &n, &l, &r);
  for (int i = 1; i <= n; i++) scanf("%d", &A[i]);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &p[i]);
    a[p[i]] = A[i];
  }
}
void solve() {
  int minn = -INF, B = 1;
  for (int i = 1; i <= n; i++) {
    b[i] = max(minn, l - a[i]) + a[i];
    minn = max(minn, l - a[i]) + 1;
    if (b[i] < l || b[i] > r) {
      B = 0;
      break;
    }
  }
  if (!B)
    puts("-1");
  else
    for (int i = 1; i <= n; i++) printf("%d ", b[p[i]]);
}
int main() {
  init();
  solve();
}
