#include <bits/stdc++.h>
const int N = (5e5) + 322;
const long long mod = (long long)(3e9) + 7;
using namespace std;
long long n, l[N], r[N], h, mx, L = 1, R = 1, cur;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> h;
  for (int i = 1; i <= n; ++i) {
    cin >> l[i] >> r[i];
  }
  l[n + 1] = mod;
  r[n + 1] = mod;
  while (L <= n && R <= n) {
    mx = max(mx, r[R] - l[L] + (h - cur));
    if (l[R + 1] - r[R] + cur < h) {
      cur += (l[R + 1] - r[R]);
      R++;
    } else {
      cur -= (l[L + 1] - r[L]);
      L++;
    }
  }
  cout << mx;
  return 0;
}
