#include <bits/stdc++.h>
const int N = 100500;
const int INF = 1000000000;
const long long MOD = 1e9 + 7;
const long long p1 = 1987;
using namespace std;
struct cor {
  long long x, y;
} a[int(2e5) + 500];
long long b[int(2e5) + 500];
bool cmp(cor L, cor R) { return L.x < R.x || (L.x == R.x && L.y < R.y); }
int main() {
  ios_base::sync_with_stdio(0);
  int n;
  long long h;
  cin >> n >> h;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i].x >> a[i].y;
  }
  sort(a + 1, a + 1 + n, cmp);
  long long ans = 0;
  long long mx = 0;
  for (int i = 2; i <= n; ++i) {
    b[i] = a[i].x - a[i - 1].y + b[i - 1];
  }
  for (int i = 1; i <= n; ++i) {
    mx = 0;
    int l = i;
    int r = n, p = i;
    while (l <= r) {
      int mid = (l + r) / 2;
      if (b[mid] - b[i] < h)
        l = mid + 1, p = mid;
      else
        r = mid - 1;
    }
    mx = (h - b[p] + b[i]) + a[p].y - a[i].x;
    ans = max(mx, ans);
  }
  cout << ans;
  return 0;
}
