#include <bits/stdc++.h>
using namespace std;
long long int max(long long int a, long long int b) {
  if (a > b) return a;
  return b;
}
int main() {
  long long int n, h;
  cin >> n >> h;
  int i;
  vector<pair<int, int> > v;
  for (i = 0; i < n; i++) {
    int x, y;
    cin >> x >> y;
    v.push_back(make_pair(x, y));
  }
  sort(v.begin(), v.end());
  vector<long long int> hor;
  vector<long long int> diff;
  hor.push_back(v[0].second - v[0].first);
  diff.push_back(0);
  for (i = 1; i < n; i++) {
    hor.push_back(v[i].second - v[i].first + hor[i - 1]);
    diff.push_back(v[i].first - v[i - 1].second + diff[i - 1]);
  }
  long long int ma = h;
  for (i = 0; i < n; i++) {
    long long int ans;
    vector<long long int>::iterator it =
        lower_bound(diff.begin(), diff.end(), h + diff[i]);
    --it;
    ans = h + diff[i] - *(it) + v[it - diff.begin()].second - v[i].first;
    ma = max(ma, ans);
  }
  cout << ma << endl;
  return 0;
}
