#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 7;
struct interval {
  int x, y, s;
} a[maxn];
int n, h, ans = 0, l, r, m;
void solve() {
  cin >> n >> h;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i].x >> a[i].y;
    if (i != 1) {
      a[i].s += a[i - 1].s + a[i].x - a[i - 1].y;
    }
  }
  for (int i = 1; i <= n; ++i) {
    l = i, r = n;
    ans = max(ans, a[i].y - a[i].x);
    while (l <= r) {
      m = (l + r) / 2;
      if (a[m].s - a[i].s >= h) {
        r = m - 1;
      } else {
        l = m + 1;
      }
    }
    ans = max(ans, a[r].y + h - a[r].s + a[i].s - a[i].x);
  }
  cout << ans << endl;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  solve();
  return 0;
}
