#include <bits/stdc++.h>
using namespace std;
int n, h, i, j, sum, ans = 0, diff[200010];
pair<int, int> p[200010];
deque<pair<int, int> > q;
int main() {
  scanf("%d%d", &n, &h);
  for (i = 1; i <= n; i++) {
    scanf("%d%d", &p[i].first, &p[i].second);
    diff[i - 1] = p[i].first - p[i - 1].second;
  }
  for (i = j = 1; i <= n; i++) {
    for (; j < n && (sum + diff[j] < h); j++) sum += diff[j];
    ans = max(ans, p[j].second - p[i].first + h - sum);
    sum -= diff[i];
  }
  printf("%d\n", ans);
}
