#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 100, inF = 2e9 + 100;
int n, h, p, ans, l[N], r[N], ps[N];
int main() {
  ios::sync_with_stdio(false), cin.tie(0);
  cin >> n >> h;
  for (int i = 0; i < n; i++) cin >> l[i] >> r[i];
  l[n] = r[n] = inF;
  for (int i = 1; i <= n; i++) ps[i] = ps[i - 1] + l[i] - r[i - 1];
  for (int i = 0; i < n; i++) {
    while (p < n && ps[p + 1] - ps[i] < h) p++;
    ans = max(ans, r[p] + h - (ps[p] - ps[i]) - l[i]);
  }
  cout << ans;
  return 0;
}
