#include <bits/stdc++.h>
using namespace std;
const int MAX = 2e5 + 5;
long long N, H, x1, x2, s[MAX];
vector<pair<long long, long long> > num;
int main(int argc, char** argv) {
  num.push_back(make_pair(0, 0));
  scanf("%I64d%I64d", &N, &H);
  for (int i = (1); i <= (N); i++) {
    scanf("%I64d%I64d", &x1, &x2);
    s[i] = s[i - 1] + x2 - x1;
    num.push_back(make_pair(x1, x2));
  }
  long long ans = H;
  num.push_back(make_pair(0, 0));
  int i = 1, j = 1;
  while (j <= N) {
    ans = max(ans, H + s[j] - s[i - 1]);
    if (num[j + 1].first - num[i].first - s[j] + s[i - 1] < H)
      j++;
    else
      i++, j = max(i, j);
  }
  printf("%I64d\n", ans);
  return 0;
}
