#include <bits/stdc++.h>
using namespace std;
const int N = 200005;
long long l[N], r[N];
int main() {
  int n, h;
  while (scanf("%d%d", &n, &h) != EOF) {
    for (int i = 0; i < n; i++) {
      scanf("%lld%lld", &l[i], &r[i]);
    }
    long long ans = 0, sum = 0, j = 0;
    for (int i = 0; i < n; i++) {
      while (j < n - 1 && sum + l[j + 1] - r[j] < h) {
        sum += l[j + 1] - r[j];
        j++;
      }
      ans = max(ans, r[j] - l[i] + h - sum);
      sum -= l[i + 1] - r[i];
    }
    printf("%lld\n", ans);
  }
}
