#include <bits/stdc++.h>
int main() {
  int n, h;
  scanf("%d %d", &n, &h);
  long long int ar[n], arr[n];
  arr[n - 1] = 1000000000;
  int x1;
  scanf("%d", &x1);
  for (int i = 0; i < n - 1; i++) {
    int x2, x3;
    scanf("%d %d", &x2, &x3);
    ar[i] = x2 - x1;
    arr[i] = x3 - x2;
    x1 = x3;
  }
  scanf("%lld", &ar[n - 1]);
  ar[n - 1] -= x1;
  long long int max = 0, check = 0, check2 = 0;
  for (int j = 0, i = 0; i < n && j < n; j++) {
    for (; i < n; i++) {
      check += arr[i];
      check2 += ar[i];
      if (check >= h) break;
    }
    max = (check2 + h) > max ? (check2 + h) : max;
    for (; j < n; j++) {
      check2 -= ar[j];
      check -= arr[j];
      if (check < h) break;
    }
    i++;
  }
  printf("%lld\n", max);
  return 0;
}
