#include <bits/stdc++.h>
using namespace std;
inline int Get() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while ('0' <= ch && ch <= '9') {
    x = (x << 1) + (x << 3) + ch - '0';
    ch = getchar();
  }
  return x * f;
}
int n, h;
long long sum[200005], ans;
struct inter {
  int l, r;
} s[200005];
int main() {
  n = Get(), h = Get();
  int l, r;
  for (int i = 1; i <= n; i++) {
    s[i].l = Get(), s[i].r = Get();
    sum[i] = sum[i - 1] + s[i].r - s[i].l;
  }
  int j = 1;
  for (int i = 1; i <= n; i++) {
    j = max(j, i);
    while (j < n && s[j + 1].l - s[i].l - (sum[j] - sum[i - 1]) < h) j++;
    ans = max(ans, h + sum[j] - sum[i - 1]);
  }
  cout << ans;
  return 0;
}
