#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
pair<int, int> P[N];
int a[N], b[N];
int c[N], d[N];
int main() {
  int n, h;
  scanf("%d%d", &n, &h);
  int pre = 0;
  for (int i = 1; i <= n; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    P[i] = make_pair(x, y);
    a[i] = y - x;
    b[i] = x - pre;
    pre = y;
  }
  d[0] = 0;
  c[0] = 0;
  for (int i = 1; i <= n; i++) c[i] = c[i - 1] + b[i], d[i] = d[i - 1] + a[i];
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    int x = lower_bound(c + 1, c + n + 1, c[i] + h) - c;
    ans = max(ans, d[x - 1] - d[i - 1]);
  }
  printf("%d\n", ans + h);
  return 0;
}
