#include <bits/stdc++.h>
using namespace std;
long long int sum[2 * 100100], sum_jian[2 * 100100];
int main() {
  int n, h, l, r, pre_r;
  scanf("%d %d", &n, &h);
  for (int i = 1; i <= n; i++) {
    scanf("%d %d", &l, &r);
    sum[i] = sum[i - 1] + r - l;
    if (i > 1) sum_jian[i - 1] = sum_jian[i - 2] + l - pre_r;
    pre_r = r;
  }
  long long int ans = 0, maxx = 0;
  for (int i = 1; i <= n; i++) {
    l = 0;
    r = n - 1;
    int mid;
    while (l < r) {
      mid = l + (r - l + 1) / 2;
      if (sum_jian[mid] - sum_jian[i - 1] < h)
        l = mid;
      else
        r = mid - 1;
    }
    ans = sum[l + 1] - sum[i - 1] + h;
    if (maxx < ans) maxx = ans;
  }
  printf("%I64d\n", maxx);
  return 0;
}
