#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 1;
int n, x, y, l[N], r[N], a[N], c[N];
pair<int, int> p[N];
int main() {
  cin >> n >> x >> y;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++) cin >> p[i].first, p[i].second = i;
  sort(p, p + n);
  for (int i = 0; i < n; i++) l[i] = x - a[i], r[i] = y - a[i];
  int cur = x, mn = INT_MIN;
  for (int i = 0; i < n; i++) {
    int idx = p[i].second;
    if (mn < l[idx])
      mn = l[idx], cur = mn + a[idx];
    else if (mn > r[idx])
      return cout << "-1" << endl, 0;
    else
      mn = mn + 1, cur = mn + a[idx];
    if (cur > y) return cout << "-1" << endl, 0;
    c[idx] = cur;
  }
  for (int i = 0; i < n; i++) cout << c[i] << " ";
  cout << endl;
}
