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):
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
INF = float("inf")


def main():
    N = int(input())
    rank, score = -1, -1
    for _ in range(N):
        A, B = map(int, input().split())
        if A > rank:
            rank = A
            score = B

    print(rank + score)


if __name__ == '__main__':
    main()

Solution (Python):





import numpy as np




N = raw_input()
N = int(N)




A = []
B = []
for i in range(N):
    x = raw_input()
    x = x.split(' ')
    x = [int(d) for d in x]
    A.append(x[0])
    B.append(x[1])




A = np.array(A)
B = np.array(B)




max_index = np.argmax(A)
max_num = np.max(A)




print(max_num + B[max_index])

Solution (Python):
from sys import stdin
n = int(stdin.readline())
ans = 0
a = []
b = []
for _ in xrange(n):
 x,y = map(int,stdin.readline().split())
 b.append(x)
 a.append(y)
a.sort()
b.sort()
print b[-1] + a[0]

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


def bubble_sort(arr1,arr2,n):
    for i in range(n):
        for j in range(0,n-i-1):
            if arr1[j] > arr1[j+1]:
                arr1[j],arr1[j+1] = arr1[j+1],arr1[j]
                arr2[j],arr2[j+1] = arr2[j+1],arr2[j]





A = []
B = []
max_key = 0
max_value = 0
for i in range(N):
    tmp1,tmp2 = map(int,input().split())
    A.append(tmp1)
    B.append(tmp2)
    if tmp1 > max_key:
        max_key = tmp1
        max_value = tmp2
print(max_value+max_key)

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

p = 0
s = 0

for i in range(n):
    a,b = [int(x) for x in input().split()]
    if i == 0:
        p,s = a,b
    else:
        if a > p:
            p,s = a,b
        else:
            pass

print(p+s)

Solution (Python):
p=10**9; q=0
N = int(input())
for i in range(N):
    a, b = map(int, input().split())
    q = max(a, q)
    p = min(b, p)
print(p+q)

Solution (Python):
import sys
import socket

hostname = socket.gethostname()

if hostname == 'F451C':
    sys.stdin = open('b1.in')


def read_int_list():
    return list(map(int, input().split()))


def read_str_list():
    return input().split()


def read_int():
    return int(input())


def read_str():
    return input()


def main():
    n = read_int()
    res = 10 ** 20
    for i in range(n):
        a, b = read_int_list()
        if a + b < res:
            res = a + b
    print(res)


main()

Solution (Python):
n = int(input())
a_b = [input() for i in range(n)]
min = 1000000001
max = -1
max_point = 0
for i in a_b:
    a, b = map(int, i.split())
    if(min > a):
        min = a
    if(max < a):
        max = a
        max_point = b

num = 0
num += min
num += max - min
num += max_point

print(num)

Solution (Python):
import sys
import socket

hostname = socket.gethostname()

if hostname == 'F451C':
    sys.stdin = open('b1.in')


def read_int_list():
    return list(map(int, input().split()))


def read_str_list():
    return input().split()


def read_int():
    return int(input())


def read_str():
    return input()


def main():
    n = read_int()
    a = [0] * n
    b = [0] * n
    for i in range(n):
        a[i], b[i] = read_int_list()

    m = min(b)
    for i in range(n):
        if b[i] == m:
            res = a[i] + b[i]
    print(res)


main()

Solution (Python):
n = int(input())
a_b = [input() for i in range(n)]
min = 1000000001
max = -1
max_point = 0
for i in a_b:
    a, b = map(int, i.split(' '))
    if(min > a):
        min = a
    if(max < a):
        max = a
        max_point = b

num = 0
num += min
num += max - min
num += max_point

print(num)

Solution (Python):
n=int(input())
arr=[list(map(int,input().split())) for _ in range(n)]
a=[]
b=[]
for i in range(n):
    a.append(arr[i][0])
for i in range(n):
    b.append(arr[i][1])
num_min = max(a)
score_min = min(b)
print(num_min + score_min)

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

A = sorted(A)
B = sorted(B, reverse=True)
ret = 0
pre_a = 0
pre_b = float('inf')
for i in range(N):
    ret += min(A[i] - pre_a, pre_b - B[i])
    pre_a = A[i]
    pre_b = B[i]

ret += pre_b
print(ret)

Solution (Python):
n = int(input())
score = []
for i in range(n):
    score.append(list(map(int, input().split())))

p = 0
A = []
B = []
for n in score:
    A.append(n[0])
    B.append(n[1])

aida = max(A) - min(A) + 1
one_to_a = (1 - min(A)) * -1
p = aida + one_to_a + min(B)
print(p)

Solution (Python):
N = int(raw_input())
G = 0
for i in range(N):
    tmp = raw_input().split(' ')
    if int(tmp[0]) > G:
        G = int(tmp[0])
        P = int(tmp[1])
print G + P

Solution (Python):
n = int(input())
a = []
b = []
for i in range(n):
    line = list(map(int, input().split()))
    a.append(line[0])
    b.append(line[1])

participants = 0
a.sort()
b.sort()
b.reverse()

participants += n

participants += a[0] - 1

for i in range(n-1):
    minwidth = 0
    if (a[i+1] - a[i]) >= (b[i] - b[i + 1]):
        minwidth = (b[i] - b[i + 1])
    else:
        minwidth = (a[i+1] - a[i])
    participants += minwidth - 1

participants += b[n-1]

print(participants)

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

    
    
if __name__=="__main__":
    main()

Solution (Python):
N = int(input())
dic = {}
for i in range(N):
    a,b = [int(j) for j in input().split(" ")]
    dic[a] = b
max_keys = max(dic.keys())
min_value = dic[max_keys]
print(max_keys+min_value)

Solution (Python):



if __name__ == "__main__":
    N = int(raw_input())
    A = []
    B = []
    for n in range(N):
        input = map(int, raw_input().split())
        A.append(input[0])
        B.append(input[1])
    minimam = min(B)
    print A[B.index(minimam)] + minimam

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

x = -1
y = -1

for a in range(n):
  z = raw_input().split(" ")
  xx = int(z[0])
  yy = int(z[1])

  if x < int(xx):
    x = xx
    y = yy

print x+y

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

rank = []
score = []

for i in range(N):
    s = input()
    rank.append(int(s.split()[0]))
    score.append(int(s.split()[1]))

min_rank = max(rank)
min_key = max(enumerate(rank), key=lambda x: x[1])[0]

ans = min_rank + score[min_key]

print(ans)

Solution (Python):
def solve():
    N = int(input())
    A = []
    B = []
    for _ in range(N):
        a, b = list(map(int, input().split(" ")))
        A.append(a)
        B.append(b)
    
    participants = max(A) + min(B)
    
    print(participants)


solve()

Solution (Python):
N = int(raw_input())
aa = 0
for i in range(0,N):
 a,b = map(int,raw_input().split())
 if a > aa:
  aa = a
  bb = b + aa
print bb

Solution (Python):
n = int(input())
A = []
B = []
for i in range(n):
    a, b = map(int, input().split())
    A.append(a)
    B.append(b) 
A = sorted(A)
B = sorted(B, reverse = True)

ans = 0
ans += A[0]
for i in range(1, n):
    if(A[i] - A[i - 1] > B[i - 1] - B[i]):
        ans += B[i - 1] - B[i]
    else:
        ans += A[i] - A[i - 1]
ans += B[-1]
print(ans)

Solution (Python):
N = int(input())
minA = 100001
maxA = -1
maxB = 0
for i in range(N):
	A, B = map(int, input().split())
	minA = min(minA, A)
	if maxA < A:
		maxA = A
		maxB = B


print((minA) + (maxA - minA) + maxB)

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

Solution (Python):
N = int(input())
ab = []
for i in range(N):
    ab.append(tuple(map(int,input().split())))
mn = min(ab,key=lambda x:x[1])
print(sum(mn))

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

data = {}

for i in range(N):
    inputs = input().split()
    data[int(inputs[0])] = int(inputs[1])

sort_key = sorted(data)
ans = 0

for i in range(len(sort_key)):
    if i == 0 and sort_key[0] != 1:
        ans += sort_key[0] - 1
    if i < len(sort_key) - 1:
        ans += min(sort_key[i + 1] - sort_key[i] - 1, data[sort_key[i]] - data[sort_key[i + 1]] - 1)
    if i == len(sort_key) - 1 and data[sort_key[i]] != 0:
        ans += data[sort_key[i]]


print(ans + len(sort_key))

Solution (Python):

N = int(input())
best = (-1, 0)
for i in range(N):
  n, score = [int(j) for j in input().split(' ')]
  if n > best[0]: best = (n, score)
print(best[0] + best[1])

Solution (Python):
def main():
    num = int(input())
    value_array = []
    for i in range(0, num):
        value = input().split()
        value_array.append([int(x) for x in value])
    max_array = max(value_array)
    print(max_array[0] + max_array[1])


if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
a = [0] * n
b = [0] * n
amax = 1
bmin = 9999999990
for i in range(n):
    a[i],b[i] = list(map(int,input().split()))
amax = max(a)
bmin = min(b)
ans = amax +bmin

print(ans)

Solution (Python):


num_info = int(input())
infos = []
for i in range(num_info):
    temp = input().split(' ')
    a, b = int(temp[0]), int(temp[1])
    infos.append([a, b])


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


info_max = infos[0]
info_min = infos[num_info - 1]


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

Solution (Python):
n = int(input())
lst = []

for x in range(n):
    s = tuple(int(i) for i in input().split(' '))
    lst.append(s)

lst.sort(key=lambda tup: tup[0])

print(lst[-1][0]+lst[-1][1])

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

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

Solution (Python):
n = int(input())
ans_min = list(map(int, input().split()))
inp = [0,0]
for _ in range(n-1):
    inp = list(map(int, input().split()))
    if ans_min[1] > inp[1]:
        ans_min = inp
print(ans_min[0] + ans_min[1])

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

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

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

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

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

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

Solution (Python):
if __name__ == '__main__':
    N = int(input())
    A = list(map(int, input().split()))
    m = A[0]
    sum = A[0] + A[1]
    for i in range(N-1):
        A = list(map(int, input().split()))
        if A[0] > m:
            m = A[0]
            sum = A[0] + A[1]
    print(sum)

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

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

a.sort(reverse=True)
b.sort()
aa,bb = a[0],b[0]
count = b[0]

for i in range(1,n):
    count += min(aa-a[i],b[i]-bb)
    aa = a[i]
    bb = b[i]

print(count+aa)

Solution (Python):



n = int(input())
info = []

for i in range(n):
    
    
    abi = input()
    ai, bi = int(abi.split(' ')[0]), int(abi.split(' ')[1])
    
    info.append([ai, bi])

info = sorted(info, key=lambda inf: inf[1])

imp = info[0][0] + info[0][1]
print(imp)

Solution (Python):

import numpy as np

N = np.int64(input())
a = []
for i in range(N):
    a.append([int(x) for x in input().split()])
a = np.array(a)

lowest_person = a[:,0].max()
lowest_score = a[:,1].min()

num_people = lowest_person + lowest_score

print(num_people)

Solution (Python):
def solution():
	k = int(input())
	l = []

	for i in range(k):
		l.append([int(a) for a in input().split(' ')])

	l = sorted(l, key=lambda x: x[0])

	return l[k-1][0]+l[k-1][1]


print(solution())

Solution (Python):
num = int(input())
d_max = {"rank" : 100000, "point":0}
d_min = {"rank" : 1, "point":1000000000}
for a in range(num):
    temp = input().split(" ")
    if int(temp[0]) < d_max["rank"]:
        d_max["rank"] = int(temp[0])
        d_max["point"] = int(temp[1])
    if int(temp[0]) > d_min["rank"]:
        d_min["rank"] = int(temp[0])
        d_min["point"] = int(temp[1])
    if num == 1:
        d_min["rank"] = int(temp[0])
        d_min["point"] = int(temp[1])
possible_upper = min(d_max["rank"] - 1, 1e9 - d_max["point"])
possible_lower = d_min["rank"]+d_min["point"]

print(possible_lower)

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

li = []
for i in range(n):
    li.append(list(map(int,input().split())))

li_c = sorted(li.copy())

print(li_c[-1][0]+li_c[-1][1])

Solution (Python):


N = int(raw_input())
a, b = [], []

for i in range(N):
    s = map(int, raw_input().split())
    a.append(s[0])
    b.append(s[1])

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

Solution (Python):

N = int(input())
results = sorted([[int(s) for s in input().split()] for i in range(N)], key=lambda x: x[0])
lastResult = results[-1]
print(lastResult[0] + lastResult[1])

Solution (Python):



"""ゲームの参加人数としてありうる最大値を求める問題"""

def main():
    """
    入力: 1行目に情報の数N, 2行目からN+1行目まで，
         空白区切りで得点の大きい方からの何番目の人の得点が何点だったかを"順位 得点"で示す．
         全ての人の得点は異なる非負の整数．
    出力: ゲームの参加人数としてありうる最大値．
    Returns: None.
    方針: 一番低い順番の人の順位と得点の和が答えになる．(その人の得点と同じ人数が参加しうる)
    """
    
    numbers = int(input())
    min_rank = 0
    min_value = 2000000000
    for i in range(numbers):
        current_rank, current_value = [int(item) for item in input().split()]
        if min_rank < current_rank:
            min_rank = current_rank
            min_value = current_value
    print(min_rank + min_value)
    return None

if __name__ == "__main__":
    main()

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

res = max(A)
res += min(B)

print(res)

Solution (Python):
N=int(input())
lowest_rank=0
lowest_score=0
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)

Solution (Python):
N = int(input())
mn = 10**9 + 1
mx = -1
mnj = 10**9 + 1
mxj = -1
for i in range(N):
    Ai,Bi = map(int, input().split())
    if mn > Bi:
        mn = Bi
        mnj = Ai
    if mx < Bi:
        mx = Bi
        mxj = Ai
print(mxj + mnj - mxj + mn)

Solution (Python):
N = int(input())
A = [-1 for x in range(N)]
B = [-1 for x in range(N)]
for i in range(N):
    A[i], B[i] = list(map(int, input().split()))

index_max = A.index(max(A))
print(A[index_max] + B[index_max])

Solution (Python):
maxn=int(raw_input())
data1=maxn*[0]
data2=maxn*[0]
for n in range(maxn):
 inp=raw_input()
 data1[n]=int(inp.split(' ')[0])
 data2[n]=int(inp.split(' ')[1])
print max(data1)+min(data2)

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(B[A.index(max(A))]+max(A))

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

for x in range(0, N):
    a, b = map(int, input().split(" "))
    if x == 0 or e_max < a:
        e_max = a
        f = b

print(e_max + f)

Solution (Python):
if __name__ == '__main__':
    N = int(input())
    a = 0
    for i in range(N):
        tmp_a, tmp_b = list(map(int, input().split()))
        if a < tmp_a:
            a = tmp_a
            b = tmp_b

    print(a + b)

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

tensuu = [[int(x) for x in input().split()] for i in range(num)]

tensuu.sort(key = lambda x:x[1])

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

Solution (Python):
import sys

import numpy as np

a = []
b = []

n = int(sys.stdin.readline().strip())

for i in range(n):
    ai, bi = map(int, sys.stdin.readline().strip().split())
    a.append(ai)
    b.append(bi)

l = np.argmax(a)
print(a[l]+b[l])

Solution (Python):


N = int(input())

num_temp = 0
num_point = 0

for n in range(N):
    num , point = map(int, input().split())
    if num_temp < num:
        num_temp = num
        num_point = point

print(num_temp + num_point)

Solution (Python):
if __name__ == '__main__':
    N = input()
    d = []
    for _ in xrange(N):
        A, B = map(int, raw_input().split())
        d.append((A,B))
    
    d.sort()

    A1, B1 = d[0]
    AN, BN = d[-1]

    print AN + BN

Solution (Python):


n = int(input())

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

x = min(a)
y = min(b)

a.sort()
b.sort(reverse = True)

print(a[-1] - a[0] + a[0] + b[-1])

Solution (Python):
N = int(input())
worst = [None, None]
for i in range(N):
    A, B = list(map(int, input().split()))
    if worst[0] == None or worst[0] < A:
        worst = [A, B]

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

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

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

print(ans)

Solution (Python):
all = input()
num = 0
score = 0
for i in range(int(all)):
	now = input().split()
	if int(now[0]) > num:
		num = int(now[0])
		score = int(now[1])
print(num + score)

Solution (Python):
n = int(input())
max_a = 0
max_b = 0
for i in range(n):
    a,b = map(int,input().split())

    if a > max_a:
        max_a,max_b = a,b
         
print(max_b+max_a)

Solution (Python):
N = int(input())
arr = [[0 for i in range(2)] for _ in range(N)]

for n in range(N):
    arr[n] = list(map(int, input().split()))
    
arr.sort(key=lambda x:x[0])
max_order = arr[0][0]
min_order = arr[N-1][0]
min_score = arr[N-1][1]

print(max_order + (min_order-max_order) + min_score)

Solution (Python):
def read_int_list():
    return list(int(i) for i in input().split())
n = int(input())
player = dict()
for i in range(n):
    k, p = read_int_list()
    player[k] = p

max_p = max(player)
min_p = min(player)
high = min_p - 1
low = player[max_p]
b = max_p-min_p+1
print(high+b+low)

Solution (Python):
l=int(input())
a=[0 for i in range(l)]
b=[0 for i in range(l)]
for i in range(l):
    a[i],b[i]=list(map(int,input().split(' ')))

la=max(a)
sa=min(a)
sb=min(b)

s=sa-1
m=la-sa+1
l=sb
print(s+m+l)

Solution (Python):
def main():
    N = int(input())
    AB = {tuple(map(int, input().split())) for _ in range(N)}

    print(sum(max(AB)))

main()

Solution (Python):



N = int(input())
a_list = []
b_list = []

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

	a_list.append((A,B))

a_list.sort()

print(a_list[-1][1] + a_list[-1][0])

Solution (Python):
N = int(input())
a = []
b = []


for i in range(N):
    tmp_a, tmp_b = map(int, input().split())
    a.append(tmp_a)
    b.append(tmp_b)

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

Solution (Python):
N = int(input())
m_rank = 1
point_at_m_rank = 1000000000
for i in range(N):
    a, b = map(int, input().split())
    if a >= m_rank:
        m_rank = a
        point_at_m_rank = b
print(m_rank+abs(point_at_m_rank))

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

Solution (Python):
N = int(input())
A = []
B = []

for _ in range(N):
    line = input().split()
    A.append(int(line[0]))
    B.append(int(line[1]))
print(max(A) + B[A.index(max(A))])

Solution (Python):
N = int(input())
A = []
B = []
for i in range(N):
    temp = input().split()
    A.append(int(temp[0]))
    B.append(int(temp[1]))

idx = A.index(max(A))
print(A[idx] + B[idx])

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

a = [list(map(int, input().split())) for x  in range(n)]
print(max(a, key=lambda x: x[0])[0] + min(a, key=lambda x: x[1])[1])

Solution (Python):
N = int(input())
best_rank = 1000000000
best_score = 0
worst_rank = 0
worst_score = 0
for i in range(N):
    a, b = list(map(int, input().split()))
    if a < best_rank:
        best_rank, best_score = a, b
    if a > worst_rank:
        worst_rank, worst_score = a, b

print(worst_score+worst_rank)

Solution (Python):
def i1():
 return int(input())
def i2():
 return [int(i) for i in input().split()]

n=i1()
x=[]
for i in range(n):
    x.append(i2())
x.sort()
print(x[-1][0]+x[-1][1])

Solution (Python):
N = int(input())
AB = [tuple(map(int,(input().split()))) for i in range(N)]
AB = sorted(AB,reverse=True)
print(AB[0][0]+AB[0][1])

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

Solution (Python):
N=int(input())
maxx=0
maxy=0

for i in range(N):
    x = list(map(int, input().split()))
    if maxx<x[0]:
        maxx=x[0]
        maxy=x[1]


print(maxx+maxy)

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

rank_point = sorted(rank_point, key = lambda x:x[0])
print(sum(rank_point[-1]))

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

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

Solution (Python):

"""
http://tenka1-2017-beginner.contest.atcoder.jp/tasks/tenka1_2017_b

"""
import sys
from sys import stdin
input = stdin.readline


def main(args):
    worst_rank = -1
    worst_score = float('inf')

    N = int(input())
    for _ in range(N):
        r, s = map(int, input().split(' '))
        if r > worst_rank:
            worst_rank = r
            worst_score = s

    print(worst_rank + worst_score)


if __name__ == '__main__':
    main(sys.argv[1:])

Solution (Python):

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

info.sort(reverse=True)
print(info[0][0]+info[0][1])

Solution (Python):
import sys

n = int(input().strip())
a_, b_ = 0, 0
for _ in range(n):
    a, b  = [int(x) for x in input().strip().split()]
    if a_ < a:
        a_, b_ = a, b
print(a_ + b_)

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

Solution (Python):

n = int(input())
amax = 0
b_amax = 0
for i in range(n):
  (a, b) = tuple([int(i) for i in input().split()])
  if amax < a:
    amax = a
    b_amax= b
print(amax + b_amax)

Solution (Python):


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

max_order = max(A)
i = A.index(max_order)
score = B[i]
print(max_order+score)

Solution (Python):


N = int(input())

aMax = 0
bMax = 0
for i in range(N) :
    s = input().split()
    a = int(s[0])
    b = int(s[1])
    
    
    if a > aMax :
        aMax = a
        bMax = b
        
print(aMax + bMax)

Solution (Python):



n = raw_input()
n = int(n)

maxa = 0

for i in range(n):
    ab = raw_input()
    ab = ab.split()
    a,b = map(int,ab)
    if a > maxa:
        maxa = a
        minb = b

ans = maxa + minb

print ans

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

m1 = 0
m2 = 0
for i in range(N):
    a, b = map(int, input().split())
    if a > m1:
        m1 = a
        m2 = b

print(m1 + m2)

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

c = 0
d = 0

for i in range(n):
    if c < ab[i][0]:
        c = ab[i][0]
        d = ab[i][1]

print(c+d)

Solution (Python):
N = int(input())
ans = [-1, 0]

for i in range(N):
    A, B = map(int, input().split())
    if ans[0] < A:
        ans[0] = A
        ans[1] = B

print(sum(ans))

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

A = []
B = []

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