#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18;
int n, h;
pair<int, int> a[200010];
long long s[200010];
int main() {
  scanf("%d%d", &n, &h);
  for (int i = 1; i <= n; i++) scanf("%d%d", &a[i].first, &a[i].second);
  sort(a + 1, a + n + 1);
  for (int i = 1; i < n; i++) s[i] = s[i - 1] + a[i + 1].first - a[i].second;
  s[n] = INF;
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    int k = lower_bound(s + i, s + n + 1, s[i - 1] + h) - s;
    if (s[k] - s[i - 1] >= h) k--;
    ans = max(ans, h - (s[k] - s[i - 1]) + a[k + 1].second - a[i].first);
  }
  printf("%lld\n", ans);
  return 0;
}
