Problem:
 Score : 200 points    Problem Statement A group of people played a game. All players had distinct scores, which are positive integers.  Takahashi knows N facts on the players' scores. The i -th fact is as follows: the A_i -th highest score among the players is B_i .  Find the maximum possible number of players in the game.      Constraints  1 \leq N \leq 10^5  1 \leq A_i \leq 10^9(1\leq i\leq N)  0 \leq B_i \leq 10^9(1\leq i\leq N)  If i ≠ j , A_i ≠ A_j .  There exists a possible outcome of the game that are consistent with the facts.  All input values are integers.         Inputs Input is given from Standard Input in the following format:  N  A_1  B_1 : A_N  B_N       Outputs Print the maximum possible number of players in the game.        Sample Input 1 3
4 7
2 9
6 2      Sample Output 1 8  The maximum possible number of players is achieved when, for example, the players have the following scores: 12,9,8,7,5,2,1,0 .       Sample Input 2 5
1 10
3 6
5 2
4 4
2 8      Sample Output 2 7       Sample Input 3 2
1 1000000000
1000000000 1      Sample Output 3 1000000001

Solution (Python):
n=int(input())
mx=0
ans=0

for i in range(n):
  a,b=map(int,input().split())
  if a>mx:
    mx=a
    ans=a+b
print(ans)

Solution (Python):
n = int(input())
ab = [list(map(int, input().split())) for i in range(n)]
ab.sort(reverse=True)
print(ab[0][0]+ab[0][1])

Solution (Python):
N = int(input())
AB = [list(map(int, input().split())) for i in range(N)]

AB.sort(key=lambda x: x[0])
l, r = AB[-1]

print(l + r)

Solution (Python):
n = int(input())
l = []
d = {}
for _ in range(n):
    n,m = map(int,input().split())
    d[n] = m
    l.append(n)

print (max(l)+d[max(l)])

Solution (Python):
N = int(input())
ans = [-1, -1]
for i in range(N):
  A, B = map(int, input().split())
  if A > ans[0]:
    ans[0] = A
    ans[1] = A + B
print(ans[1])

Solution (Python):
n = int(input())
rank = []
point = []
for _ in range(n):
    a,b = map(int,input().split())
    rank.append(a)
    point.append(b)
print (max(rank) + point[rank.index(max(rank))])

Solution (Python):
n = int(input())
rank = []
point = []
for _ in range(n):
    a,b = map(int,input().split())
    rank.append(a)
    point.append(b)
r = rank.index(max(rank))
print (max(rank) + point[r])

Solution (Python):
n=int(input())
l=[list(map(int,input().split())) for _ in range(n)]
a,b=max(l)
print(a+b)

Solution (Python):
N = int(input())
ans = 0
cur = 0
for _ in range(N):
    a, b = map(int, input().split())
    if a > cur:
        ans = a + b
        cur = a
print(ans)

Solution (Python):
n = int(input())
li = []
for _ in range(n):
  a, b = map(int, input().split())
  li.append((b, a))

li = sorted(li)
ans = li[0][1] + li[0][0]
print(ans)

Solution (Python):
n = int(input())
a,b=map(int,input().split())
for i in range(n-1):
    c,d=map(int,input().split())
    a=max(a,c)
    if a==c:
        b=d
print(a+b)

Solution (Python):
n = int(input())
a,b=map(int,input().split())
for i in range(n-1):
    c,d=map(int,input().split())
    a=max(a,c)
    if a==c:
        b=d
print(a+b)

Solution (Python):
N = int(input())
MAXA = 0
MAXB = 0
for TN in range(0,N):
    A,B = (int(T) for T in input().split())
    if A>MAXA:
        MAXA = A
        MAXB = B
print(MAXA+MAXB)

Solution (Python):
n = int(input())
max_ = 0
index_ = 0
for _ in range(n):
    a, b = map(int, input().split())
    if a > index_:
        index_ = a
        max_ = b
print(index_ + max_)

Solution (Python):
N = int(input())
MAXA = 0
MAXB = 0
for TN in range(0,N):
    A,B = (int(T) for T in input().split())
    if A>MAXA:
        MAXA = A
        MAXB = B
print(MAXA+MAXB)

Solution (Python):
n=int(input())
ans=10**100
for i in range(n):
  t=sum(list(map(int,input().split())))
  ans=min(ans,t)
print(ans)

Solution (Python):
n = int(input())
a = [0] * n
b = [0] * n

for i in range(n):
    a[i], b[i] = map(int, input().split())

min_val = b[a.index(max(a))]
print(max(a) + min_val)

Solution (Python):


n = int(input())
a = [0 for _ in range(n)]
b = [0 for _ in range(n)]
for i in range(n):
    a[i], b[i] = map(int, input().split())

ma = ima = 0 
for i in range(n):
    if a[i] >= ma: 
        ma = a[i]
        ima = i 

ans = a[ima]+b[ima]
print(ans)

Solution (Python):
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil,pi,factorial
    from operator import itemgetter
    def I(): return int(input())
    def MI(): return map(int, input().split())
    def LI(): return list(map(int, input().split()))
    def LI2(): return [int(input()) for i in range(n)]
    def MXI(): return [[LI()]for i in range(n)]
    def SI(): return input().rstrip()
    def printns(x): print('\n'.join(x))
    def printni(x): print('\n'.join(list(map(str,x))))
    inf = 10**17
    mod = 10**9 + 7

    n=I()
    lis=[LI() for i in range(n)]
    lis.sort(key=lambda x:x[1])
    print(lis[0][1]+lis[0][0])
    

        
        
        
        
    
if __name__=="__main__":
    main()

Solution (Python):
n=int(input())
k=0
j=0
for i in range(n):
    a,b=map(int,input().split())
    if k<a:
        k=a;j=b
print(k+j)

Solution (Python):
_,*A=map(int,open(0).read().split());print(min(A[1::2])+max(A[::2]))

Solution (Python):
import sys
input = sys.stdin.buffer.readline

n = int(input())
ab = [list(map(int, input().split())) for i in range(n)]
ab = sorted(ab, key=lambda x:x[0])
print(ab[-1][0] + ab[-1][1])

Solution (Python):
import sys
input = sys.stdin.buffer.readline

n = int(input())
ab = [list(map(int, input().split())) for i in range(n)]
ab = sorted(ab, key=lambda x:x[0])
print(ab[-1][0] + ab[-1][1])

Solution (Python):
n = int(input())
ab = [list(map(int, input().split())) for i in range(n)]
ab = sorted(ab, key=lambda x:x[0])
print(ab[-1][0] + ab[-1][1])

Solution (Python):
N = int(input())
ab = {}
for _ in range(N):
    a, b = map(int, input().split())
    ab[a] = b
    
print(max(ab)+ab[max(ab)])

Solution (Python):
n = int(input())
m = 0
for _ in range(n):
    a,b = map(int, input().split())
    if m < a:
        m = a
        num = b
print(m+len(range(num)))

Solution (Python):
n = int(input())
ab = [list(map(int, input().split())) for i in range(n)]
ab.sort()
print(ab[-1][0]+ab[-1][1])

Solution (Python):
def main():
    n = int(input())
    lowest_rank = 0
    lowest_score = 10 ** 9 + 1

    for _ in range(n):
        a, b = map(int, input().split())
        if lowest_rank < a:
            lowest_rank = a
            lowest_score = b

    print(lowest_rank + lowest_score)


if __name__ == "__main__":
    main()

Solution (Python):
N=int(input())
A,B=0,0
for _ in range(N):
    a,b=map(int,input().split())
    if a>A:
        A=a
        B=b
print(A+B)

Solution (Python):
N=int(input())
AB = [tuple(map(int,input().split())) for _ in range(N)]

a,b = max(AB)

print(a+b)

Solution (Python):
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    N = int(readline())

    b_min = INF
    a_min = 0
    for _ in range(N):
        A, B = map(int, readline().split())
        if B < b_min:
            b_min = B
            a_min = A

    print(a_min + b_min)


if __name__ == '__main__':
    main()

Solution (Python):
import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
n = I()
max_a = x =  0
for i in range(n):
    a, b = M()
    if max_a < a:
        max_a = a
        x = b
ans = max_a + x
print(ans)

Solution (Python):

N = int(input())
A, B = [], []
for _ in range(N):
    tmp = input().split()
    A.append(int(tmp[0]))
    B.append(int(tmp[1]))

idx = A.index(max(A))

print(A[idx] + B[idx])

Solution (Python):
n = int(input())
num = 0
ans = 0
for i in range(n):
    a,b = map(int,input().split())
    if a >= num:
        num = a
        ans = b
print(num+ans)

Solution (Python):
N=int(input())
A=[0]*N
B=[0]*N
for i in range(N) :
  A[i],B[i]=map(int,input().split())
print(max(A)+min(B))

Solution (Python):
N = int(input())
x = 0
ans = 0
for _ in range(N):
    A, B = map(int, input().split())
    if A > x:
        x = A
        ans = B
print(x+ans)

Solution (Python):
n=int(input())
ab=[list(map(int, input().split())) for _ in range(n)]
for i in range(n):
    ab[i][1]*=-1
ab.sort()

ans=0

for i in range(n-1):
    ans+=min(ab[i+1][0]-ab[i][0],ab[i+1][1]-ab[i][1])
print(ans+ab[0][0]-ab[-1][1])

Solution (Python):
n = int(input())

x,y=-1,0
for i in range(n):
    a,b = map(int,input().split())
    if a>x:
        x=a
        y=b

print(x+y)

Solution (Python):
n = int(input())
a, b = sorted([tuple(map(int, input().split())) for _ in range(n)])[::-1][0]
print(a + b)

Solution (Python):
n = int(input())
ab = [tuple(map(int, input().split())) for _ in range(n)]

ab.sort()
ans = ab[0][0] + ab[-1][1] + (ab[-1][0] - ab[0][0])
print(ans)

Solution (Python):
import sys
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int,sys.stdin.readline().rstrip().split())


N = I()
X = [tuple(MI()) for _ in range(N)]
X.sort()
print(sum(X[-1]))

Solution (Python):
n = int(input())
ab = [tuple(map(int, input().split())) for _ in range(n)]

ab.sort()
ans = ab[0][0] + ab[n - 1][1] + (ab[n - 1][0] - ab[0][0])
print(ans)

Solution (Python):
N=int(input())
ab = [tuple(map(int, input().split())) for _ in range(N)]
ab.sort(key=lambda x: x[0])
ans = ab[-1][0] + ab[-1][1]
print(ans)

Solution (Python):
N = int(input())
L = [list(map(int, input().split())) for _ in range(N)]

x = min([j for i,j in L])

for i,j in L:
    if j == x:
        print(i+j)
        break

Solution (Python):
def main():
    N = int(input())
    A =[]
    B =[]
    for i in range(N):
        a,b = map(int,input().split())
        A.append(a)
        B.append(b)
    A.sort()
    B.sort(reverse = True)
    
    
    ans = 0
    ans += len(A)
    for i in range(len(A)-1):
        ans += A[i+1] - A[i] - 1
    
    ans += B[len(A)-1]
    
    tmp = A[0]-1
    
        
    
    ans += tmp

    return ans

print(main())

Solution (Python):
n=int(input())
m=0
ans=0
for i in range(n):
    a,b=map(int,input().split())
    if a>m:
        m=a
        ans=a+b
print(ans)

Solution (Python):
n = int(input())
abl = [tuple(map(int, input().split())) for _ in range(n)]
abl.sort()

a_max = abl[-1][0]
b_min = abl[-1][1]
ans = a_max + b_min
print(ans)

Solution (Python):
n = int(input())
a = []
b = []
for i in range(n):
    s,t = map(int,input().split())
    a.append(s)
    b.append(t)
print(max(a)+min(b))

Solution (Python):
def LI():
    return list(map(int, input().split()))


N = int(input())
ansA = 0
ansB = 0

for _ in range(N):
    A, B = LI()
    if ansA > A:
        continue
    ansA = A
    ansB = B
print(ansA+ansB)

Solution (Python):
N = int(input())

member = {}
min_score = 10**9
for i in range(N):
    a, b = [int(x) for x in input().split()]
    member[b] = a

    if min_score > b:
        min_score = b

last = member[min_score]
print(last + min_score)

Solution (Python):
n = int(input())

ab = []
for _ in range(n):
    a, b = map(int, input().split())
    ab.append((b, a))
    
ab.sort()

print(ab[0][0] + ab[0][1])

Solution (Python):
from sys import stdin, setrecursionlimit
from collections import Counter, deque, defaultdict
from math import floor, ceil
from bisect import bisect_left
from itertools import combinations
setrecursionlimit(100000)

INF = int(1e10)
MOD = int(1e9 + 7)

def main():
    from builtins import int, map
    N = int(input())
    AB = []
    for _ in range(N):
        ai, bi = map(int, input().split())
        AB.append((ai, bi))
    AB = sorted(AB, key=lambda x: x[0])
    ans = AB[0][0] - 1
    for i in range(N - 1):
        diff = AB[i + 1][0] - AB[i][0]
        ans += diff
    ans += AB[-1][1] + 1
    print(ans)    

if __name__ == '__main__':
    main()

Solution (Python):
n=int(input())
am,bm=0,10**9
for i in range(n):
    a,b=map(int,input().split())
    am=max(am,a)
    bm=min(bm,b)
print(am+bm)

Solution (Python):
N = int(input())

AB = [list(map(int,input().split())) for _ in range(N)]

AB.sort(reverse=True)

print(sum(AB[0]))

Solution (Python):
N = int(input())
A = sorted([list(map(int,input().split())) for _ in range(N)],key=lambda x:x[0])
a,b = A[-1]
print(a+b)

Solution (Python):
import sys

sys.setrecursionlimit(10**7)
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))  
def LI2(): return list(map(int,sys.stdin.readline().rstrip()))  
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())  
def LS2(): return list(sys.stdin.readline().rstrip())  


N = I()
X = [tuple(MI()) for _ in range(N)]
X.sort()
print(sum(X[-1]))

Solution (Python):
N = int(input())
bmin = 10000000000
ans = 0
for i in range(N):
    a,b = map(int,input().split())
    if b < bmin:
        bmin = b
        ans = a + bmin
print(ans)

Solution (Python):
N = int(input())
ABs = [tuple(map(int, input().split())) for _ in range(N)]

A, B = min(ABs, key=lambda t: t[1])
print(A + B)

Solution (Python):
N = int(input()); INF = float("inf")
A = INF
for i in range(N):
  a,b = map(int,input().split())
  A = min(A,(a+b))
print(A)

Solution (Python):
N = int(input())
AB = [tuple(map(int,input().split())) for i in range(N)]
a,b = max(AB)
print(a+b)

Solution (Python):
N = int(input())
mini1 = 0
mini2 = 0
for i in range(N):
  MM = input().split()
  a = int(MM[0])
  b = int(MM[1])
  if a > mini1:
    mini1 = a
    mini2 = b
    
print(mini1 + mini2)

Solution (Python):
n=int(input())
t=0
ans=0
for i in range(n):
    a,b=map(int,input().split())
    if t<a:
        ans=a+b
        t=a
print(ans)

Solution (Python):
n = int(input())
a = [0]*n
for i in range(n):
    a[i] = list(map(int,input().split()))
a.sort(key= lambda val : val[0],reverse=True)
print(a[0][0] + a[0][1])

Solution (Python):
N = int(input())
info = []
for i in range(N):
    b, a = map(int, input().split())
    info.append((a, b))

info.sort()


ans = sum(info[0])
print(ans)

Solution (Python):
import sys, math
from collections import deque

def input():
    return sys.stdin.readline()[:-1]

def mi():
    return map(int, input().split())

def ii():
    return int(input())

def i2(n):
    tmp = [list(mi()) for i in range(n)]
    return [list(i) for i in zip(*tmp)]

def main():
    N = ii()
    A, B = i2(N)
    print(min(B)+max(A))
        

if __name__ == '__main__':
    main()

Solution (Python):
N=int(input())
AB=[]
for i in range(N):
    AB.append(list(map(int,input().split())))
a=AB[0][1]
b=0
for i in range(1,N):
    if AB[i][1]<a:
        a=AB[i][1]
        b=i
print(a+AB[b][0])

Solution (Python):
n = int(input())
l = [list(map(int, input().split())) for i in range(n)]
l.sort(key=lambda x: x[0])
print(l[-1][0] + l[-1][1])

Solution (Python):
'''
Created on 2020/08/20

@author: harurun
'''
def main():
  import sys
  pin=sys.stdin.readline
  pout=sys.stdout.write
  perr=sys.stderr.write
  
  N=int(pin())
  ans=0
  pre=0
  for _ in [0]*N:
    A,B=map(int,pin().split())
    if ans<A:
      ans=A 
      pre=B 
  print(ans+pre)
  return 

main()

Solution (Python):
n = int(input())
a, b = [0] * n, [0] * n
for i in range(n):
  a[i], b[i] = map(int, input().split())
x = a.index(max(a))
print(a[x] + b[x])

Solution (Python):
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
from functools import reduce

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rf = lambda: map(float, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

n = ri()
min_ = inf
for _ in range(n):
    min_ = min(min_, sum(rm()))
print(min_)

Solution (Python):
mod = 1000000007
eps = 10**-9


def main():
    import sys
    input = sys.stdin.readline

    N = int(input())
    AB = []
    for _ in range(N):
        a, b = map(int, input().split())
        AB.append((a, b))
    AB.sort(key=lambda x: x[0])
    print(AB[-1][0] + AB[-1][1])


if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
minv = 1e9+1
min_idx = -1
for i in range(n):
    a, b = map(int, input().split(' '))
    if b < minv:
        minv = b
        min_idx = a
print(min_idx+minv)

Solution (Python):
import sys

read = sys.stdin.read
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7


def main():
    N = int(readline())
    AB = list(list(map(int, readline().split())) for _ in range(N))
    ans = max(AB)[0] + max(AB)[1]
    print(ans)

if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
a = []
b = []
for i in range(n):
    ai, bi = map(int, input().split())
    a.append(ai)
    b.append(bi)

i = a.index(max(a))
print(max(a)+b[i])

Solution (Python):
n = int(input())
ab = []
for i in range(n):
    ab.append(list(map(int, input().split())))
ab.sort()
print(ab[-1][0] + ab[-1][1])

Solution (Python):
n = int(input())
L = []
for i in range(n):
    a,b = map(int,input().split())
    L.append((a,b))
L.sort()

max_zyun = L[0][0]
min_score = L[-1][1]

cnt = n + max_zyun-1 + min_score

for i in range(n-1):
    cnt +=(min(L[i+1][0] - L[i][0] -1,L[i][1] - L[i+1][1]-1))

print(cnt)

Solution (Python):
n=int(input())
a,b=10**9,10**9
for i in range(n):
    at,bt=map(int,input().split())
    if bt<=b:
        a,b=at,bt
print(a+b)

Solution (Python):
n=int(input())
a,b=10**9,10**9
for i in range(n):
    at,bt=map(int,input().split())
    if bt<=b:
        a,b=at,bt
print(a+b)

Solution (Python):


N = int(input())
I = []*N
for i in range(N):
    a, b = list(map(int, input().split()))
    I.append((a, b))

I.sort()
k = I[0][0]
l = I[-1][0]
m = I[-1][1]

print((k-1)+(l-k+1)+m)

Solution (Python):
N = int(input())
A = [list(map(int, input().split())) for _ in range(N)]
A.sort()
print(sum(A[-1]))

Solution (Python):
import collections


def main():
    n = int(input())
    abList = [0] * n
    for i in range(n):
        abList[i] = list(map(int, input().split()))
    abList.sort(key=lambda x: x[0], reverse=True)
    print(sum(abList[0]))


if __name__ == '__main__':
    main()

Solution (Python):
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    N = I()
    BA = []
    for _ in range(N):
        A, B = LI()
        BA.append((B, A))

    BA.sort()
    ans = BA[0][0] + BA[0][1]
    print(ans)

if __name__ == '__main__':
    resolve()

Solution (Python):
n = int(input())
l = sorted([list(map(int, input().split())) for i in range(n)])[::-1]
ans = l[0][0] + l[0][1]
print(ans)

Solution (Python):
N=int(input())
max_a=0
point=0
for _ in range(N):
  A,B=map(int,input().split())
  if max_a<A:
    max_a=A
    point=B
print(max_a+point)

Solution (Python):
n=int(input())
ab=[list(map(int,input().split())) for _ in range(n)]
ab.sort(key=lambda x: x[0])
print(ab[-1][0]+ab[-1][1])

Solution (Python):
N = int(input())
li = [[int(i) for i in input().split()] for _ in range(N)]

li.sort(reverse=True)
print(sum(li[0]))

Solution (Python):
n = int(input())
max_value = -1
diff_between_0 = 0

for _ in range(n):
  a, b = [int(x) for x in input().split()]
  if max_value < a:
    max_value = a
    diff_between_0 = b

print(max_value + diff_between_0)

Solution (Python):
N = int(input())
M = 0
m = 10**9
c = 0
for i in range(N):
  a,b = map(int,input().split())
  if m >= a:
    m = a
  if M < a:
    M = a
    c = b + 1
ans = c+M-1
print(ans)

Solution (Python):
import sys
input = sys.stdin.readline

N = int(input())

max_a = 0
res = 0

for _ in range(N):
    a, b = map(int, input().split())
    if max_a < a:
        max_a = a
        res = a + b

print(res)

Solution (Python):


N = int(input())
L = []
p1 = 0
p2 = float('inf')
r1 = float('inf')
r2 = 0
for i in range(N):
    a, b = map(int,input().split())
    L.append([a, b])
    r1 = min(a, r1)
    p1 = max(b, p1)
    r2 = max(a, r2)
    p2 = min(b, p2)

ans = r2
for i in range(N):
    if L[i][0] == r2:
        ans += L[i][1]
print(ans)

Solution (Python):
import sys
readline=sys.stdin.readline
read=sys.stdin.read

n=int(readline())
p=[list(map(int,lst.split())) for lst in read().splitlines()]
e=max(p, key=lambda x:x[0])
print(e[0]+e[1])

Solution (Python):
N = int(input())
maxi = 0
ans = 0
for i in range(N):
  A, B = map(int, input().split())
  if maxi < A:
    maxi = A
    ans = A + B
print(ans)

Solution (Python):
N = int(input())
max_a = 1
max_v = -1
for _ in range(N):
  a, b = [int(i) for i in input().split()]
  if max_a <= a:
    max_a = a
    max_v = b
print(max_a + max_v)

Solution (Python):
N = int(input())
ans = 0
maxA = 0
for i in range(N):
  A, B = map(int,input().split())
  if A > maxA: 
    maxA = A
    ans = A + B
print(ans)

Solution (Python):
n = int(input())
a,b = [],[]
for i in range(n):
  aa, bb = map(int, input().split())
  a.append(aa)
  b.append(bb)

print (max(a)+min(b))

Solution (Python):
N=int(input())

minarg_A=0
min_B=float("inf")
for _ in range(N):
  A,B=map(int,input().split())
  if B<min_B:
    min_B=B
    minarg_A=A


print(minarg_A+min_B)

Solution (Python):
n=int(input())
ma,r=0,0
for _ in range(n):
    a,b=map(int,input().split())
    if ma<a:
        ma=a
        r=ma+b
print(r)

Solution (Python):
n = int(input())
ma = 0
value = 0
for i in range(n):
    a, b = map(int, input().split())
    if a > ma:
        ma = a
        value = b

print(ma + value)

Solution (Python):


import sys
from typing import Any, Callable, Deque, Dict, List, Mapping, Optional, Sequence, Set, Tuple, TypeVar, Union































def main():
    Num = Union[int, float]
    mod = 1000000007                
    inf = float('inf')              
    
    sys.setrecursionlimit(10**6)    
    def input():  return sys.stdin.readline().rstrip()
    def ii():     return int(input())
    def isp():    return input().split()
    def mi():     return map(int, input().split())
    def mi_0():   return map(lambda x: int(x)-1, input().split())
    def lmi():    return list(map(int, input().split()))
    def lmi_0():  return list(map(lambda x: int(x)-1, input().split()))
    def li():     return list(input())
    def debug(x): print(x, file=sys.stderr)
    
    
    
    n = ii()
    A = []
    B = []
    for _ in range(n):
        a, b = mi()
        A.append(a)
        B.append(b)
    M = max(A)
    ind = A.index(M)
    print(M + B[ind])



if __name__ == "__main__":
    main()

Solution (Python):
a = int(input())
l =[]
for i in range(a):
    s = input().split(" ")
    n = int(s[0]); m = int(s[1])
    l.append(m+n)
print(min(l))

Solution (Python):


import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

n = I()
ab = [LI() for _ in range(n)]
ab.sort(key = itemgetter(1))
print(sum(ab[0]))

Solution (Python):
n = int(input())
min_a = 10**9+1
min_s = 0
max_a = 0
max_s = 0
for i in range(n):
  a,b = map(int, input().split())
  if a<min_a:
    min_a = a
    min_s = b
  if a>max_a:
    max_a = a
    max_s = b

cnt = max_a
cnt += max_s
print(cnt)

Solution (Python):
AB = []
for _ in range(int(input())):
    a, b = map(int, input().split())
    AB.append([a, b])

AB = sorted(AB, key=lambda x: x[0], reverse=True)
print(sum(AB[0]))

Solution (Python):
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def s(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
cnt = 0
ans = 0
inf = float("inf")

n = k()
a = [l() for j in range(n)]
a.sort()
x = a[-1][1]+a[-1][0]
print(x)

Solution (Python):
import sys
input = sys.stdin.readline

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    N=I()
    temp=0
    ans=0
    for i in range(N):
        a,b=MI()
        if a>temp:
            ans=a+b
            temp=a
            
    print(ans)

main()

Solution (Python):
n = int(input())
saigo = 0
ans = 0
for _ in range(n):
    a,b = map(int,input().split())
    if saigo < a:
        saigo = a
        ans = a + b

print(ans)

Solution (Python):
n = int(input())
info = []
mi = float('inf')
ma = 0
for _ in range(n):
  a,b = map(int, input().split())
  ma = max(ma, a)
  mi = min(mi,b)
print(ma+mi)

Solution (Python):
N = int(input())
a, b = [], []
for i in range(N):
    a0, b0 = map(int, input().split())
    a.append(a0)
    b.append(b0)
a, b = zip(*sorted(zip(a, b)))
ans = a[-1]+b[-1]
print(ans)

Solution (Python):
n = int(input())
l = [list(map(int,input().split())) for i in range(n)]
a,b = [list(i) for i in zip(*l)]
m = a.index(max(a))
print(a[m] + b[m])

Solution (Python):
N=int(input())
dic=dict()
for _ in range(N):
  a,b=map(int,input().split())
  dic[a]=b

dic=sorted(dic.items(),key=lambda x:x[0])

ans= dic[-1][0] + dic[-1][1]
print(ans)

Solution (Python):
n = int(input())
max_a = 0
st_b = 0
for i in range(n):
    a,b = map(int,input().split())
    if max_a < a:
        max_a = a
        st_b = b
print(max_a+st_b)

Solution (Python):
n = int(input())
ans = 0
now = -1
for i in range(n):
  a,b = map(int,input().split())
  if a > now:
    now = a
    ans = a + b

print(ans)

Solution (Python):

from collections import deque, Counter
from heapq import heappop, heappush
from bisect import bisect_right

def main():
    N = int(input())
    A = [None] * N
    B = [None] * N
    for i in range(N):
        A[i], B[i] = map(int, input().split())
    print(max(A)+B[A.index(max(A))])

if __name__ == "__main__":
    main()

Solution (Python):
n=int(input())
x=[list(map(int,input().split())) for i in range(n)]
y=0
z=0
for i in x:
    a,b=i[0],i[1]
    if y<a:
      y=a
      z=b
print(y+z)

Solution (Python):
def main():
    n = int(input())
    A = []
    for _ in range(n):
        a, b = list(map(int, input().split()))
        A.append([a, b])
    A.sort(key = lambda x: x[0], reverse = True)
    print(sum(A[0]))


if __name__ == '__main__':
    main()

Solution (Python):
INF = 1001001001

n = int(input())

a_max = -1
b_min = INF
for i in range(n):
    a, b = map(int, input().split())
    if b_min > b:
        a_max = a
        b_min = b

ans = a_max + b_min
print(ans)

Solution (Python):
N = int(input())

mini = [10 ** 10, -1]
for _ in range(N):
    a, b = map(int, input().split())
    if mini[0] > b:
        mini[0] = b
        mini[1] = a

print(mini[1] + mini[0])

Solution (Python):
n = int(input())
a = []
b = []
for i in range(n):
    x,y = map(int,input().split())
    a.append(x)
    b.append(y)

s = a.index(max(a))
print(max(a)+b[s])

Solution (Python):
n = int(input())
a = []
for i in range(n):
  a.append(list(map(int, input().split())))
a.sort(reverse=True)
print(a[0][0] + a[0][1])

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10**9 + 7


N = INT()
AB = [LIST() for _ in range(N)]
AB.sort(key = lambda x: x[0])
print(AB[-1][0] + AB[-1][1])

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10**9 + 7


N = INT()
AB = [LIST() for _ in range(N)]

AB.extend([[0, INF], [INF, 0]])

AB.sort(key = lambda x:x[0])

ans = 0
for i in range(1, N+2):
	ans += min(AB[i][0]-AB[i-1][0], AB[i-1][1]-AB[i][1])

print(ans)

Solution (Python):
N = int(input())
amax, score = 0, 0
for _ in range(N):
    a, b = map(int, input().split())
    if amax < a:
        amax = a
        score = b
ans = amax + score
print(ans)

Solution (Python):
N = int(input())
A = []
B = []
for i in range(N):
  a, b = map(int, input().split())
  A.append(a)
  B.append(b)
print(max(A)+B[A.index(max(A))])

Solution (Python):
N=int(input())
ab=[list(map(int,input().split()))for _ in range(N)]

ab.sort()
ans=ab[-1][0]+ab[-1][1]
print(ans)

Solution (Python):
from sys import stdin
N = int(stdin.readline().rstrip())
AB = sorted([list(map(int, stdin.readline().rstrip().split())) for _ in range(N)])
print(AB[N-1][0]+AB[N-1][1])

Solution (Python):
if __name__ == '__main__':
    a = int(input())
    max1 = 0
    max2 = 0
    for i in range(a):
        b, c = map(int, input().split())
        if max1<b:
            max1=b
            max2=c
    print(max1+max2)

Solution (Python):
N = int(input())

A_list = list()
B_list = list()

for i in range(N):
    A,B = map(int, input().split())
    A_list.append(A)
    B_list.append(B)

print(min(A_list)-1 + max(A_list)-min(A_list)+1 +min(B_list))

Solution (Python):
n = int(input())
A = []
B = []
for i in range(n):
    a,b = map(int,input().split())
    A.append(a)
    B.append(b)
ind = A.index(max(A))
print(max(A)+B[ind])

Solution (Python):
n = int(input())
x = [list(map(int, input().split())) for _ in range(n)]
x.sort(key=lambda x:x[0])
worst = x[-1]

print(worst[0] + worst[1])