#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, L, R, ar[100004], p[100005], b[100005];
  scanf("%d %d %d", &n, &L, &R);
  for (int i = 1; i <= n; ++i) scanf("%d", &ar[i]);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &p[i]);
    b[p[i]] = i;
  }
  int maxC = R + 1;
  int ans[100005];
  for (int i = n; i > 0; --i) {
    if (i == n) {
      maxC = R - ar[b[i]];
      ans[b[i]] = R;
    } else {
      int val = ar[b[i]] + maxC;
      val--;
      if (val < L) {
        printf("-1");
        return 0;
      } else if (val > R)
        val = R;
      ans[b[i]] = val;
      maxC = val - ar[b[i]];
    }
  }
  for (int i = 1; i <= n; ++i) printf("%d ", ans[i]);
  return 0;
}
