#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5;
long long my_solution(vector<long long> l, vector<long long> t, long long r,
                      long long n) {
  long long ans = 0, may = 0;
  for (long long i = 0; i < n; ++i) {
    if (may * 2 >= l[i]) {
      may -= l[i] / 2;
      continue;
    }
    l[i] -= may * 2;
    t[i] -= may;
    long long lb = 0, rb = l[i] + 1;
    while (rb - lb > 1) {
      long long m = (lb + rb) >> 1;
      if ((l[i] - m + 1) / 2 + m > t[i])
        rb = m;
      else
        lb = m;
    }
    l[i] -= lb;
    t[i] -= lb;
    long long cnt = (l[i] + 2 * r - 1) / (2 * r);
    ans += cnt;
    may = cnt * r - l[i] / 2;
  }
  return ans;
}
vector<long long> create(vector<long long> l, vector<long long> t, long long r,
                         long long n) {
  long long tans = 0, may = 0;
  vector<long long> tim;
  for (long long i = 0; i < n; ++i) {
    if (may * 2 >= l[i]) {
      may -= l[i] / 2;
      continue;
    }
    l[i] -= may * 2;
    t[i] -= may;
    long long lb = 0, rb = l[i] + 1;
    while (rb - lb > 1) {
      long long m = (lb + rb) >> 1;
      if ((l[i] - m + 1) / 2 + m > t[i])
        rb = m;
      else
        lb = m;
    }
    tans += lb;
    l[i] -= lb;
    t[i] -= lb;
    long long cnt = (l[i] + 2 * r - 1) / (2 * r);
    may = cnt * r - l[i] / 2;
    for (long long j = 0; j < cnt; ++j) {
      tim.push_back(tans);
      tans += r;
    }
  }
  return tim;
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n;
  long long r;
  vector<long long> l, t;
  cin >> n >> r;
  l.resize(n), t.resize(n);
  for (long long i = 0; i < n; ++i) cin >> l[i];
  for (long long i = 0; i < n; ++i) cin >> t[i];
  for (long long i = 0; i < n; ++i)
    if (l[i] > t[i]) {
      cout << "-1\n";
      return 0;
    }
  vector<long long> lll(n), ttt(n);
  for (long long i = 0; i < n; ++i) {
    l[i] *= 2;
    lll[i] = l[i];
    ttt[i] = t[i];
  }
  long long ans = my_solution(lll, ttt, r, n);
  cout << ans << '\n';
  if (ans <= N) {
    vector<long long> tim = create(lll, ttt, r, n);
    for (long long v : tim) cout << v << ' ';
  }
}
