#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int n, l, r;
int b[N];
struct kaka {
  int a, p, cs, b;
} a[N];
bool cmp(kaka x, kaka y) { return x.p < y.p; }
bool cmp2(kaka x, kaka y) { return x.cs < y.cs; }
int main() {
  cin >> n >> l >> r;
  for (int i = 1; i <= n; i++) cin >> a[i].a;
  for (int i = 1; i <= n; i++) cin >> a[i].p;
  for (int i = 1; i <= n; i++) a[i].cs = i;
  sort(a + 1, a + n + 1, cmp);
  for (int i = 1; i <= n; i++) {
    if (i == 1)
      a[i].b = l - a[i].a;
    else
      a[i].b = max(a[i - 1].b + 1, l - a[i].a);
  }
  for (int i = 1; i <= n; i++) a[i].b += a[i].a;
  sort(a + 1, a + n + 1, cmp2);
  int mx = a[1].b;
  for (int i = 1; i <= n; i++) mx = max(mx, a[i].b);
  if (mx > r) {
    cout << -1 << endl;
    return 0;
  }
  for (int i = 1; i <= n; i++) cout << a[i].b << " ";
}
