#include <bits/stdc++.h>
using namespace std;
#define ms(s,n) memset(s,n,sizeof(s))
#define all(a) a.begin(),a.end()
#define present(t, x) (t.find(x) != t.end())
#define sz(a) int((a).size())
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define FORd(i, a, b) for (int i = (a) - 1; i >= (b); --i)
#define pb push_back
#define pf push_front
#define fi first
#define se second
#define mp make_pair
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int,int> pi;
typedef vector<int> vi;
typedef vector<pi> vii;
const int MOD = (int) 1e9+7;
const int INF = (int) 1e9+1;
inline ll gcd(ll a,ll b){ll r;while(b){r=a%b;a=b;b=r;}return a;}
inline ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
int main(){
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
int n; scanf("%d", &n);
pair<int,int> a[n];
for(int i = 0; i < n; i++){
cin >> a[i].first >> a[i].second;
}
//sap xep theo thoi gian den
sort(a, a + n);
int end_time = - 1;
for(int i = 0; i < n; i++){
//neu thoi gian den lam thu tuc cua nguoi hien tai
//lon hon thoi gian ket thuc check in cua nguoi lam truoc do
//thi nguoi hien tai se doi toi dung thoi gian bat dau lam thu tuc cua minh
//nguoc lai thi nguoi nay se bat dau check in tu
//thoi gian ket thuc cua nguoi truoc
end_time = max(end_time, a[i].first);
end_time += a[i].second;
}
cout << end_time << endl;
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgojZGVmaW5lIG1zKHMsbikgbWVtc2V0KHMsbixzaXplb2YocykpCiNkZWZpbmUgYWxsKGEpIGEuYmVnaW4oKSxhLmVuZCgpCiNkZWZpbmUgcHJlc2VudCh0LCB4KSAodC5maW5kKHgpICE9IHQuZW5kKCkpCiNkZWZpbmUgc3ooYSkgaW50KChhKS5zaXplKCkpCiNkZWZpbmUgRk9SKGksIGEsIGIpIGZvciAoaW50IGkgPS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