#include <bits/stdc++.h>
using namespace std;
struct S {
  int x1, x2;
} a[200010];
bool cmp(S a, S b) { return a.x1 < b.x1; }
int c[200010] = {0};
int main() {
  int n, h, i, ans = 0;
  cin >> n >> h;
  for (i = 0; i < n; i++) cin >> a[i].x1 >> a[i].x2;
  sort(a, a + n, cmp);
  for (i = 1; i < n; i++) c[i] = a[i].x1 - a[i - 1].x2;
  for (i = 2; i < n; i++) c[i] = c[i] + c[i - 1];
  for (i = 1; i <= n; i++) {
    int pos = lower_bound(c + 1, c + n, h + c[i - 1]) - c;
    if (pos == n) {
      ans = max(ans, a[n - 1].x2 - a[i - 1].x1 + h + c[i - 1] - c[n - 1]);
    } else {
      ans = max(ans, a[pos].x1 - a[i - 1].x1 - (c[pos] - h - c[i - 1]));
    }
  }
  cout << ans << endl;
}
