CodeEff/ECCO huggingface dataset:
# Original solution
import sys
INF = 10 ** 9
MOD = 10 ** 9 + 7
from collections import deque
sys.setrecursionlimit(100000000)
input = sys.stdin.readline
MAXN = 2005

dp0 = [[-1] * MAXN for _ in range(MAXN)]
dp1 = [[-1] * MAXN for _ in range(MAXN)]

def dfs(i,j,p,z,w,a,n):
    if p == 0:
        if dp0[i][j] != -1:
            return dp0[i][j]
        if i == n:
            if j == 0:
                return abs(w - a[-1])
            return abs(a[j -1] - a[-1])
        ans = 0
        for k in range(i,n):
            ans = max(ans,dfs(k + 1,k,1,z,w,a,n))
        if i == 1:
            ans = max(ans,abs(a[-1] - w))
        else:
            ans = max(ans,abs(a[-1]- a[i - 1]))
        dp0[i][j] = ans
        return ans
    elif p == 1:
        if dp1[i][j] != -1:
            return dp1[i][j]
        if i == n:
            if j == 0:
                return abs(z - a[-1])
            return abs(a[j - 1] - a[-1])
        ans = INF
        for k in range(i,n):
            ans = min(ans,dfs(k + 1,k,0,z,w,a,n))
        if i == 1:
            ans = min(ans,abs(a[-1] - z))
        else:
            ans = min(ans,abs(a[-1] - a[i - 1]))
        dp1[i][j] = ans
        return ans

def main():
    n,z,w = list(map(int,input().split()))
    a = list(map(int,input().split()))

    ans = dfs(1,0,0,z,w,a,n)
    print(ans)

if __name__=='__main__':
    main()

# Optimized solution
import sys
INF = 10 ** 9
MOD = 10 ** 9 + 7
from collections import deque
sys.setrecursionlimit(100000000)
input = sys.stdin.readline

def main():
    n,z,w = list(map(int,input().split()))
    a = list(map(int,input().split()))
    if n == 1:
        ans = abs(w - a[0])
    else:
        ans = max(abs(w - a[-1]),abs(a[-1] - a[-2]))
    print(ans)

if __name__=='__main__':
    main()
# Original solution
# -*- coding: utf-8 -*-

"""
参考：https://kimiyuki.net/writeup/algo/atcoder/arc-085-d/
　　　https://atcoder.jp/contests/abc078/submissions/3854338
・ミニマックス法
・メモ化再帰
・メモの持ち方をシンプルにした版
"""

import sys
from collections import defaultdict

# 再帰呼び出しの回数制限(デフォルト1000)
sys.setrecursionlimit(10 ** 9)
 
N, Z, W = list(map(int, input().split()))
aN = list(map(int, input().split()))

# メモ[手番][残り山札数] = このルートでのmax,min
memo = [[0] * (N+1) for _ in range(2)]

def dfs(turn, rest, x, y):
    if rest == 0:
        return abs(x - y)
    # 先手番
    if turn % 2 == 0:
        # 既に見た局面ならメモの内容を返す
        if memo[0][rest]: 
            return memo[0][rest]
        mx = -1
        for i in range(N-rest, N):
            x = aN[i]
            idx = i+1
            mx = max(dfs(turn+1, N-idx, x, y), mx)
        # ここより深い所を探し終わったので結果をメモする
        memo[0][rest] = mx
        return mx
    # 後手番
    else:
        if memo[1][rest]: 
            return memo[1][rest]
        mn = float('inf')
        for i in range(N-rest, N):
            y = aN[i]
            idx = i+1
            mn = min(dfs(turn+1, N-idx, x, y), mn)
        memo[1][rest] = mn
        return mn

print((dfs(0, N, Z, W)))


# Optimized solution
# -*- coding: utf-8 -*-

"""
参考：https://img.atcoder.jp/arc085/editorial.pdf
・公式解、O(1)の一発解法
・思いつけばいいけど、そういつも上手くいかないよね…。
"""
 
N, Z, W = list(map(int, input().split()))
aN = list(map(int, input().split()))

if N == 1:
    print((abs(aN[0] - W)))
else:
    # Xが最後まで引くか、最後から2番目まで引くか
    print((max(abs(aN[-1] - W), abs(aN[-2] - aN[-1]))))
# Original solution
# -*- coding: utf-8 -*-

import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(eval(input()))
def MAP(): return list(map(int, input().split()))
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 18
MOD = 10 ** 9 + 7

N, Z, W = MAP()
A = [W] + LIST()

memo = list3d(N+1, N+1, 2, -1)
def rec(cur, prev, turn):
    if cur == N:
        return abs(A[cur] - A[prev])
    if memo[cur][prev][turn] != -1:
        return memo[cur][prev][turn]
    
    if turn == 0:
        res = 0
        for nxt in range(cur+1, N+1):
            res = max(res, rec(nxt, cur, 1 - turn))
    else:
        res = INF
        for nxt in range(cur+1, N+1):
            res = min(res, rec(nxt, cur, 1 - turn))
    memo[cur][prev][turn] = res
    return res
print((rec(0, -1, 0)))


# Optimized solution
# -*- coding: utf-8 -*-

import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(eval(input()))
def MAP(): return list(map(int, input().split()))
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 18
MOD = 10 ** 9 + 7

N, Z, W = MAP()
A = [W] + LIST()

memo = list2d(N+1, 2, -1)
def rec(cur, prev, turn):
    if cur == N:
        return abs(A[cur] - A[prev])
    if memo[cur][turn] != -1:
        return memo[cur][turn]
    
    if turn == 0:
        res = 0
        for nxt in range(cur+1, N+1):
            res = max(res, rec(nxt, cur, 1 - turn))
    else:
        res = INF
        for nxt in range(cur+1, N+1):
            res = min(res, rec(nxt, cur, 1 - turn))
    memo[cur][turn] = res
    return res
print((rec(0, 0, 0)))
# Original solution
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
from string import ascii_lowercase
from functools import lru_cache
INF = float("inf")
import sys
sys.setrecursionlimit(10000)

a = []
memo = []


def dfs(no, i):
    global memo, a
    if memo[no][i]:
        return memo[no][i]

    ans = abs(a[-1] - a[i])
    for j in range(i + 1, len(a) - 1):
        nex = dfs(1 - no, j + 1)
        # X
        if no == 0:
            ans = max(ans, nex)
        # Y
        else:
            ans = min(ans, nex)

    memo[no][i] = ans
    return ans


def solve2(N, Z, W):
    global a, memo
    a = [Z, W] + a
    memo = [[None] * len(a) for _ in range(2)]
    return dfs(0, 1)


def solve(N, Z, W):
    global a
    ans = abs(a[-1] - W)
    if len(a) > 1:
        ans = max(ans, abs(a[-2] - a[-1]))
    return ans


def main():
    global a
    N, Z, W = list(map(int, input().split()))
    a = list(map(int, input().split()))
    print((solve2(N, Z, W)))


if __name__ == '__main__':
    main()


# Optimized solution
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
from string import ascii_lowercase
from functools import lru_cache
INF = float("inf")
import sys
sys.setrecursionlimit(10000)

a = []
memo = []


# 相手がi番目を引いたときにだせる最大/最小のスコア
def dfs(turn, i):
    global memo, a
    if memo[turn][i] != -1:
        return memo[turn][i]

    ans = 0 if turn == 0 else INF
    for j in range(i + 1, len(a)):
        if j == len(a) - 1:
            s = abs(a[j] - a[i])
        else:
            s = abs(dfs(1 - turn, j))

        # X
        if turn == 0:
            ans = max(ans, s)
        # Y
        else:
            ans = min(ans, s)

    memo[turn][i] = ans
    return ans


def solve2(N, Z, W):
    global a, memo
    a = [W] + a
    memo = [[-1] * len(a) for _ in range(2)]
    return dfs(0, 0)


def solve(N, Z, W):
    global a
    ans = abs(a[-1] - W)
    if len(a) > 1:
        ans = max(ans, abs(a[-2] - a[-1]))
    return ans


def main():
    global a
    N, Z, W = list(map(int, input().split()))
    a = list(map(int, input().split()))
    print((solve2(N, Z, W)))


if __name__ == '__main__':
    main()
# Original solution
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
from string import ascii_lowercase
from functools import lru_cache
INF = float("inf")
import sys
sys.setrecursionlimit(10000)

a = []
memo = []


# 相手がi番目を引いたときにだせる最大/最小のスコア
def dfs(turn, i):
    global memo, a
    if memo[turn][i] != -1:
        return memo[turn][i]

    ans = 0 if turn == 0 else INF
    for j in range(i + 1, len(a)):
        if j == len(a) - 1:
            s = abs(a[j] - a[i])
        else:
            s = abs(dfs(1 - turn, j))

        # X
        if turn == 0:
            ans = max(ans, s)
        # Y
        else:
            ans = min(ans, s)

    memo[turn][i] = ans
    return ans


def solve2(N, Z, W):
    global a, memo
    a = [W] + a
    memo = [[-1] * len(a) for _ in range(2)]
    return dfs(0, 0)


def solve(N, Z, W):
    global a
    ans = abs(a[-1] - W)
    if len(a) > 1:
        ans = max(ans, abs(a[-2] - a[-1]))
    return ans


def main():
    global a
    N, Z, W = list(map(int, input().split()))
    a = list(map(int, input().split()))
    print((solve2(N, Z, W)))


if __name__ == '__main__':
    main()


# Optimized solution
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
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


def main():
    N, Z, W = list(map(int, input().split()))
    A = list(map(int, input().split()))
    if N == 1:
        print((abs(A[0] - W)))
    else:
        print((max(abs(A[-1] - W), abs(A[-1] - A[-2]))))


if __name__ == '__main__':
    main()
# Original solution
N, Z, W = list(map(int, input().split()))
a = list(map(int, input().split()))
if N > 1:
    print((max(abs(W-a[-1]), abs(a[-1] - a[-2]))))
else:
    print((abs(W - a[0])))


# Optimized solution
N, Z, W = list(map(int, input().split()))
a = list(map(int, input().split()))

if N == 1:
    print((abs(a[0] - W)))

else:
    print((max(abs(a[-1]-W), abs(a[-1] - a[-2]))))
# Original solution
import sys
sys.setrecursionlimit(10**7)
from functools import lru_cache

def main():
    N, Z, W = list(map(int, input().split()))
    A = list(map(int, input().split()))
    dp = [0] * N

    @lru_cache(maxsize=None)
    def hoge(z, w, n, turn):
        if n == 0:
            return abs(z - w)
        if turn:
            return max(hoge(A[N - 1 - i], w, i, not turn) for i in range(n))
        else:
            return min(hoge(z, A[N - 1 - i], i, not turn) for i in range(n))
    return hoge(Z, W, N, True)

print((main()))


# Optimized solution
def main():
    N, Z, W = list(map(int, input().split()))
    A = list(map(int, input().split()))
    if N == 1:
        return abs(A[-1] - W)
    return max(abs(A[-1] - W), abs(A[-1] - A[-2]))


print((main()))
# Original solution
# tenka1-2017-beginnerB - Different Distribution
def main():
    N, *AB = list(map(int, open(0).read().split()))
    A = [(i, j) for i, j in zip(*[iter(AB)] * 2)]
    A.sort()
    ans = sum(A[-1])
    print(ans)


if __name__ == "__main__":
    main()

# Optimized solution
# tenka1-2017-beginnerB - Different Distribution
def main():
    N, *AB = list(map(int, open(0).read().split()))
    A = max(list(zip(*[iter(AB)] * 2)))
    ans = sum(A)
    print(ans)


if __name__ == "__main__":
    main()
# Original solution
def main():
    N=int(eval(input()))
    AB=[0]*N
    for i in range(N):
        AB[i]=list(map(int,input().split()))
    AB.sort()
    count=AB[-1][0]
    while AB[-1][1]-1>=0:
        AB[-1][1]-=1
        count+=1
    print(count)
if __name__=="__main__":
    main()

# Optimized solution
def main():
    N=int(eval(input()))
    AB=[0]*N
    for i in range(N):
        AB[i]=list(map(int,input().split()))
    AB.sort()
    count=AB[-1][0]
    count+=AB[-1][1]
    print(count)
if __name__=="__main__":
    main()
# Original solution
n=int(eval(input()))
a=[]
b=[]

for _ in range(n):
    a_ele, b_ele=list(map(int, input().split()))
    a.append(a_ele)
    b.append(b_ele)
a_min=min(a)
a_max=max(a)

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

# Optimized solution
n=int(eval(input()))
a=[]
b=[]

for _ in range(n):
    a_ele, b_ele=list(map(int, input().split()))
    a.append(a_ele)
    b.append(b_ele)

print(((b[a.index(max(a))]-1)+(max(a)+1)))
# Original solution
N = int(eval(input()))
#A = [list(map(int,input().split())) for i in range(N)]
#print (A)
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 = []
for i in range(N):
    tmp1,tmp2 = list(map(int,input().split()))
    A.append(tmp1)
    B.append(tmp2)
bubble_sort(A,B,N)
base = A[-1]
addition = B[-1]

print((base + addition))


# Optimized solution
N = int(eval(input()))
#A = [list(map(int,input().split())) for i in range(N)]
#print (A)
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 = list(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))
#bubble_sort(A,B,N)
#base = A[-1]
#addition = B[-1]


#print(base + addition)
# Original solution
n = int(eval(input()))
a = [list(map(int, input().split())) for _ in range(n)]
ans = 0
for i in range(n):
    ans = max(ans, a[i][0])
    if ans == a[i][0]:
        ind = i
print((ans + a[ind][1]))

# Optimized solution
n = int(eval(input()))
a = [list(map(int, input().split())) for _ in range(n)]
print((sum(max(a))))
# Original solution
from operator import add

n = int(eval(input()))
print((min(add(*list(map(int, input().split()))) for _ in range(n))))


# Optimized solution
print((min(sum(map(int,input().split()))for _ in range(int(eval(input()))))))
# Original solution
N = int(eval(input()))
A = []
B = []
for i in range(N):
	a,b = list(map(int,input().split()))
	A.append(a)
	B.append(b)
sum = max(A) - min(A) + 1
sum += min(A) - 1
sum += min(B)
print(sum)

# Optimized solution
N = int(eval(input()))
A = [0] * N
B = [0] * N
for i in range(N):
	a,b = list(map(int,input().split()))
	A[i] = a
	B[i] = b
print((max(A) + min(B)))
# Original solution
n = int(eval(input()))
a = sorted([list(map(int, input().split())) for _ in range(n)])
cnt = a[0][0] - 1 + n + a[-1][1]

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

# Optimized solution
n = int(eval(input()))
a = sorted([list(map(int, input().split())) for _ in range(n)])
print((sum(a[-1])))
# Original solution
n=int(eval(input()))
ab = []
for _ in range(n):
    a, b = (int(x) for x in input().split())
    ab.append([a, b])
ab = sorted(ab, key=lambda x: -x[0])
print((ab[0][0]+ab[0][1]))

# Optimized solution
N = int(eval(input()))

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

AB.sort(reverse=True)

print((sum(AB[0])))
# Original solution
def I(): return int(eval(input()))
def LI(): return list(map(int,input().split()))
N = I()
AB = [LI() for _ in range(N)]
T_AB = list(zip(*AB))
ans = max(T_AB[0])
ans += T_AB[1][T_AB[0].index(max(T_AB[0]))]
print(ans)


# Optimized solution
def I(): return int(eval(input()))
def LI(): return list(map(int,input().split()))
N = I()
AB = [LI() for _ in range(N)]
ans,max = 0,0
for x in AB:
    a,b = x[0],x[1]
    if a>max:
        max = a
        ans = a+b
print(ans)
# Original solution
n = int(eval(input()))
a = [[]]*n
for i in range(n):
  a[i] = list(map(int, input().split()))

a.sort()
print((a[-1][0]+a[-1][1]))

# Optimized solution
def main():
  n = int(eval(input()))
  a = [[]]*n
  for i in range(n):
    a[i] = list(map(int, input().split()))

  a.sort()
  print((a[-1][0]+a[-1][1]))

main()
# Original solution
N = int(eval(input()))
list1 = []
ind = 0
cnt = 0
top = 1
bot = 0
for i in range(N):
    L = list(map(int, input().split()))
    list1.append(L)
list1 = sorted(list1)
if list1[0][0]!=top:
    while(top!=list1[0][0]):
        cnt+=1
        top+=1
if list1[-1][1]!=bot:
    bot = list1[-1][1]
    while(bot!=0):
        cnt+=1
        bot-=1
for i in range(N-1):
    err = abs(list1[i][0]-list1[i+1][0])
    err1 = list1[i][1]-list1[i+1][1]
    if err != 1:
        cnt += min(err-1, err1-1)
print((cnt+N))

# Optimized solution
N = int(eval(input()))
list1 = []
max1 = 0
for i in range(N):
    L = list(map(int, input().split()))
    if max1 < L[0]:
        max1 = L[0]
        ans = sum(L)
print(ans)
# Original solution
def main():
    n = int(eval(input()))
    ab = [] # type:[[int]] 
    for i in range(n):
        ab.append([int(x) for x in input().split()])
    a, b = max(ab, key=lambda x: x[0])
    print((a + b))


if __name__ == "__main__":
    main()

# Optimized solution
def main():
    n = int(eval(input()))
    max_a, max_b = 0, 0 # type:int
    for _ in range(n):
        a, b = input().split()
        a = int(a)
        if max_a < a:
            max_a = a
            max_b = int(b)
    print((max_a + max_b))


if __name__ == "__main__":
    main()
# Original solution
def main():
    n = int(eval(input()))
    max_a, max_b = 0, 0 # type:int
    for _ in range(n):
        a, b = list(map(int, input().split(' ')))
        # a = int(a)
        if max_a < a:
            max_a = a
            max_b = b # int(b)
    print((max_a + max_b))
 
 
if __name__ == "__main__":
    main()

# Optimized solution
import sys
from sys import stdin
input = stdin.readline

def main():
    n = int(eval(input()))
    max_a, max_b = 0, 0 # type:int
    for _ in range(n):
        a, b = input().split()
        a = int(a)
        if max_a < a:
            max_a = a
            max_b = int(b)
    print((max_a + max_b))


if __name__ == "__main__":
    main()
# Original solution
print((min(eval('eval(input().replace(" ","+")),'*int(eval(input()))))))

# Optimized solution
print((min(sum(map(int,input().split()))for _ in[0]*int(eval(input())))))
# Original solution
print((min(eval('sum(map(int,input().split())),'*int(eval(input()))))))

# Optimized solution
print((min(sum(map(int,input().split()))for _ in[0]*int(eval(input())))))
# Original solution
def slove():
    import sys
    input = sys.stdin.readline
    n = int(input().rstrip('\n'))
    ab = [list(map(int, input().rstrip('\n').split())) for _ in range(n)]
    ab.sort()
    print((ab[-1][0] + ab[-1][1]))


if __name__ == '__main__':
    slove()


# Optimized solution
import sys


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    n = int(readline())
    ab = [list(map(int, readline().split())) for _ in range(n)]
    ab.sort()
    print(((ab[-1][0] - ab[0][0] + 1) + (ab[0][0] - 1) + (ab[-1][1])))


if __name__ == '__main__':
    solve()
# Original solution
N = int(eval(input()))
src = [tuple(map(int,input().split())) for i in range(N)]
src.sort()

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

# Optimized solution
N = int(eval(input()))
AB = [tuple(map(int,input().split())) for i in range(N)]
a,b = max(AB)
print((a+b))
# Original solution
#!/usr/bin/env python3
N = int(eval(input()))
ab = [[0, 0] for _ in range(N)]
for i in range(N):
    ab[i] = list(map(int, input().split()))
ab.sort(key=lambda x:x[0])

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

print(ans)


# Optimized solution
#!/usr/bin/env python3
N = int(eval(input()))
A = [0] * N
B = [0] * N
for i in range(N):
    A[i], B[i] = list(map(int, input().split()))

idx = A.index(max(A))
print((A[idx] + B[idx]))
# Original solution
N=int(eval(input()))
AB=[]
for i in range(N):
    AB.append(list(map(int,input().split())))
A=[]
B=[]
for i in range(N):
    A.append(AB[i][0])
    B.append(AB[i][1])
for i in range(N):
    if B[i]==min(B):
        bmin=i
print((A[bmin]+B[bmin]))

# Optimized solution
N=int(eval(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]))
# Original solution
n = int(eval(input()))
al = []
bl = []
for _ in range(n):
    a, b = list(map(int, input().split()))
    al.append(a)
    bl.append(b)
ans = max(al) + bl[al.index(max(al))]
print(ans)


# Optimized solution
n = int(eval(input()))
ans1 = ans2 = 0
for _ in range(n):
    a, b = list(map(int, input().split()))
    if ans1 < a:
        ans1 = a
        ans2 = b
print((ans1 + ans2))
# Original solution
n = int(eval(input()))
bottom = 10 ** 9+7
person = 0

for _ in range(n):
    a, b = list(map(int, input().split()))
    if b < bottom:
        person = max(person, a)
        bottom = b

ans = person + bottom
print(ans)


# Optimized solution
import sys
input = sys.stdin.readline
N = int(eval(input()))
ab = [tuple(map(int, input().split())) for _ in range(N)]
ab.sort()
ans = ab[-1][0] - ab[0][0] + 1
ans += ab[0][0] - 1
ans += ab[-1][1]

print(ans)
# Original solution
# cf16-finalA - Where's Snuke?
from string import ascii_uppercase


def main():
    h, w = list(map(int, input().rstrip().split()))
    A = [input().rstrip().split() for _ in range(h)]
    S = ascii_uppercase
    for i in range(h):
        for j in range(w):
            if A[i][j] == "snuke":
                print(S[j], i + 1, sep="")
                return


if __name__ == "__main__":
    main()


# Optimized solution
# cf16-finalA - Where's Snuke?
from string import ascii_uppercase


def main():
    H, W, *S = open(0).read().split()
    H, W, abc = int(H), int(W), ascii_uppercase
    for i, s in enumerate(S):
        if s == "snuke":
            print(abc[i % W], i // W + 1, sep="")
            return


if __name__ == "__main__":
    main()
# Original solution
h,w=list(map(int,input().split()))
s=[input().split() for i in range(h)]
al=[chr(i) for i in range(65,65+26)]
for i in range(h):
    if 'snuke' in s[i]:
        print((al[s[i].index('snuke')]+str(i+1)))

# Optimized solution
al=[chr(ord('A') + i) for i in range(26)]

H,W=list(map(int,input().split()))
S= [list(input().split()) for _ in range(H)]

for i in range(H):
  for j in range(W):
    if S[i][j]=="snuke":
      ans=al[j]+str(i+1)
      print(ans)
# Original solution
h, w = list(map(int, input().split()))
S = [input().split() for i in range(h)]
for i in range(h):
    for j in range(w):
        if S[i][j] == "snuke":
            print("%s%d" % ("ABCDEFGHIJKLMNOPQRSTUVWXYZ"[j], i+1))

# Optimized solution
def read2():
	return list(map(int, input().split()))
def read1():
	return input().split()

h, w = read2()
for i in range(h):
	s = read1()
	for j in range(w):
	    if s[j] == "snuke":
	        print("%c%d" % (65 + j, i+1))
# Original solution
h, w = list(map(int, input().split()))
s = []

for i in range(h):
    S = list(input().split())
    s.append(S)

for i in range(h):
    for j in range(w):
        if s[i][j] == "snuke":
            l = chr(ord("A") + j)
            print((l + str(i + 1)))
            exit()

# Optimized solution
h, w = list(map(int, input().split()))

for i in range(h):
    s = input().split()
    for j in range(w):
        if s[j] == "snuke":
            l = chr(ord("A") + j)
            print((l + str(i + 1)))
            exit()