#include <bits/stdc++.h>
using namespace std;
const int N = 1e5;
const long long LIM = 1e18;
const int INF = 0x3f3f3f3f;
const int mod = 1e9 + 7;
const double eps = 1e-6;
const double PI = atan(1.0) * 4;
int n, l, r;
int ans[N + 10];
struct Node {
  int a, id, p;
  bool friend operator<(Node x, Node y) { return x.p < y.p; }
} v[N + 10];
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  ;
  cin >> n >> l >> r;
  for (int i = 1; i <= n; i++) cin >> v[i].a;
  for (int i = 1; i <= n; i++) cin >> v[i].p, v[i].id = i;
  sort(v + 1, v + 1 + n);
  int val = -2e9 - 10;
  for (int i = 1; i <= n; i++) {
    int L = l - v[i].a, R = r - v[i].a;
    if (val > R) {
      cout << -1;
      return 0;
    }
    ans[v[i].id] = max(L, val);
    val = ans[v[i].id] + 1;
    ans[v[i].id] += v[i].a;
  }
  for (int i = 1; i <= n; i++) cout << ans[i] << " ";
  return 0;
}
