Harryxun/stf_run huggingface dataset:
def is_prime(q):
    q = abs(q)
    if q == 2: return True
    if q < 2 or q&1 == 0: return False
    return pow(2, q-1, q) == 1


primeN = [2]
for i in range(2,1000):
    for j in range(len(primeN)):
        if i % primeN[j] == 0:
            break
        else:
            if j == len(primeN) - 1:
                primeN.append(i)
n=int(input())


for i in range(len(primeN)):
    if is_prime(sum(primeN[i:i+n+1])):
        for x in range(n):
            print(primeN[i+x])
        exit()


### FIXED CODE ###

def is_prime(q):
    q = abs(q)
    if q == 2: return True
    if q < 2 or q&1 == 0: return False
    return pow(2, q-1, q) == 1


primeN = [2]
for i in range(2,10000):
    for j in range(len(primeN)):
        if i % primeN[j] == 0:
            break
        else:
            if j == len(primeN) - 1:
                primeN.append(i)
n=int(input())
ans=[]

for i  in primeN:
    if i%5==1:
      ans.append(i)
    if len(ans)==n:
        for x in ans:
            print(x,end=" ")
        exit()
n = int(input())
s = input()

count = 0
for i in range(n):
  if s[i] == "A":
    if s[i+1] == "B":
      if s[i+2] == "C":
        count += 1
print(count)

### FIXED CODE ###

n = int(input())
s = input()

count = 0
for i in range(n-2):
  if s[i] == "A":
    if s[i+1] == "B":
      if s[i+2] == "C":
      	count += 1
print(count)
class Combination:
    def __init__(self, mod, max_n):
        self.MOD = mod
        self.MAX_N = max_n

        self.f = self.factorial(self.MAX_N)
        self.f_inv = [self.inv(x) for x in self.f]

    def inv(self,x):
        return pow(x, self.MOD-2, self.MOD)
    
    def factorial(self, n):
        res = [1]
        for i in range(1,n+1):
            res.append(res[-1] * i % self.MOD)
        return res
    
    def comb(self, n, r):
        return (self.f[n] * self.f_inv[r] % self.MOD) * self.f_inv[n-r] % self.MOD


X, Y = map(int,input().split())

if (X + Y) % 3 != 0:
    print(0)
    exit()

k, l = (2*Y-X)//3, (2*X-Y)//3
CB = Combination(10**9+7, k+l)
print(CB.comb(k+l,k))


### FIXED CODE ###

class Combination:
    def __init__(self, mod, max_n):
        self.MOD = mod
        self.MAX_N = max_n

        self.f = self.factorial(self.MAX_N)
        self.f_inv = [self.inv(x) for x in self.f]

    def inv(self,x):
        return pow(x, self.MOD-2, self.MOD)
    
    def factorial(self, n):
        res = [1]
        for i in range(1,n+1):
            res.append(res[-1] * i % self.MOD)
        return res
    
    def comb(self, n, r):
        return (self.f[n] * self.f_inv[r] % self.MOD) * self.f_inv[n-r] % self.MOD


X, Y = map(int,input().split())
k, l = (2*Y-X)//3, (2*X-Y)//3

if (X + Y) % 3 != 0 or k < 0 or l < 0:
    print(0)
    exit()

CB = Combination(10**9+7, k+l)
print(CB.comb(k+l,k))
import bisect

A, B, Q = map(int, input().split())
s = [int(input()) for _ in range(A)]
t = [int(input()) for _ in range(B)]
x = [int(input()) for _ in range(Q)]


for i in range(Q):

    insert_index = bisect.bisect_left(s,x[i])
    if insert_index >= A:
        insert_index = insert_index -1
        tmp1 = s[insert_index]
        tmp2 = s[insert_index]
        
    elif insert_index == 0:
        tmp1 = s[insert_index]
        tmp2 = s[insert_index]
    else:   
        tmp1 = s[insert_index]
        tmp2 = s[insert_index-1]
    
    insert_index = bisect.bisect_left(t,x[i])
    if insert_index >= B or insert_index == 0:
        insert_index = insert_index -1
        tmp3 = t[insert_index]
        tmp4 = t[insert_index]
        
    elif:
        tmp3 = t[insert_index]
        tmp4 = t[insert_index]
        
    else:
        tmp3 = t[insert_index]
        tmp4 = t[insert_index-1]
    
    result = 10 ** 11
    for j, k in ([0,1], [0,0], [1,0], [1,1]):
        tmp = 0
        if j == 0:
            tmp += abs(tmp1 - x[i])
            now = tmp1
        else:
            tmp += abs(tmp2 - x[i])
            now = tmp2
                
        if k == 0:
            tmp += abs(now - tmp3)
        else:
            tmp += abs(now - tmp4)
                
        result = min(tmp, result)
                
    print(result)



### FIXED CODE ###

import bisect
import itertools

#n桁のm値のbitを生成
def bit(n, m):
    bit_list = list(itertools.product([i for i in range(m)], repeat=n))
    return bit_list

A, B, Q = map(int, input().split())
s = [int(input()) for _ in range(A)]
t = [int(input()) for _ in range(B)]
x = [int(input()) for _ in range(Q)]


for i in range(Q):

    insert_index = bisect.bisect_left(s,x[i])
    if insert_index >= A:
        insert_index = insert_index -1
        tmp1 = s[insert_index]
        tmp2 = s[insert_index]
        
    else:   
        tmp1 = s[insert_index]
        tmp2 = s[insert_index-1]
    
    insert_index = bisect.bisect_left(t,x[i])
    if insert_index >= B:
        insert_index = insert_index -1
        tmp3 = t[insert_index]
        tmp4 = t[insert_index]
        
    else:
        tmp3 = t[insert_index]
        tmp4 = t[insert_index-1]
    
    result = 10 ** 11
    for j, k in ([0,1], [0,0], [1,0], [1,1]):
        tmp = 0
        if j == 0:
            tmp += abs(tmp1 - x[i])
            now = tmp1
        else:
            tmp += abs(tmp2 - x[i])
            now = tmp2
                
        if k == 0:
            tmp += abs(now - tmp3)
        else:
            tmp += abs(now - tmp4)
                
        result = min(tmp, result)
        
    for j, k in ([0,1], [0,0], [1,0], [1,1]):
        tmp = 0
        
        if k == 0:
            tmp += abs(x[i] - tmp3)
            now = tmp3
        else:
            tmp += abs(x[i]- tmp4)
            now = tmp4
            
        if j == 0:
            tmp += abs(now - tmp1)
        else:
            tmp += abs(now - tmp2)
                
        result = min(tmp, result)
                
    print(result)
b=input()
l=['A','C','G','T']
for i in range(4):
  if b==l[i]:
    print(l[4-i])

### FIXED CODE ###

b=input()
l=['A','C','G','T']
for i in range(4):
  if b==l[i]:
    print(l[3-i])
#coding:utf-8
#1_10_B 2015.4.14

import math

a,b,C = map(int,input().split())
C = math.radian(C)
h = b * math.sin(C)
S = a * h / 2
L = a + b + math.sqrt(a ** 2 + b ** 2 - 2 * a * b * math.cos(C))
print('{:.10f}\n{:.10f}\n{:.10f}'.format(S,L,h))

### FIXED CODE ###

#coding:utf-8
#1_10_B 2015.4.14

import math

a,b,C = map(int,input().split())
C = math.radians(C)
h = b * math.sin(C)
S = a * h / 2
L = a + b + math.sqrt(a ** 2 + b ** 2 - 2 * a * b * math.cos(C))
print('{:.10f}\n{:.10f}\n{:.10f}'.format(S,L,h))
import math
a,b,v=map(int,input().split())
theta1=0
theta2=math.pi/2
ans=10**9
if a*a*b/2>=v:
    while 1:
        tmp=math.tan((theta1+theta2)/2)-2*v/(a*b*b)
        if abs(tmp)<=10**(-6):
            ans=(theta1+theta2)/2
            break
        else:
            if tmp>0:
                theta2=(theta1+theta2)/2
            else:
                theta1=(theta1+theta2)/2
else:
    while 1:
        tmp=math.tan((theta1+theta2)/2)-(a**3)/(2*(a*a*b-v))
        if abs(tmp)<=10**(-6):
            ans=(theta1+theta2)/2
            break
        else:
            if tmp>0:
                theta2=(theta1+theta2)/2
            else:
                theta1=(theta1+theta2)/2
print(90-math.degrees(ans))

### FIXED CODE ###

import math
a,b,v=map(int,input().split())
theta1=0
theta2=math.pi/2
ans=10**9
if a*a*b-v==0:
    print(0)
    exit()
if a*a*b/2>=v:
    while 1:
        tmp=math.tan((theta1+theta2)/2)-2*v/(a*b*b)
        if abs(tmp)<=10**(-6):
            ans=(theta1+theta2)/2
            break
        else:
            if tmp>0:
                theta2=(theta1+theta2)/2
            else:
                theta1=(theta1+theta2)/2
else:
    while 1:
        tmp=math.tan((theta1+theta2)/2)-(a**3)/(2*(a*a*b-v))
        if abs(tmp)<=10**(-6):
            ans=(theta1+theta2)/2
            break
        else:
            if tmp>0:
                theta2=(theta1+theta2)/2
            else:
                theta1=(theta1+theta2)/2
print(90-math.degrees(ans))
X,N = list(map(int,input().split()))
P = list(map(int,input().split()))

P_n = [i for i in range(1,101,1) if i not in P]
abs_value = [abs(X-P_n[j]) for j in range(len(P_n))]
min_abs = min(abs_value)

for k in range(len(P_n)):
    if abs_value[k] == min_abs:
        print(P_n[k])
        break

### FIXED CODE ###

X, N = map(int, input().split())
 
p = list(map(int, input().split()))
 
p_none = [i for i in range(110) if i not in p]
p_none_sa = [abs(p_none[i]-X) for i in range(len(p_none))]
 
import sys
 
min_p_none = min(p_none_sa)
for i in range(len(p_none_sa)):
    if p_none_sa[i] == min_p_none:
        print(p_none[i])
        sys.exit()
n,k = map(int,input().split())
low = [0]*(10**5 * 3 + 1) #iで終わる長さ
for i in range(n):
    a = int(input())
    for j in range(max(0,a-k),a):
        low[a] = max(low[a],low[j] + 1)
    for j in range(a+1,a+k+1):
        low[a] = max(low[a],low[j] + 1)
ans = max(low)
print(ans)

### FIXED CODE ###

# セグ木
# 使う操作
#####segfunc#####
def segfunc1(x, y):
    return max(x, y)
#################

#####ide_ele#####
ide_ele1 = -float('inf')
#################

class SegTree:
    """
    init(init_val, ide_ele): 配列init_valで初期化 O(N)
    update(k, x): k番目の値をxに更新 O(logN)
    query(l, r): 区間[l, r)をsegfuncしたものを返す O(logN)
    """
    def __init__(self, init_val, segfunc, ide_ele):
        """
        init_val: 配列の初期値
        segfunc: 区間にしたい操作
        ide_ele: 単位元
        n: 要素数
        num: n以上の最小の2のべき乗
        tree: セグメント木(1-index)
        """
        n = len(init_val)
        self.segfunc = segfunc
        self.ide_ele = ide_ele
        self.num = 1 << (n - 1).bit_length()
        self.tree = [ide_ele] * 2 * self.num
        # 配列の値を葉にセット
        for i in range(n):
            self.tree[self.num + i] = init_val[i]
        # 構築していく
        for i in range(self.num - 1, 0, -1):
            self.tree[i] = self.segfunc(self.tree[2 * i], self.tree[2 * i + 1])

    def update(self, k, x):
        """
        k番目の値をxに更新
        k: index(0-index)
        x: update value
        """
        k += self.num
        self.tree[k] = x
        while k > 1:
            self.tree[k >> 1] = self.segfunc(self.tree[k], self.tree[k ^ 1])
            k >>= 1

    def query(self, l, r):
        """
        [l, r)のsegfuncしたものを得る
        l: index(0-index)
        r: index(0-index)
        """
        res = self.ide_ele

        l += self.num
        r += self.num
        while l < r:
            if l & 1:
                res = self.segfunc(res, self.tree[l])
                l += 1
            if r & 1:
                res = self.segfunc(res, self.tree[r - 1])
            l >>= 1
            r >>= 1
        return res

n,k = map(int,input().split())
low = [0]*(10**5 * 3 + 1)
seg = SegTree(low, segfunc1, ide_ele1)
for i in range(n):
    a = int(input())
    ma = seg.query(max(0,a-k), min(a+k+1,10**5 * 3 + 1))
    seg.update(a, ma+1)
ans = seg.query(0,10**5 * 3 + 1)
print(ans)
a, b = map(int, input().split())

def calc(n):
    count = 0
    for i in range(1, n+1):
        count += i
    reversed(count)

print(calc(b - a) - b)

### FIXED CODE ###

import sys
sys.setrecursionlimit(100000)
a, b = map(int, input().split())

def calc(n):
    if n == 1:
        return 1
    else:
        return calc(n-1) + n

print(calc(b - a) - b)
N,M = tuple(map(int,input().split()))
# matchlist = [tuple(map(lambda x:int(x)-1,input().split())) for i in range(M)]
#最大のグループの大きさを出す
friendlist = list(range(N))
# [所属先,[所属メンバー]]
gplist = [[i] for i in range(N)]

def getgroup(a):
    A = friendlist[a]
    if A == a:
        return a
    else:
        return getgroup(A)

def match(ab):
    A = getgroup(ab[0])
    B = getgroup(ab[1])
    if A==B:
        return
    else:
        gplist[A].extend(gplist[B])
        friendlist[B] = A

for i in range(M):
    # print(friendlist)
    # print(gplist)
    match(tuple(map(lambda x:int(x)-1,input().split())))

# print(friendlist)
# print(gplist)

print(max([len(item) for item in gplist]))

### FIXED CODE ###

N,M = tuple(map(int,input().split()))
# matchlist = [tuple(map(lambda x:int(x)-1,input().split())) for i in range(M)]
#最大のグループの大きさを出す
friendlist = list(range(N))
# [所属先,[所属メンバー]]
gplist = [[i] for i in range(N)]

def getgroup(a):
    A = friendlist[a]
    if A == a:
        return a
    else:
        return getgroup(A)

def match(ab):
    A = getgroup(ab[0])
    B = getgroup(ab[1])
    if A==B:
        return
    elif len(gplist[A])<len(gplist[B]):
        gplist[B].extend(gplist[A])
        friendlist[A] = B
    else:
        gplist[A].extend(gplist[B])
        friendlist[B] = A

for i in range(M):
    # print(friendlist)
    # print(gplist)
    match(tuple(map(lambda x:int(x)-1,input().split())))

# print(friendlist)
# print(gplist)

print(max([len(item) for item in gplist]))
A, B, C = map(int, input().split())
K = int(input())

M = max(A, B, C)

SUM = M*(2**K)

if M == A:
	SUM+=(B+C)

if M == B:
	SUM+=(A+C)

if M == C:
	SUM+=(A+B)

print(SUM)


### FIXED CODE ###

a, b = map(int, input().split())

if b < a:
	print(a-1)
else:
	print(a)
n = int(input())
aL = sorted(list(set(list(map(int, input().split(" "))))))

dp = [False for _ in range(100001)]

if len(aL) == 1 and n != 1:
    print(0)
    exit()

ans = 0
for a in aL:
    if not dp[a]:
        ans += 1
    else:
        continue
    c = 1
    while a * c <= 100000:
        dp[a * c] = True
        c += 1

print(ans)


### FIXED CODE ###

n = int(input())
aL = sorted(list(map(int, input().split(" "))))
# aL = sorted(list(set(aLP)))

dp = [False for _ in range(1000001)]

d = {}
for a in aL:
    if a in d:
        d[a] += 1
    else:
        d[a] = 1

ans = 0
for a in aL:
    if dp[a]:
        continue
    if d[a] > 1:
        c = 1
        while a * c <= 1000000:
            dp[a * c] = True
            c += 1
        continue
    ans += 1

    c = 1
    while a * c <= 1000000:
        dp[a * c] = True
        c += 1

print(ans)
print(A*B)

### FIXED CODE ###

a,b = map(int, input().split())
r = a * b
print(r)
H, W = map(int, input().split())
S = [input() for i in range(W)]
dd = ((0,-1),(-1,0),(0,1),(1,0))
for i in range(H):
  for j in range(W):
    if S[i][j] == '.':
      continue
    for dx,dy in dd:
      nx = j + dx
      ny = i + dy
      if 0<= nx < W and 0 <= ny < H and S[ny][nx] == '#':
        break
    else:
      print('No')
      quit()
print('Yes')

### FIXED CODE ###

H, W = map(int, input().split())
S = [input() for i in range(H)]
dd = ((0, -1), (-1, 0), (0, 1), (1, 0))
for i in range(H):
  for j in range(W):
    if S[i][j] == '.':
      continue
    for dx, dy in dd:
      nx = j + dx
      ny = i + dy
      if 0 <= nx < W and 0 <= ny < H and S[ny][nx] == '#':
        break
    else:
      print('No')
      quit()
print('Yes')
import heapq
import sys
input = sys.stdin.readline
'''
allinputs = iter(input().splitlines())
input = lambda : next(allinputs)
#'''
N, M = map(int, input().split())
jobs = []

for i in range(N):
	a, b = map(int, input().split())
	if a <= M:
		jobs.append((a, b))
	
jobs.sort()
index = 0
ans = 0
myheap = []

for day in range(M - 1, -1, -1):
	for i in range(index, N):
		if (day + jobs[i][0]) < (M + 1):
			heapq.heappush(myheap, -jobs[i][1])
		else:
			index = i
			break
			
	if len(myheap) > 0:
		ans -= heapq.heappop(myheap)
		
print(ans)

### FIXED CODE ###

import heapq
import sys
input = sys.stdin.readline
'''
allinputs = iter(input().splitlines())
input = lambda : next(allinputs)
#'''
N, M = map(int, input().split())
jobs = [[] for _ in range(M + 1)]

for _ in range(N):
	a, b = map(int, input().split())
	
	if a > M:
		continue
		
	jobs[a].append(b)
	
ans = 0
myheap = []

for i in range(M + 1):
	for j in jobs[i]:
		heapq.heappush(myheap, -j)
			
	if myheap:
		ans -= heapq.heappop(myheap)
		
print(ans)
import numpy as np
from numba import njit
MOD = 10**9 + 7

def main():
 
    N = int(input())
    aff = np.array([list(map(int, input().split())) for i in range(N)], dtype='int32')
    dpt = np.zeros((N+1, 1<<N), dtype='int64')
    dpt[0][0] = 1

    print(solve(N, aff, dpt))

@njit(cache=True)
def solve(N, aff, dpt):
    for i, row in enumerate(aff):
        for idx, v in enumerate(row):
            if v == 1:
                dpt[i+1][(1<<idx):] += dpt[i][:-(1<<idx)]
        dpt[i+1] %= MOD
    return dpt[N][(1<<N)-1]

if __name__ == '__main__':
    main()

### FIXED CODE ###

import numpy as np

MOD = 10**9 + 7
 
N = int(input())
aff = np.array([map(int, input().split()) for i in range(N)])
dpt = np.zeros((N+1, 1<<N), dtype='int64')
dpt[0][0] = 1

for i, row in enumerate(aff):
    for idx, v in enumerate(row):
        if v == 1:
            dpt[i+1][(1<<idx):] += dpt[i][:-(1<<idx)]
    dpt[i+1] %= MOD

print(dpt[N][(1<<N)-1])
s = input().strip()
a = -1
b = -1
if s[0]==s[1]:
    a = 1
    b = 2
elif s[1]==s[2]:
    a = 2
    b = 3
elif s[0]==s[2]:
    a = 1
    b = 3
else:
    for i in range(3,len(s)):
        if s[i]==s[i-1]:
            a = i
            b = i+1
            break
        elif s[i]==s[i-2]:
            a = i-1
            b = i+1
            break
print(a,b)

### FIXED CODE ###

s = input().strip()
a = -1
b = -1
if s[0]==s[1]:
    a = 1
    b = 2
elif len(s)>2 and s[1]==s[2]:
    a = 2
    b = 3
elif len(s)>2 and s[0]==s[2]:
    a = 1
    b = 3
else:
    for i in range(3,len(s)):
        if s[i]==s[i-1]:
            a = i
            b = i+1
            break
        elif s[i]==s[i-2]:
            a = i-1
            b = i+1
            break
print(a,b)
from collections import Counter
n = int(input())
s = [list(map(int,input().split())) for i in range(n)]
c = []
for i in range(n):
    for j in range(i+1,n):
        x = s[j][0] - s[i][0]
        y = s[j][1] - s[i][1]
        c.append(str(x) + " " + str(y))
 
r = Counter(c)
q = list(r.values())
q1 = max(q)
print(n-q1)

### FIXED CODE ###

from collections import defaultdict
n = int(input())
s = [list(map(int,input().split())) for i in range(n)]
s.sort()
c = []
if n == 1:
    print(1)
else:
    for i in range(n):
        for j in range(i+1,n):
            x = s[j][0] - s[i][0]
            y = s[j][1] - s[i][1]
            c.append(str(x) + " " + str(y))
    r = defaultdict(int)
    for g in c:
        r[g] += 1
    q = list(r.values())
    q1 = max(q)
    print(n-q1)
def search_dist(g, dist, e):
    for b, c in g.get(e):
        if dist[b] < 10**16:
            continue
        dist[b] = dist[e] + c
        search_dist(g, dist, b)

def main():
    g = {}
    N = int(input())
    for _ in range(N-1):
        a, b, c = list(map(int, input().split(' ')))
        g[a] = g.get(a, []) + [(b, c)]
        g[b] = g.get(b, []) + [(a, c)]
    Q, K = list(map(int, input().split(' ')))
    dist = [10**16]*(N+1)
    dist[K] = 0
    search_dist(g, dist, K)
    cood = []
    for _ in range(Q):
        cood.append(list(map(int, input().split(' '))))

    for x, y in cood:
        print(dist[x]+dist[y])

if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
sys.setrecursionlimit(int(1e5+10))

def search_dist(g, dist, e):
    for b, c in g.get(e):
        if dist[b] is not None:
            continue
        dist[b] = dist[e] + c
        search_dist(g, dist, b)

def main():
    g = {}
    N = int(input())
    for i in range(N+1):
        g[i] = []
    for _ in range(N-1):
        a, b, c = list(map(int, input().split(' ')))
        g[a] += [(b, c)]
        g[b] += [(a, c)]
    Q, K = list(map(int, input().split(' ')))
    dist = [None]*(N+1)
    dist[K] = 0
    search_dist(g, dist, K)
    cood = []
    for _ in range(Q):
        cood.append(list(map(int, input().split(' '))))

    for x, y in cood:
        print(dist[x]+dist[y])

if __name__ == '__main__':
    main()
from sys import stdin
import sys
sys.setrecursionlimit(10**8)

def nextLine(): return next(stdin)
def nextStrList(): return nextLine().split()
def nextIntList(): return [int(_) for _ in nextStrList()]


def main():
	k=nextIntList()[0]
	if k<=9:
		print(k)
		sys.exit(0)
	num=[0,1]
	for i in range(10, k):
# 		print(num)
		if all([n==9 for n in num]):
			num=[*[0 for d in range(len(num))], 1]
			continue
		
		for di in range(len(num)):
			if di==0:
				if num[di]<=num[di+1] and num[di]<9:
					num[di]+=1
					break
			elif di<len(num)-1:
				if num[di]<=num[di+1] and num[di]<9 and num[di]<=num[di-1]:
					num[di]+=1
					break
			else: #di==len(num)-1
				num[di]+=1
	
		for dii in range(di-1, -1,-1):
			if num[dii+1]==0:
				num[dii]=0
			else:
				num[dii]=num[dii+1]-1 
	
	print("".join(str(n) for n in reversed(num)))

if __name__=="__main__":
	main()


### FIXED CODE ###


from sys import stdin
import sys
sys.setrecursionlimit(10**8)

def nextLine(): return next(stdin)
def nextStrList(): return nextLine().split()
def nextIntList(): return [int(_) for _ in nextStrList()]


def main():
	k=nextIntList()[0]
	if k<=9:
		print(k)
		sys.exit(0)
	num=[0,1]
	for i in range(10, k):
# 		print(num)
		if all([n==9 for n in num]):
			num=[0 for d in range(len(num))]
			num.append(1)
			continue
		
		for di in range(len(num)):
			if di==0:
				if num[di]<=num[di+1] and num[di]<9:
					num[di]+=1
					break
			elif di<len(num)-1:
				if num[di]<=num[di+1] and num[di]<9 and num[di]<=num[di-1]:
					num[di]+=1
					break
			else: #di==len(num)-1
				num[di]+=1
	
		for dii in range(di-1, -1,-1):
			if num[dii+1]==0:
				num[dii]=0
			else:
				num[dii]=num[dii+1]-1 
	
	print("".join(str(n) for n in reversed(num)))

if __name__=="__main__":
	main()
n=int(input())
w = list(map(int,input().split()))
sum_w=sum(w)
sum_a=0
sa=[]
for i in range(n):
    sum_a += w[i]
    sa.append(abs(sum_w - sum_a * 2))
print(min(sa))

### FIXED CODE ###

s=input()
i=0
a=0
for i in range(len(s)//2):
    if s[0+i]!=s[len(s)-1-i]:
        a+=1
    i+=0
print(a)
81 58

### FIXED CODE ###

X, Y = map(int, input().split())
print(int(X + Y/2))