#include <bits/stdc++.h>
using namespace std;
void inout() {}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  inout();
  long long int n, h, l, sum = 0;
  cin >> n >> h;
  vector<pair<long long int, long long int>> a(n);
  for (auto &i : a) cin >> i.first >> i.second;
  long long int ans = 0;
  long long int r = 0;
  for (l = 0; l < n; l++) {
    while (r < n - 1 && sum < h) {
      if ((sum + a[r + 1].first - a[r].second) < h) {
        sum += a[r + 1].first - a[r].second;
        r++;
      } else
        break;
    }
    ans = max(ans, (a[r].second - a[l].first) + (h - sum));
    sum -= (a[l + 1].first - a[l].second);
  }
  cout << ans << endl;
  return 0;
}
