Harryxun/stf_run huggingface dataset:
n = int(input())
v = list(map(int, input()))

array1 = v[::2]
array2 = v[1::2]

dict1 = {}
dict2 = {}
for i in array1:
  if i not in dict1:
    dict1[i] = 1
  else:
    dict1[i] = dict1[i] + 1

for i in array2:
  if i not in dict2:
    dict2[i] = 1
  else:
    dict2[i] = dict2[i] + 1

sort_array1 = []
sort_array2 = []
for k, v in sorted(dict1.items(), key=lambda x: -x[1]):
    sort_array1.append({k:v})
for k, v in sorted(dict2.items(), key=lambda x: -x[1]):
    sort_array2.append({k:v})

one_num1 = 0
one_num2 = 0

for k1,v1 in sort_array1[0].items():
  if len(sort_array1) != 1:
    one_num1 = len(array1) - v1
  for k2,v2 in sort_array2[0].items():
    if len(sort_array2) != 1:
      one_num2 = len(array2) - v2
    if k1 != k2:
      print(one_num1 + one_num2)
      break

    if len(sort_array1) == 1 and len(sort_array2) == 1:
      print(1)
      break
    if len(sort_array1) == 1:
      for k,v in sort_array2[1].items():
        two_num2 = v
      print(1+two_num2)
      break
    if len(sort_array2) == 1:
      for k,v in sort_array1[1].items():
        two_num1 = v
      print(1+two_num1)
      break

    for k,v in sort_array1[1].items():
      two_num1 = v
    for k,v in sort_array2[1].items():
      two_num2 = v
    if two_num1 <= two_num2:
      print (one_num1 + two_num2)
    else:
      print (one_num2 + two_num1)

### FIXED CODE ###

n = int(input())
v = list(map(int, input().split()))

array1 = v[::2]
array2 = v[1::2]

dict1 = {}
dict2 = {}
for i in array1:
  if i not in dict1:
    dict1[i] = 1
  else:
    dict1[i] = dict1[i] + 1

for i in array2:
  if i not in dict2:
    dict2[i] = 1
  else:
    dict2[i] = dict2[i] + 1

sort_array1 = []
sort_array2 = []
for k, v in sorted(dict1.items(), key=lambda x: -x[1]):
    sort_array1.append({k:v})
for k, v in sorted(dict2.items(), key=lambda x: -x[1]):
    sort_array2.append({k:v})

one_num1 = 0
one_num2 = 0

for k1,v1 in sort_array1[0].items():
  if len(sort_array1) != 1:
    one_num1 = len(array1) - v1
  for k2,v2 in sort_array2[0].items():
    if len(sort_array2) != 1:
      one_num2 = len(array2) - v2
    if k1 != k2:
      print(one_num1 + one_num2)
      break

    if len(sort_array1) == 1 and len(sort_array2) == 1:
      print(len(array1))
      break
    if len(sort_array1) == 1:
      for k,v in sort_array2[1].items():
        two_num2 = v
      print(1+two_num2)
      break
    if len(sort_array2) == 1:
      for k,v in sort_array1[1].items():
        two_num1 = v
      print(1+two_num1)
      break

    for k,v in sort_array1[1].items():
      two_num1 = len(array1) - v
    for k,v in sort_array2[1].items():
      two_num2 = len(array2) - v
    if two_num1 <= two_num2:
      print (one_num2 + two_num1)
    else:
      print (one_num1 + two_num2)
N, X, Y = map(int, input().split())
count = [0] * (N-1)
for i in range(N):
    i += 1
    for j in range(N-i):
        j += i + 1
        if i < j:
            normal = j-i
            xtoy = abs(X-i) + 1 + abs(Y-j)
            ytox = abs(Y-i) + 1 + abs(X-j)
            minRoute = min([normal, xtoy, ytox])
            count[minRoute-1] += 1
for c in count:
    print(c)


### FIXED CODE ###

S = input()
if S[2] == S[3] and S[4] == S[5]:
    print('Yes')
else:
    print('No')
N = int(input())
A = int(input())
B = int(input())
if N == 1:
    print("Hello World")
else:
    print(A + B)

### FIXED CODE ###

N = int(input())
if N == 1:
    print("Hello World")
else:
    A = int(input())
    B = int(input())
    print(A + B)
import copy
N, K = map(int, input().split())
dic = {}
ans = []
uniq = []
etc = []
def calc_ans(ans):
    x = 0
    tmp = 0
    for i in range(K):
      tmp += ans[i][0]
      x += ans[i][1]
    return tmp + (x * x)

for i in range(N):
    l = list(map(int, input().split()))
    if dic.get(l[0]):
        dic[l[0]].append(l[1])
    else:
        dic[l[0]] = [l[1]]
if N <= K:
    ans = 0
    for i in dic.keys():
        ans += sum(dic[i])
    ans += len(dic.keys()) * len(dic.keys())
    print(ans)
    exit()
for t in dic.keys():
    dic[t].sort(reverse=True)
    uniq.append((dic[t][0], t))
uniq.sort(reverse=True)
for i in range(K):
  ans.append((uniq[i][0], 1))
  for n in dic[uniq[i][1]][1:]:
      if n <= uniq[K-1][0]:
          break
      etc.append((n, 0))
etc.sort(reverse=True)
ans_res = calc_ans(ans)
for n in etc:
    tmp = copy.copy(ans)
    tmp[-1] = n
    tmp_res = calc_ans(tmp)
    if ans_res > tmp_res:
        print(ans_res)
        exit()
    else:
        ans = tmp
        ans_res = tmp_res
print(tmp_res)

### FIXED CODE ###

N,K = map(int,input().split())
td = [[int(i) for i in input().split()] for _ in range(N)]
td.sort(key=lambda x:x[1],reverse=True)
ans = 0
ls = set()
dl = []
for i in range(K):
    ans += td[i][1]
    if not td[i][0] in ls:
        ls.add(td[i][0])
    else:
        dl.append(td[i][1])
ans = ans + len(ls)**2
res = ans
for i in range(K,N):
    if not dl:
        break
    if td[i][0] in ls:
        continue
    ans += len(ls)*2+1
    ans += td[i][1]
    ans -= dl[-1]
    del dl[-1]
    res = max(res,ans)
    ls.add(td[i][0])
print(res)
a,o,b = input().split()
print(a + int(o+b))

### FIXED CODE ###

a,o,b = input().split()
print(int(a) + int(o+b))
#ABC042.B
N,L = map(int,input().split())
s = [input()for_in range(n)]
s.sort()
ans=''
for i in range(s):
    ans += s[i]
print(ans)

### FIXED CODE ###

#ABC042.B
N,L = map(int,input().split())
s = [input()for _ in range(N)]
s.sort()
ans=''
for i in range(N):
    ans =ans +s[i]
print(ans)
# -*- cod:utf-8 -*-
import sys

sys.setrecursionlimit(100000000)

def dfs(x, y, sym):
    field[x][y] = '.'
    for dx in range(-1,2):
        if dx==-1 or dx==1:
            nx = x + dx
            ny = y
            if(nx>=0 and nx<N and 0<=ny and ny<M and field[nx][ny]==sym):
                dfs(nx, ny, sym)
        else:
            nx = x
            for dy in [-1,1]:
                ny = y + dy
                if(nx>=0 and nx<N and 0<=ny and ny<M and field[nx][ny]==sym):
                    dfs(nx, ny, sym)
def solve():
    res = 0
    flg=0
    for i in range(N):
        for j in range(M):
            if not field[i][j] == '.':
                if field[i][j] == '@':
                    dfs(i, j, '@')
                    res += 1
                elif field[i][j] == '#':
                    dfs(i, j, '#')
                    res += 1
                else:
                    dfs(i, j, '*')
                    res += 1
    print(res)


while True:
    datas = sys.stdin.readlines()
    data = datas[0].split(' ')
    N = int(data[0])
    M = int(data[1])
    if ' ' in data[-1]:
        data2 = datas[-1].split(' ')
        L = int(data2[0])
        K = int(data2[1])
        if L==0 and K==0:
            break
    field = [[0 for i in range(N) ]for j in range(M)]

    for i in range(M):
        field[i] = list(datas[i+1])[0:-1]
    solve()

### FIXED CODE ###

# -*- coding:utf-8 -*-
import sys
def dfs(x, y, sym):
	tile[x][y] = "."
	for i in range(len(DX)):
		nx = x + DX[i]
		ny = y + DY[i]
		if (0<=nx and nx<N and 0<=ny and ny<M and tile[nx][ny] is sym):
			dfs(nx, ny, sym)

def solve():
	res = 0
	for i in range(N):
		for j in range(M):
			sym = tile[i][j]
			if tile[i][j] != ".":
				if tile[i][j] is sym:
					dfs(i, j, sym)
					res += 1
	print(res)

counter=0
DX = [-1,0,1,0]
DY = [0,-1,0,1]
sys.setrecursionlimit(10**7)
while True:
	line = input()
	if " " in line:
		nums = line.split(" ")
		N = int(nums[0])
		M = int(nums[1])
		tile = [[0 for i in range(M)] for j in range(N)]
	else:
		tile[counter-1] = list(line)
	if N is 0 and M is 0:
		break
	counter += 1
	if counter-1 is N:
		solve()
		counter = 0
W, H, x, y = map(int, input().split())
if (x == W and y == H) or (x == 0 and y == 0) or (x == W and y == 0) or (x == 0 and y == H):
    print(W*H, 0)
else:
    # 横分割の時の最小値を求める
    A = min((H-y)*W, y*W)
 
    # 縦分割の時の最小値を求める
    B = min((W-x)*H, x*H)
 
    # 最後に最大の方を選ぶ
    # このときA=Bなら複数あるということ
    if A == B:
        print(A, 1)
    else:
        print(max(A, B), 0)

### FIXED CODE ###

X, A = map(int, input().split())
if X < A:
    print(0)
else:
    print(10)
w,h,x,y,r = map(int, input().split())

a = True

if x < r or w - r < x :
    a = False

if y < r or h - r < y :
    a = False


if a = True:
    print("Yes")
else:
    print("No")



### FIXED CODE ###

w,h,x,y,r = map(int, input().split())

a = True

if x < r or w - r < x :
    a = False

if y < r or h - r < y :
    a = False


if a:
    print("Yes")
else:
    print("No")
N = int(input())
A = map(int, input().split())
xyz,T = [0,0,0],1
for Ai in A:
  n_Ai = xyz.count(Ai)
  T = (T*n_Ai))%1000000007
  if n_Ai>0: xyz.count(Ai)xyz[xyz.index(Ai)] += 1
print(T)

### FIXED CODE ###

N = int(input())
A = map(int, input().split())

T = 1
xyz = [0]*3
for Ai in A:
  if xyz.count(Ai)>0:
    T = (T * xyz.count(Ai))%1000000007
    xyz[xyz.index(Ai)] += 1
  else:
    T = 0
    break
print(T)
def main():
    import math
    import collections
    N = int(input())
    A = list(map(int, input().split()))
    tt = 0
    #ans = list()
    ann = 0

    def comb(m, n):
        return math.factorial(m) // (math.factorial(n) * math.factorial(m - n))
    '''
    def A_count(n):
        if n in memo:
            return memo[n]
        h = A.count(i)
        memo[n] = A.count(i)
        return h
    '''

    C = collections.Counter(A)
    for i in C.values():
        f = i
        if f>=2:
            tt = tt + comb(f, 2)

    for i in A:
        f = C[A[i]] #A_count(A[i])
        if f>=3:
            ann = (tt - comb(f, 2) + comb(f-1, 2))
        elif f==2:
            ann = tt - comb(f, 2)
        else:
            ann = tt
        print(ann)

    #for i in ans:
    #    print(i)


if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
    import math
    import collections
    N = int(input())
    A = list(map(int, input().split()))
    tt = 0
    #ans = list()
    ann = 0

    def comb(m, n):
        #return math.factorial(m) // (math.factorial(n) * math.factorial(m - n))
        return ((m - 1 + 1) / 1) * (m - 2 + 1) / 2

    '''
    def A_count(n):
        if n in memo:
            return memo[n]
        h = A.count(i)
        memo[n] = A.count(i)
        return h
    '''

    C = collections.Counter(A)
    for i in C.values():
        if i>=2:
            tt = tt + comb(i, 2)

    for i in A:
        f = C[i] #A_count(A[i])
        if f>=3:
            ann = (tt - comb(f, 2) + comb(f-1, 2))
        elif f==2:
            ann = tt - comb(f, 2)
        else:
            ann = tt
        print(int(ann))

    #for i in ans:
    #    print(i)


if __name__ == '__main__':
    main()
# encoding:utf-8
import copy
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import fractions #最小公倍数などはこっち
import math
import sys

sys.setrecursionlimit(2000)

mod = 10**9+7

N = int(input())
graph = [set() for i in range(N+1)]

for i in range(N-1):
    u,v,w = map(int,input().split())
    u -= 1
    v -= 1
    w = w % 2
    graph[u].add((v,w))
    graph[v].add((u,w))


res = [None for i in range(N+1)]

# v は今見ている頂点，p はｖの親
def dfs(node,p,color): # Depth First Serch
    res[node] = color
    for new_node,w in graph[node]:
        if new_node == p:
            pass
        else:
            if w == 1:dfs(new_node,node,1-color)
            else:dfs(new_node,node,color)
#tree 探索　
# vは頂点，ｐは親
dfs(0,-1,0)

for i in range(N):
    print(res[i])


### FIXED CODE ###

# encoding:utf-8
import copy
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import fractions #最小公倍数などはこっち
import math
import sys



mod = 10**9+7
sys.setrecursionlimit(mod)

N = int(input())
graph = [set() for i in range(N+1)]

for i in range(N-1):
    u,v,w = map(int,input().split())
    u -= 1
    v -= 1
    w = w % 2
    graph[u].add((v,w))
    graph[v].add((u,w))


res = [None for i in range(N+1)]

# v は今見ている頂点，p はｖの親
def dfs(node,p,color): # Depth First Serch
    res[node] = color
    for new_node,w in graph[node]:
        if new_node == p:
            pass
        else:
            if w == 1:dfs(new_node,node,1-color)
            else:dfs(new_node,node,color)
#tree 探索　
# vは頂点，ｐは親
dfs(0,-1,0)

for i in range(N):
    print(res[i])
# -*- coding: utf-8 -*-
from itertools import product
from heapq import heappop, heappush
import numpy as np


def small_dp(N,k,X):
    if k == 0:
        return N
    if k == 1:
        return X[0][1]*(N//X[0][0]) + N%X[0][0]
    if k == 2:
        return max(X[1][1]*i + X[0][1]*((N-i*X[1][0])//X[0][0]) + (N-i*X[1][0])%X[0][0] for i in range(N//X[1][0]+1))
    if k == 3:
        Y = sorted([(-x[1]/x[0], -x[0], x[1]) for x in X])
        X = [(-y[1], y[2]) for y in Y]
        M = np.arange(N+1)
        dp0 = X[0][1]*(M//X[0][0]) + M%X[0][0]
        d = X[1][1]*(M//X[1][0]) + M%X[1][0]
        dp1f = [np.max(dp0[w::-1] + d[:w+1]) for w in range(N,-1,-1)[:X[0][0]*X[2][0]*X[2][0]]]
        dp1l = [np.max(dp0[w::-1] + d[:w+1]) for w in range(X[0][0]*X[2][0]*X[2][0],-1,-1)]
        f = np.max(dp1f + X[2][1]*(M[:X[0][0]*X[2][0]*X[2][0]]//X[2][0]) + M[:X[0][0]*X[2][0]*X[2][0]]%X[2][0])
        l = np.max(dp1l + X[2][1]*(M[-X[0][0]*X[2][0]*X[2][0]-1:]//X[2][0]) + M[-X[0][0]*X[2][0]*X[2][0]-1:]%X[2][0])
        return max(f,l)

def solve():
    N = int(input())
    A = list(map(int, input().split()))
    B = list(map(int, input().split()))
    
    for C in ((A,B), (B,A)):
        *X, = filter(lambda c: int.__sub__(*c)<0, zip(*C))

        N = small_dp(N, len(X), X)
    res = N

    return str(res)

if __name__ == '__main__':
    print(solve())


### FIXED CODE ###

# -*- coding: utf-8 -*-
from itertools import product
from heapq import heappop, heappush

def small_dp(N,A,B):
    *X, = filter(lambda c: int.__sub__(*c)<0, zip(A,B))
    k = len(X)
    if k == 0:
        return N
    if k == 1:
        return X[0][1]*(N//X[0][0]) + N%X[0][0]
    if k == 2:
        c = 0
        for i in range(N//X[0][0]+1):
            j = (N-i*X[0][0])//X[1][0]
            c = max(X[0][1]*i + X[1][1]*j + (N-i*X[0][0])%X[1][0], c)
        return c
    if k == 3:
        if (N//X[1][0]+1)*(N//X[0][0]+1) <= 10**6 :
            return max(X[0][1]*i + max(X[1][1]*j + X[2][1]*((N-i*X[0][0]-j*X[1][0])//X[2][0]) + ((N-i*X[0][0]-j*X[1][0])%X[2][0]) for j in range((N-i*X[0][0])//X[1][0]+1)) for i in range(N//X[0][0]+1))
        else:
            import numpy as np
            dp = np.zeros(N+1, dtype=int)
            for w in range(1,N+1):
                dp[w] = max(dp[w-X[i][0]]+X[i][1] if w>=X[i][0] else w for i in range(k))
            N = dp[-1]
            return N

def solve():
    N = int(input())
    A = list(map(int, input().split()))
    B = list(map(int, input().split()))
    res = small_dp(small_dp(N, A, B), B, A)

    return str(res)

if __name__ == '__main__':
    print(solve())
import collections

n = int(input())
p = [input() for i in range(n)]

c = collections.Counter(p)
m = c.most_common()
most = m[0][1]

answer = []

answer.append(m[0][0])

for i in range(len(m)-1):
    if m[i+1][1] == most:
        answer.append(m[i+1][0])
    else:
        break

for output in sorted(answer):
    print(output)
return

### FIXED CODE ###

import collections

def main():
    n = int(input())
    p = [input() for i in range(n)]

    c = collections.Counter(p)
    m = c.most_common()
    most = m[0][1]

    answer = []

    answer.append(m[0][0])

    for i in range(len(m)-1):
        if m[i+1][1] == most:
            answer.append(m[i+1][0])
        else:
            break

    for output in sorted(answer):
        print(output)
    return


main()
A , B, C = int(input()).split(' ')
temp = 0
temp = A
A = B
B = temp
temp = A
A = C
C = temp
print(f'{A} {B} {C}')

### FIXED CODE ###

A,B,C = [int(i) for i in input().split(' ')]


A, B = B, A
A, C = C, A

print('{} {} {}'.format(A, B, C))
A,B = map(float, input().split())
ans = Decimal(A)*Decimal(B)
print(int(ans))

### FIXED CODE ###

from decimal import Decimal
A,B = input().split()
print(int(int(A)*Decimal(B)))
while True:
    m,f,r = map(int, input().split())
    if m == f == r ==-1:
        break
    elif (m+f) >= 80:
        print("A")
    elif (m+f) < 80 and (m+f) >= 65:
        print("B")
    elif ((m+f) < 65 and (m+f) >= 50) or (((m+f) < 50 and (m+f) >= 30 and (m != -1 and f != -1)) and r >= 50)
        print("C")
    elif (m+f) < 50 and (m+f) >= 30 and (m != -1 and f != -1):
        print("D")
    else:
        print("F")


### FIXED CODE ###

while True:
    m,f,r = map(int, input().split())
    if m == f == r ==-1:
        break
    elif (m+f) >= 80:
        print("A")
    elif (m+f) < 80 and (m+f) >= 65:
        print("B")
    elif ((m+f) < 65 and (m+f) >= 50) or (((m+f) < 50 and (m+f) >= 30 and (m != -1 and f != -1)) and r >= 50):
        print("C")
    elif (m+f) < 50 and (m+f) >= 30 and (m != -1 and f != -1):
        print("D")
    else:
        print("F")
N, K, L = map(int, input().split())

par = [i for i in range(N)]
size = [1] * N


def find(x, P):
    if P[x] == x:
        return x
    else:
        return find(P[x], P)

def unite(x, y):
    root_x = find(x, par)
    root_y = find(y, par)
    par[root_x] = root_y

par2 = [i for i in range(N)]
def unite2(x, y):

    x = find(x, par2)
    y = find(y, par2)

    if x != y:
        # xとyの属している集合が異なる時
        par2[x] = y
        s = size[x] + size[y]
        size[y] = s

for _ in range(K):
    p, q = map(int, input().split())
    find(q-1, par)

    unite(p-1, q-1)

### FIXED CODE ###

from collections import Counter

n,k,l=map(int,input().split())
city1=[i for i in range(n)]
city2=[i for i in range(n)]

def root(c,x):
  if x==c[x]:
    return x
  else:
    c[x]=root(c,c[x])
    return c[x]

def union(c,x,y):
  rx=root(c,x)
  ry=root(c,y)
  if rx>ry:
    c[rx]=ry
  else:
    c[ry]=rx

for i in range(k):
  a,b=map(int,input().split())
  union(city1,a-1,b-1)
for i in range(l):
  a,b=map(int,input().split())
  union(city2,a-1,b-1)
r=[]
for i in range(n):
  r.append((root(city1,i),root(city2,i)))
c=Counter(r)
for i in range(n):
  ans=c[r[i]]
  if i==n-1:
    print(ans)
  else:
    print(ans,end=' ')
n,x=map(int,input().split())
pos=list(map(int,input().split()))
pos2=[abs(p-x) for p in pos]
def make_divisor_list(num):
    if num < 1:
        return []
    elif num == 1:
        return [1]
    else:
        divisor_list = []
        divisor_list.append(1)
        for i in range(2, num // 2 + 1):
            if num % i == 0:
                divisor_list.append(i)
        divisor_list.append(num)
 
        return divisor_list
 
minpos= min(pos2)
divs=make_divisor_list(minpos)[::-1]
if divs[0]==1:ans==1
else:
  for j in divs:
    if all(x%j==0 for x in pos2):
        ans=j
        break
print(ans)

### FIXED CODE ###

n,x=map(int,input().split())
pos=list(map(int,input().split()))
pos2=[abs(p-x) for p in pos]
def make_divisor_list(num):
    if num < 1:
        return []
    elif num == 1:
        return [1]
    else:
        divisor_list = []
        divisor_list.append(1)
        for i in range(2, num // 2 + 1):
            if num % i == 0:
                divisor_list.append(i)
        divisor_list.append(num)
 
        return divisor_list

if n==1: ans=pos2[0]
else:
    minpos= min(pos2)
    divs=make_divisor_list(minpos)[::-1]
    if divs[0]==1:ans=1
    else:
        for j in divs:
            if all(x%j==0 for x in pos2):
                ans=j
                break
print(ans)
s=input()
if s="Sunny":
  print("Cloudy")
if s="Cloudy":
  print("Rainy")
if s="Rainy":
  print("Sunny")

### FIXED CODE ###

s=input()
if s=="Sunny":
  print("Cloudy")
if s=="Cloudy":
  print("Rainy")
if s=="Rainy":
  print("Sunny")
n = int(input())
x = sorted(map(int, input().split()))
x1 = x[n/2-1]
x2 = x[n/2]
for i, xx in enumerate(x):
    if xx <= x1:
        print(x2)
    else:
        print(x1)


### FIXED CODE ###

n=int(input())
x=list(map(int,input().split()))
N=int(n/2)
y=sorted(x)
a=y[N-1]
b=y[N]
for j in range(n):
    if x[j]<=a:
        print(b)
    else:
        print(a)
n = int(input())
l = [i for i in range(1, n + 1) if i % 2 == 1]
print(l)
cnt = 0
for w in l:
i = w
fct = []
b, e = 3, 0
while b * b < w:
        while i % b == 0:
        i = i // b
        e = e + 1
        if e > 0:
        fct.append((b, e))
        b, e = b + 1, 0
if i > 1:
        fct.append((i, 1))
if len(fct) > 1:
        r = 1
        for j in fct:
        r = r * (j[1] + 1)
elif len(fct) == 1:
        r = fct[0][1] + 1
else:
        r = 0
if r == 8:
        print(w, fct, r)
        cnt += 1
print(cnt)

### FIXED CODE ###

n = int(input())
cnt = 0
for i in range(1, n + 1, 2):
    num_fact = 0
    for j in range(1, i + 1):
        if i % j == 0:
            num_fact += 1
    if num_fact == 8:
        cnt += 1
print(cnt)
#m = imt(imput())
#L = list(map(imt, imput().split()))
import math
import sys

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


def aa(N,AB):
    AB.sort(key=lambda x: x[1])
    for i in range(N-1):
        clk += AB[i][0]
        if clk >= AB[i][1]:
            flg = False
            break
    if flg:
        return "Yes"
    else:
        return "No"
print(aa(N,AB))

### FIXED CODE ###

#m = imt(imput())
#L = list(map(imt, imput().split()))
import math
import sys

N = int(input())
AB = [list(map(int, input().split())) for i in range(N)]
AB.sort(key=lambda x: x[1])

def aa(N,AB):
    clk = 0
    flg = True
    for i in range(N):
        clk += AB[i][0]
        if clk > AB[i][1]:
            flg = False
            break
    if flg:
        return "Yes"
    else:
        return "No"
print(aa(N,AB))
h,w=map(int,input().split())
g=[]
for i in range(h):
    g.append(list(input()))
q=[]
v=[[0 for i in range(w)] for j in range(h)]
for i in range(h):
    for j in range(w):
        if g[i][j]=='#':
            q.append([i,j])
            v[i][j]=1
ans=0
while len(q)>0:
    tmp=[]
    for i in q:
        a=i[0]
        b=i[1]
        if a==0:
            hi=[1]
        elif a==h-1:
            hi=[-1]
        else:
            hi=[1,-1]
        if b==0:
            wi=[1]
        elif b==w-1:
            wi=[-1]
        else:
            wi=[1,-1]
        for c in hi:
            for d in wi:
                if v[a+c][b+d]==0:
                    tmp.append([a+c,b+d])
                    v[a+c][b+d]=1
    q=tmp
    ans+=1
print(ans-1)

### FIXED CODE ###

h,w=map(int,input().split())
g=[]
for i in range(h):
    g.append(list(input()))
q=[]
v=[[0 for i in range(w)] for j in range(h)]
for i in range(h):
    for j in range(w):
        if g[i][j]=='#':
            q.append([i,j])
            v[i][j]=1
ans=0
while len(q)>0:
    tmp=[]
    for i in q:
        a=i[0]
        b=i[1]
        if a==0:
            hi=[1]
        elif a==h-1:
            hi=[-1]
        else:
            hi=[1,-1]
        if h==1:
            hi=[]
        if b==0:
            wi=[1]
        elif b==w-1:
            wi=[-1]
        else:
            wi=[1,-1]
        if w==1:
            wi=[]
        for c in hi:
            if v[a+c][b]==0:
                tmp.append([a+c,b])
                v[a+c][b]=1
        for d in wi:
            if v[a][b+d]==0:
                tmp.append([a,b+d])
                v[a][b+d]=1
    q=tmp
    ans+=1
print(ans-1)
import numpy as np
import sys
readline = sys.stdin.readline
read = sys.stdin.read

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

N = II()
A = LII()
A = np.array(A)

if sum(A % 2) == 0:
    print(min(A))
else:
    a = min(A)
    AA = np.array(A)

    while True:
        AA = AA % a
        if len(AA[AA > 0]) > 0:
            a = min(AA[AA > 0])
        else:
            break
    A %= a
    print(min(A[A>0]))

### FIXED CODE ###

import numpy as np
import fractions
import sys
readline = sys.stdin.readline
read = sys.stdin.read

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

N = II()
A = LII()

b = min(A)
for a in A:
    b = fractions.gcd(a, b)
print(b)