#include <bits/stdc++.h>
using namespace std;
const long long N = 200005;
long long n, m, x[N], y[N], ans;
signed main() {
  scanf("%lld%lld", &n, &m);
  for (long long i = 1; i <= n; i++) scanf("%lld%lld", &x[i], &y[i]);
  x[n + 1] = (1e10) + 5;
  long long j = 1, s = 0, v = m;
  for (; j <= n; j++) {
    if (v <= x[j + 1] - y[j]) {
      ans = max(ans, s + v + y[j] - x[j]);
      break;
    }
    v -= (x[j + 1] - y[j]);
    s += x[j + 1] - x[j];
  }
  for (long long i = 2; i <= n; i++) {
    if (j < i) {
      s = 0;
      v = m;
      j = i;
    } else {
      s -= x[i] - x[i - 1];
      v += x[i] - y[i - 1];
    }
    for (; j <= n; j++) {
      if (v <= x[j + 1] - y[j]) {
        ans = max(ans, s + v + y[j] - x[j]);
        break;
      }
      v -= (x[j + 1] - y[j]);
      s += x[j + 1] - x[j];
    }
  }
  printf("%lld", ans);
}
