#include <bits/stdc++.h>
using namespace std;
int diff[200007], sum[200007], x1[200007], x2[200007];
int bS(int x, int n) {
  int mn = 0;
  int mx = n - 1;
  while (mn < mx) {
    int mid = (mn + mx) >> 1;
    if (diff[mid] < x)
      mn = mid + 1;
    else
      mx = mid;
  }
  return mn;
}
int main() {
  int n, h, ans = 0;
  scanf("%d %d", &n, &h);
  for (int i = 1; i <= n; i++) {
    scanf("%d %d", &x1[i], &x2[i]);
    sum[i] = x2[i] - x1[i] + sum[i - 1];
  }
  for (int i = 2; i <= n; i++) {
    diff[i - 1] = x1[i] - x2[i - 1];
    diff[i - 1] += diff[i - 2];
  }
  for (int i = 1; i <= n; i++) {
    int ret = bS(diff[i - 1] - h + 1, n);
    ans = max(ans, sum[i] - sum[ret]);
    ;
  }
  printf("%d\n", ans + h);
  return 0;
}
