#include <bits/stdc++.h>
#pragma warning(disable : 4996)
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("-ffloat-store")
using namespace std;
clock_t time_p = clock();
void aryanc403() {
  time_p = clock() - time_p;
  cerr << "Time Taken : " << (float)(time_p) / CLOCKS_PER_SEC << "\n";
}
class CMP {
 public:
  bool operator()(long long int a, long long int b) { return !(a <= b); }
};
void add(map<long long int, long long int> &m, long long int x) {
  map<long long int, long long int>::iterator jt;
  jt = m.find(x);
  if (jt == m.end())
    m.insert(make_pair(x, 1));
  else
    jt->second++;
}
void del(map<long long int, long long int> &m, long long int x) {
  map<long long int, long long int>::iterator jt;
  jt = m.find(x);
  if (jt->second == 1)
    m.erase(jt);
  else
    jt->second--;
}
bool cmp(const pair<long long int, long long int> &a,
         const pair<long long int, long long int> &b) {
  return a.first < b.first || (a.first == b.first && a.second < b.second);
}
const long long int INF = 0xFFFFFFFFFFFFFFFL;
const long long int mod = 1000000007L;
long long int T, n, i, m, j, k, in, cnt, l, r;
vector<pair<long long int, long long int> > a;
vector<long long int>::iterator it;
string s;
int main(void) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  {
    long long int h;
    cin >> n >> h;
    a.clear();
    a.reserve(n);
    for (i = 0; i < (n); ++i) {
      cin >> l >> r;
      a.push_back(make_pair(l, r));
    }
    a.push_back(make_pair(-INF, -INF));
    sort(a.begin(), a.end(), cmp);
    a.push_back(make_pair(INF, INF));
    long long int ans = 0, dis = h;
    long long int j = 2, x = a[0].second;
    for (long long int i = 1; i <= n; ++i) {
      if (x <= a[i].first) {
        dis = h;
        x = a[i].second;
        j = i + 1;
      } else {
        dis = a[i].first - a[i - 1].second;
      }
      while (dis > 0) {
        if (x + dis <= a[j].first) {
          x += dis;
          dis = 0;
          break;
        }
        dis -= a[j].first - x;
        x = a[j].second;
        j++;
      }
      ans = max(ans, x - a[i].first);
    }
    cout << ans << "\n";
  }
  aryanc403();
  return 0;
}
