#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, s;
  scanf("%d %d", &n, &s);
  pair<int, int> P[105];
  int i, maxi = -1, max = 0;
  for (i = 0; i < n; ++i) {
    scanf("%d %d", &P[i].first, &P[i].second);
    if (P[i].second + P[i].first > max) {
      max = P[i].second + P[i].first;
      maxi = i;
    }
  }
  if (max < s) max = s;
  printf("%d", max);
  return 0;
}
