#include <bits/stdc++.h>
template <class First, class Second>
std::ostream& operator<<(std::ostream& out,
                         const std::pair<First, Second>& pair) {
  out << pair.first << ": " << pair.second;
  return out;
}
template <class T>
std::ostream& operator<<(std::ostream& out, const std::vector<T>& vec) {
  out << "(";
  if (!vec.empty()) {
    out << vec.front();
    for (auto i = std::next(vec.begin()); i != vec.end(); ++i) {
      out << ", " << *i;
    }
  }
  out << ")";
  return out;
}
template <class T>
std::ostream& operator<<(std::ostream& out, const std::list<T>& list) {
  out << "(";
  if (!list.empty()) {
    out << list.front();
    for (auto i = std::next(list.begin()); i != list.end(); ++i) {
      out << ", " << *i;
    }
  }
  out << ")";
  return out;
}
template <class T>
std::ostream& operator<<(std::ostream& out, const std::set<T>& set) {
  out << "{";
  if (!set.empty()) {
    out << *set.begin();
    for (auto i = std::next(set.begin()); i != set.end(); ++i) {
      out << ", " << *i;
    }
  }
  out << "}";
  return out;
}
template <class K, class V>
std::ostream& operator<<(std::ostream& out, const std::map<K, V>& map) {
  out << "{";
  if (!map.empty()) {
    out << *map.begin();
    for (auto i = std::next(map.begin()); i != map.end(); ++i) {
      out << ", " << *i;
    }
  }
  out << "}";
  return out;
}
template <class Object>
std::string str(const Object& obj) {
  std::ostringstream out;
  out << obj;
  return out.str();
}
void print() { std::cout << "\n"; }
template <typename T>
void print(T v) {
  std::cout << v;
  print();
}
template <typename T, typename... Args>
void print(T v, Args... args) {
  std::cout << v << " ";
  print(args...);
}
void scan() {}
template <typename T>
void scan(T& v) {
  std::cin >> v;
}
template <class T>
void scan(std::vector<T>& vec) {
  for (T& value : vec) {
    std::cin >> value;
  }
}
template <class T>
void scan(std::list<T>& lst) {
  for (T& value : lst) {
    std::cin >> value;
  }
}
template <class T>
void scan(std::deque<T>& dqe) {
  for (T& value : dqe) {
    std::cin >> value;
  }
}
template <typename T, typename... Args>
void scan(T& v, Args&... args) {
  scan(v);
  scan(args...);
}
template <class T>
void sort(T& cont) {
  std::sort(cont.begin(), cont.end());
}
template <class T>
void unique(T& cont) {
  auto it = unique(cont.begin(), cont.end());
  cont.resize(it - cont.begin());
}
template <class T>
void reverse(T& cont) {
  reverse(cont.begin(), cont.end());
}
template <typename T>
T GCD(T a, T b) {
  while (b != 0) {
    T t = a % b;
    a = b;
    b = t;
  }
  return a;
}
using namespace std;
int main(int argc, char* argv[]) {
  (void)argc;
  (void)argv;
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(nullptr);
  int64_t n, h;
  scan(n, h);
  vector<pair<int64_t, int64_t>> flows(n);
  for (int i = 0; i < n; i++) {
    cin >> flows[i].first >> flows[i].second;
  }
  int64_t y = h;
  auto cur = flows.begin();
  int64_t x = cur->first;
  while (y > 0 && cur != flows.end()) {
    x += cur->second - cur->first;
    ++cur;
    if (cur == flows.end() || cur->first - x >= y) {
      x += y;
      y = 0;
      break;
    }
    int64_t d = cur->first - x;
    y -= d;
    x += d;
  }
  auto head = flows.begin();
  auto tail = cur;
  int64_t ans = x - head->first;
  while (tail != flows.end()) {
    y += next(head)->first - head->second;
    ++head;
    int64_t start = head->first;
    if (tail == flows.end() || tail->first - x >= y) {
      x += y;
      y = 0;
    } else {
      int64_t d = tail->first - x;
      x += d;
      y -= d;
    }
    while (y > 0 && tail != flows.end()) {
      x += tail->second - tail->first;
      ++tail;
      if (tail == flows.end() || tail->first - x >= y) {
        x += y;
        y = 0;
        break;
      }
      int64_t d = tail->first - x;
      y -= d;
      x += d;
    }
    ans = max(ans, x - start);
  }
  cout << ans << "\n";
  return 0;
}
