#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 7;
int n, m, d, a[MAXN], h;
int x1[MAXN], x2[MAXN], s[MAXN];
set<pair<int, int> > st;
int main() {
  scanf("%d%d", &n, &h);
  int sum = 0, pre = 0;
  for (int i = 0; i < n; i++) {
    scanf("%d%d", &x1[i], &x2[i]);
    sum += x1[i] - pre;
    s[i] = sum;
    pre = x2[i];
  }
  int ta;
  int ans = 0;
  for (int i = 0; i < n; i++) {
    ta = lower_bound(s + i, s + n, s[i] + h) - s;
    ta--;
    ans = max(0 + x2[ta] - x1[i] + (h - s[ta] + s[i]), ans);
  }
  printf("%d\n", ans);
  return 0;
}
