#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, l, r;
  cin >> n >> l >> r;
  vector<int> a(n), p(n), b(n);
  for (int &ai : a) cin >> ai;
  for (int &pi : p) cin >> pi;
  priority_queue<pair<int, int>, vector<pair<int, int>>,
                 greater<pair<int, int>>>
      pq;
  for (int i = 0; i < n; i++) pq.push(pair<int, int>(p[i], i));
  bool flag = true;
  int prev;
  bool isFirst = true;
  while (!pq.empty()) {
    pair<int, int> top = pq.top();
    pq.pop();
    if (isFirst) {
      b[top.second] = l;
      prev = l - a[top.second];
      isFirst = false;
    } else {
      int target = prev + 1;
      if (r - a[top.second] >= target) {
        if (l - a[top.second] >= target) {
          b[top.second] = l;
          prev = l - a[top.second];
        } else {
          int req = target + a[top.second];
          if (req <= l) {
            b[top.second] = l;
            prev = l - a[top.second];
          } else {
            b[top.second] = req;
            prev = req - a[top.second];
          }
        }
      } else {
        flag = false;
        break;
      }
    }
  }
  if (flag) {
    for (int bi : b) cout << bi << " ";
    cout << endl;
  } else
    cout << -1 << endl;
}
