#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, s, f, t, k = 0;
  cin >> n >> s;
  for (int i = 1; i <= n; i++) {
    cin >> f >> t;
    if (t + f > k) {
      k = t + f;
    }
  }
  if (k >= s)
    cout << k;
  else
    cout << s;
}
