#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 9;
int x[N], y[N], s[N];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, h, i, ans = 0, j;
  cin >> n >> h;
  for (i = 0; i < n; i++) cin >> x[i] >> y[i];
  for (i = 1; i < n; i++) s[i] = s[i - 1] + x[i] - y[i - 1];
  for (i = 0; i < n; i++) {
    j = lower_bound(s + i, s + n, h + s[i]) - s;
    j--;
    ans = max(ans, h - s[j] + s[i] + y[j] - x[i]);
  }
  cout << ans << endl;
  return 0;
}
