#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, flr, tk, cst;
  cin >> n >> m;
  int cmp = 0;
  for (int i = 0; i < n; i++) {
    cin >> flr >> cst;
    if (cst + flr > cmp) {
      cmp = cst + flr;
    }
  }
  cmp = max(cmp, m);
  cout << cmp << endl;
}
