#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
const int inf = 2e9 + 2;
const int mod = 1e6 + 3;
const double eps = 1e-7;
int n, l, r, x, no, ls;
int a[N], b[N], p[N];
int main() {
  scanf("%d", &n), scanf("%d", &l), scanf("%d", &r);
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
  for (int i = 1; i <= n; ++i) scanf("%d", &x), p[x] = i;
  ls = -inf;
  for (int i = 1; i <= n; ++i) {
    x = p[i];
    no = max(l, ls + a[x] + 1);
    if (no > r) return puts("-1"), 0;
    b[x] = no;
    ls = no - a[x];
  }
  for (int i = 1; i <= n; ++i) cout << b[i] << " ";
  return 0;
}
