#include <bits/stdc++.h>
using namespace std;
const int N = 200010;
long long n, h;
long long a[N], b[N];
vector<pair<long long, long long> > v;
int hh(int ind) {
  if (ind == 0) {
    if (a[ind] >= h) return ind;
  } else {
    if (a[ind] - a[ind - 1] >= h) return ind;
  }
  int i = ind, j = n - 1;
  while (i < j) {
    int m = (i + j) / 2;
    if (ind == 0) {
      if (a[m] >= h)
        j = m;
      else
        i = m + 1;
    } else {
      if (a[m] - a[ind - 1] >= h)
        j = m;
      else
        i = m + 1;
    }
  }
  return j;
}
int main() {
  cin >> n >> h;
  long long x, y;
  for (int i = 1; i <= n; i++) {
    cin >> x >> y;
    v.push_back({x, y});
  }
  sort(v.begin(), v.end());
  for (int i = 0; i <= n - 1; i++) {
    if (i == n - 1)
      a[i] = 1000000007 - 7 - v[i].second;
    else
      a[i] = v[i + 1].first - v[i].second;
    if (i != 0) a[i] += a[i - 1];
    b[i] = v[i].second - v[i].first;
    if (i != 0) b[i] += b[i - 1];
  }
  long long ans = h;
  for (int i = 0; i < n; i++) {
    ans = max(ans, h + v[i].second - v[i].first);
    int j = hh(i);
    if (j == i) continue;
    if (i == 0)
      ans = max(ans, h + b[j]);
    else
      ans = max(ans, h + b[j] - b[i - 1]);
  }
  cout << ans;
  return 0;
}
