#include <bits/stdc++.h>
using namespace std;
int a[100010], c[100010];
struct node {
  int x, i;
} b[100010];
bool cmp(node a, node b) { return a.x < b.x; }
int main() {
  int n, l, r;
  scanf("%d%d%d", &n, &l, &r);
  for (int i = 0; i < n; ++i) scanf("%d", &a[i]);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &b[i].x);
    b[i].i = i;
  }
  sort(b, b + n, cmp);
  int z = l - a[b[0].i];
  c[b[0].i] = l;
  for (int i = 1; i < n; ++i) {
    ++z;
    c[b[i].i] = a[b[i].i] + z;
    if (c[b[i].i] < l) c[b[i].i] = l, z = c[b[i].i] - a[b[i].i];
    if (c[b[i].i] > r) {
      cout << -1 << endl;
      return 0;
    }
  }
  printf("%d", c[0]);
  for (int i = 1; i < n; ++i) printf(" %d", c[i]);
  return 0;
}
