#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
const int maxlog = 25;
const int mod = 1e9 + 7;
const int sq = 720;
const int inf = 1e9;
int a[maxn];
vector<pair<int, int> > v;
int ans[maxn];
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cout.precision(20);
  int n, l, r;
  cin >> n >> l >> r;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    v.push_back(make_pair(x, i));
  }
  sort(v.begin(), v.end());
  reverse(v.begin(), v.end());
  int cur = l;
  ans[v[0].second] = r;
  for (int i = 1; i < n; i++) {
    int pl = v[i].second;
    if (v[i].first == v[i - 1].first) {
      int c = ans[v[i - 1].second] - a[v[i - 1].second];
      ans[pl] = a[pl] + c;
      if (ans[pl] < l || ans[pl] > r) {
        cout << -1;
        return 0;
      }
    } else if (v[i].first == v[i - 1].first - 1) {
      int c = ans[v[i - 1].second] - a[v[i - 1].second] - 1;
      ans[pl] = a[pl] + c;
      if (ans[pl] > r) ans[pl] = r;
      if (ans[pl] < l) {
        cout << -1;
        return 0;
      }
    } else {
      cout << -1;
      return 0;
    }
  }
  for (int i = 0; i < n; i++) cout << ans[i] << " ";
  return 0;
}
