#include <bits/stdc++.h>
using namespace std;
int n;
long long h;
struct seg {
  long long l;
  long long r;
  long long len;
  long long nex;
} a[200100];
long long sum[200100];
long long suml[200100];
long long work(int x) {
  int pos = lower_bound(sum + 1, sum + 1 + n, sum[x - 1] + h) - sum;
  if (pos > n) pos = n;
  long long tmp = sum[pos] - sum[x - 1];
  if (tmp == h) {
    return suml[pos] - suml[x - 1] + h;
  } else if (tmp > h) {
    return suml[pos] - suml[x - 1] + h;
  }
}
int main() {
  scanf("%d %I64d", &n, &h);
  for (int i = 1; i <= n; i++) {
    scanf("%I64d %I64d", &a[i].l, &a[i].r);
    a[i].len = a[i].r - a[i].l;
  }
  for (int i = 2; i <= n; i++) {
    a[i - 1].nex = a[i].l - a[i - 1].r;
  }
  a[n].nex = 0x7fffffff;
  for (int i = 1; i <= n; i++) {
    sum[i] = sum[i - 1] + a[i].nex;
    suml[i] = suml[i - 1] + a[i].len;
  }
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    ans = max(ans, work(i));
  }
  printf("%I64d\n", ans);
}
