#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
int n, h, l[N], r[N], ans, lmt;
int sum[N];
struct interval {
  int s, t, fall;
};
interval il[N];
bool check(int u) {
  if (sum[u] < lmt) {
    return true;
  }
  return false;
}
int bs(int ll, int rr) {
  if (ll == rr) {
    return ll;
  }
  int mid = (ll + rr + 1) >> 1;
  if (check(mid)) {
    return bs(mid, rr);
  } else {
    return bs(ll, mid - 1);
  }
}
int main() {
  scanf("%d%d", &n, &h);
  for (int i = 1; i <= n; i++) {
    scanf("%d%d", &l[i], &r[i]);
  }
  if (n == 1) {
    printf("%d\n", h + r[1] - l[1]);
    return 0;
  }
  for (int i = 1; i < n; i++) {
    il[i].s = l[i];
    il[i].t = r[i + 1];
    il[i].fall = l[i + 1] - r[i];
    sum[i] = sum[i - 1] + il[i].fall;
  }
  for (int i = 1; i < n; i++) {
    lmt = sum[i - 1] + h;
    int st = bs(1, n - 1);
    ans = max(ans, il[st].t - il[i].s + h - sum[st] + sum[i - 1]);
  }
  printf("%d\n", ans);
  return 0;
}
