#include <bits/stdc++.h>
using namespace ::std;
const int maxn = 1e5 + 5;
int n, l, r, b[maxn], ind[maxn];
pair<int, int> a[maxn];
void solve() {
  scanf("%d%d%d", &n, &l, &r);
  for (int i = 0; i < n; i++) scanf("%d", &a[i].second);
  for (int i = 0; i < n; i++) scanf("%d", &a[i].first);
  for (int i = 0; i < n; i++) ind[i] = a[i].first - 1;
  sort(a, a + n);
  int k = l - a[0].second;
  b[0] = l;
  for (int i = 1; i < n; i++) {
    if (a[i].second + k + 1 > r) {
      puts("-1");
      return;
    }
    k = max(k + 1, l - a[i].second);
    b[i] = a[i].second + k;
  }
  for (int i = 0; i < n; i++) printf("%d ", b[ind[i]]);
  puts("");
}
int main() {
  solve();
  return 0;
}
