#include <bits/stdc++.h>
using namespace std;
int n, l, r;
int t[100001][2];
vector<pair<pair<int, int>, int> > rendez;
vector<int> b;
vector<int> c;
int megoldas[100001];
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> l >> r;
  for (int i = 1; i <= n; i++) {
    cin >> t[i][0];
  }
  for (int i = 1; i <= n; i++) {
    cin >> t[i][1];
  }
  for (int i = 1; i <= n; i++) {
    rendez.push_back(make_pair(make_pair(t[i][1], t[i][0]), i));
  }
  sort(rendez.begin(), rendez.end());
  for (auto s : rendez) {
    if (b.size() == 0) {
      b.push_back(l);
      c.push_back(l - s.first.second);
    } else if (c[c.size() - 1] + s.first.second + 1 > r) {
      cout << -1 << endl;
      return 0;
    } else {
      b.push_back(max(l, c[c.size() - 1] + s.first.second + 1));
      c.push_back(b[b.size() - 1] - s.first.second);
    }
  }
  for (int i = 0; i < b.size(); i++) {
    megoldas[rendez[i].second] = b[i];
  }
  for (int i = 1; i <= n; i++) cout << megoldas[i] << " ";
  return 0;
}
