#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("-O2")
const int LIM = 5e5 + 5, MOD = 1e9 + 7;
int t, n, m, k, x, y, h;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> h;
  int val[n], s[n], pre = -MOD;
  long long valc[n + 100], prec = 0;
  valc[0] = 0;
  for (int i = 0; i < n; i++) {
    cin >> x >> y;
    val[i] = y - x;
    if (pre != -MOD)
      s[i] = s[i - 1] + x - pre;
    else
      s[i] = x;
    pre = y;
    valc[i + 1] = prec + val[i];
    prec = valc[i + 1];
  }
  long long ans = h;
  for (int i = 0; i < n; i++) {
    auto a = lower_bound(s + i, s + n, s[i] + h) - s;
    a--;
    ans = max(ans, valc[a + 1] - valc[i] + h);
  }
  cout << ans;
  return 0;
}
