#include <bits/stdc++.h>
using namespace std;
struct A {
  long long l, r;
};
A arr[200005];
long long qs[200005];
int main() {
  long long n, h, ans = -1, l, r, mid;
  scanf("%lld %lld", &n, &h);
  for (long long i = 1; i <= n; i++) {
    scanf("%lld %lld", &arr[i].l, &arr[i].r);
    qs[i] = arr[i].l - arr[i - 1].r;
    qs[i] += qs[i - 1];
  }
  for (long long i = 1; i <= n; i++) {
    l = i, r = n;
    while (l < r) {
      long long mid = (l + r + 1) / 2;
      if (qs[mid] - qs[i] >= h) {
        r = mid - 1;
      } else {
        l = mid;
      }
    }
    ans = max(ans, (arr[l].r - arr[i].l) + (h - (qs[l] - qs[i])));
  }
  printf("%lld\n", ans);
  return 0;
}
