#include <bits/stdc++.h>
using namespace std;
bool mul(long long int first, long long int second, long long int &c) {
  c = first * second;
  if (first == 0 || second == 0) return false;
  return true;
}
bool div(long long int first, long long int second, long long int &c) {
  if (second == 0) return false;
  c = first / second;
  return true;
}
struct tup {
  int w;
  int v;
  int i;
  tup(int weight, int value, int index) {
    w = weight;
    v = value;
    i = index;
  }
};
template <class t, class u>
void chmax(t &first, u second) {
  if (first < second) first = second;
}
template <class t, class u>
void chmin(t &first, u second) {
  if (second < first) first = second;
}
bool lesser(tup &left, tup &right) { return left.w > right.w; }
int main() {
  int n, l, r;
  scanf("%d", &n);
  scanf("%d", &l);
  scanf("%d", &r);
  vector<int> first(n), c(n), second(n);
  for (int rep = 0; rep < n; ++rep) scanf("%d", &first[rep]);
  for (int rep = 0; rep < n; ++rep) scanf("%d", &c[rep]);
  vector<tup> p;
  for (int rep = 0; rep < n; ++rep)
    p.emplace_back(tup(c[rep], first[rep], rep));
  sort(p.begin(), p.end(), lesser);
  int d = r - p[0].v - 1;
  second[p[0].i] = r;
  for (int rep = 1; rep < n; ++rep) {
    second[p[rep].i] = min(r, p[rep].v + d);
    d = second[p[rep].i] - p[rep].v - 1;
  }
  bool ok = true;
  for (int rep = 0; rep < n && ok; ++rep) {
    assert(second[rep] <= r);
    if (second[rep] < l) ok = false;
  }
  if (!ok)
    printf("-1");
  else
    for (int rep = 0; rep < n; ++rep) printf("%d ", second[rep]);
  return !printf("\n");
}
