#include <bits/stdc++.h>
int power(int x, unsigned int y) {
  int res = 1;
  while (y > 0) {
    if (y & 1) {
      res = res * x;
    }
    y = y >> 1;
    x = x * x;
  }
  return res;
}
int powermod(int x, unsigned int y, int p) {
  int res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) {
      res = (res * x) % p;
    }
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
using namespace std;
string convertupper(string s) {
  transform(s.begin(), s.end(), s.begin(), ::toupper);
  return s;
}
string convertlower(string s) {
  transform(s.begin(), s.end(), s.begin(), ::tolower);
  return s;
}
int inf = -1e9;
int findMin(int a, int p, int l, int r) {
  int lo = l, hi = r, ans = -1;
  while (lo <= hi) {
    int mid = (lo + hi) / 2;
    if (mid - a > p) {
      ans = mid;
      hi = mid - 1;
    } else
      lo = mid + 1;
  }
  return ans;
}
void solve() {
  int n, a, b;
  cin >> n >> a >> b;
  vector<int> v1(n);
  vector<pair<int, int> > v2;
  for (int i = 0; i < n; i++) cin >> v1[i];
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    v2.push_back({x, i});
  }
  sort(v2.begin(), v2.end());
  int prevval = inf;
  vector<int> ans(n);
  for (int i = 0; i < n; i++) {
    int x = v1[v2[i].second];
    int idx = findMin(x, prevval, a, b);
    if (idx == -1) {
      cout << "-1";
      return;
    }
    ans[v2[i].second] = idx;
    prevval = idx - x;
  }
  for (auto i : ans) {
    cout << i << ' ';
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  solve();
  return 0;
}
