Harryxun/stf_run huggingface dataset:
def main():
    nums = [0, 2, 5, 5, 4, 5, 6, 3, 7, 6]
    N, M = map(int, input().split())
    A = list(map(int, input().split()))
    As = {}
    for a in A:
        As[nums[a]] = max(a, As.get(nums[a], 0))
    A = sorted(list(As.values()), key=lambda x: nums[x])
    def helper(n, A):
        if n == 0:
            return []
        if n < 0:
            return None
        for i in A:
            s = helper(n - nums[i], A)
            if s is None:
                continue
            return s + [i]
        return None
            
    print(''.join(str(i) for i in sorted(helper(N, A), reverse=True)))

main()


### FIXED CODE ###

def main():
    C = [2, 5, 5, 4, 5, 6, 3, 7, 6]
    N, M = map(int, input().split())
    A = list(map(int, input().split()))
    dp = [0] + [-1] * N
    K = {a: C[a - 1] for a in A}

    for i in range(min(K.values()), N + 1):
        try:
            dp[i] = max(dp[i - v] * 10 + k for k, v in K.items() if i - v >= 0 and dp[i - v] >= 0)
        except ValueError:
            dp[i] = -1
    print(dp[N])
main()
a=input()
b=input()
c=a+b
if c>=10:
  print('error')
  
  else:
    print(c)


### FIXED CODE ###

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

if a+b<10:
  print(a+b)
else:
  print("error")
import sys
n ,k = map(int, input().split())
m = 0

if n == k or k == 1:
    print(0)
    sys.exit()
    
def abs_N(n, k):
    m = abs(n-k)
    compare_N_M(n, m)

def compare_N_M(n, m):
    if m == 1:
        print(1)
        sys.exit()
    elif m == 0:
        print(0)
        sys.exit
    elif n >= m:
        n = m
        abs_N(n, k)
    else:
        print(n)
        sys.exit()
        
abs_N(n, k)


### FIXED CODE ###

import sys
n ,k = map(int, input().split())
if n == k or k == 1:
    print(0)
    sys.exit()
else:
    n %= k
print(min(n, abs(n-k)))
#!/usr/bin/env python3

import collections
import sys
input=sys.stdin.readline

n=int(input())
arr1=list(map(int,input().split()))
arr2=list(map(int,input().split()))
cnt1=collections.Counter(arr1)
cnt2=collections.Counter(arr2)
ans=[0]*n
acum=0
pos=0
head=[]
for key in cnt1.keys():
    tcnt1=cnt1[key]
    tcnt2=cnt2[key]
    if tcnt1+tcnt2>n:
        print('No')
        exit()
    acum+=tcnt1
    tpos=max(acum,pos)
    remain=tcnt2
    #print(key,blank,remain)
    for i in range(tpos,n):
        if remain==0:
            break
        ans[i]=key
        remain-=1
        cnt2[key]-=1
    for _ in range(remain):
        head.append(key)
        cnt2[key]-=1
    pos=min(tpos+tcnt2,n)
    #print(ans,head,pos)
for key in cnt2.keys():
    if cnt2[key]==0:
        continue
    for _ in range(cnt2[key]):
        head.append(key)
pos=0
for i in range(n):
    if ans[i]==0:
        ans[i]=head[pos]
        pos+=1
    if arr1[i]==ans[i]:
      print(o)
print('Yes')
print(*ans)

### FIXED CODE ###

import collections

n=int(input())
arr1=list(map(int,input().split()))
arr2=list(map(int,input().split()))
cnt1=collections.Counter(arr1)
cnt2=collections.Counter(arr2)
acum1=[0]*(n+1)
acum2=[0]*(n+1)
for i in range(1,n+1):
  acum1[i]=acum1[i-1]+cnt1[i]
  acum2[i]=acum2[i-1]+cnt2[i]
rotate=0
for i in range(1,n+1):
  rotate=max(rotate,acum1[i]-acum2[i-1])
ans=[0]*n
for i in range(n):
  ans[(i+rotate)%n]=arr2[i]
for i in range(n):
  if arr1[i]==ans[i]:
    print('No')
    break
else:
  print('Yes')
  print(*ans)
from sys import stdin

NM = input()
NM = NM.split()
N = int(NM[0])
M = int(NM[1])

AB = {}
for i in range(N):
  temp = input()
  temp = temp.split()
  AB[int(temp[0])] = int(temp[1])

A_list = list(AB.keys())
A_list.sort()

cost = 0
amount = 0
for i in range(N):
  if amount + AB[A_list[i]] <= M:
    amount += AB[A_list[i]]
    cost += A_list[i]*AB[A_list[i]]
  else:
    temp = M - amount
    cost += A_list[i]*temp
    break
    
print(cost)


### FIXED CODE ###

from sys import stdin
import heapq
hq = []  

NM = input()
NM = NM.split()
N = int(NM[0])
M = int(NM[1])

hq = []
AB = {}
for i in range(N):
  temp = input()
  temp = temp.split()
  AB[int(temp[0])] = int(temp[1])
  heapq.heappush(hq, (int(temp[0]), int(temp[1])))

cost = 0
amount = 0
for i in range(N):
  temp = heapq.heappop(hq)
  if amount + temp[1] < M:
    amount += temp[1]
    cost += temp[0]*temp[1]
  else:
    temp1 = M - amount
    cost += temp[0]*temp1
    break
    
print(cost)
def sol():
    n,m=map(int,input().split())
    w={}
    p,q=set(),set()
    for i in range(m):
        l,r,d=[int(i) for i in input().split()]
        if l in w:
            w[l].add((r,d))
        else:
            w[l]={(r,d)}
        p.add(l)
        q.add(r)
    s=p-q
    for i in s:
        k={j for j in w[i]}
        g=set()
        cnt=0
        while len(k):
            x=k.pop()
            cnt+=1
            if cnt==1000:
                print(p[100])
            if x[0] not in w:
                g.add(x)
            else:
                for j in w[x[0]]:
                    k.add((j[0],j[1]+x[1]))
        y=set()
        for j in g:
            if j[0] in y or j[0]==i:
                print("No")
                exit()
            else:
                y.add(j[0])
    print("Yes" if len(s) or m==0 else "No")

if __name__=="__main__":
    sol()

### FIXED CODE ###

def sol():
    n,m=map(int,input().split())
    t,w={},{}
    p,q=set(),set()
    for i in range(m):
        l,r,d=[int(i) for i in input().split()]
        if l in w: w[l].add((r,d))
        else: w[l]={(r,d)}
        p.add(l)
        q.add(r)
    s=p-q
    chk=set()
    if len(s)==0:
        print(["No","Yes"][m==0])
        exit()
    for i in s:
        chk.add((i,0))
        while len(chk):
            x=chk.pop()
            if x[0] in w:
                for j in w[x[0]]:
                    if (i,j[0]) in t and t[(i,j[0])]!=t[(i,x[0])]+j[1]:
                        print("No")
                        exit()
                    elif (i,j[0]) not in t:
                        #t[(i,j[0])]=t[(i,x[0])]+j[1]
                        t[(i,j[0])]=x[1]+j[1]
                        chk.add((j[0],x[1]+j[1]))
    print("Yes")

if __name__=="__main__":
    sol()
h, n = map(int, input().split()  ) #split()で分解したものを別々の変数に入れる
l = []
for i in range(n):
    l.append(input()) 

a = sum(l)

if h >= a:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

h, n = map(int, input().split()  ) #split()で分解したものを別々の変数に入れる
l = list(map(int, input().split()))  

a = sum(l)

if h > a:
    print('No')
else:
    print('Yes')
n,m = map(int,input().split())
ai = [int(input()) for i in range(m)]

mod = 10**9+7

dp = [0] * (n+1)
dp[0] = 1
num = 0

for i in range(1,n+1):
    #print(i)
    if i == ai[num]:
        dp[i] = 0
        num += 1
        num = min(num,len(ai)-1)
    else:
        if i == 1:
            dp[i] = dp[i-1] % mod
        else:
            dp[i] = (dp[i-1] + dp[i-2])%mod
#    dp[i+1] = dp[i-1] + dp[i]
            
print(dp[n]%mod)

### FIXED CODE ###

import sys
import numpy as np
sys.setrecursionlimit(1000000)
 
N,M = map(int,input().split())
a = [int(input()) for i in range(M)]

ans = 0

now = 0

dp = [0]*(N+1)
disable = [0]*(N+1)

for i in range(M):
    #print(i)
    disable[a[i]] = 1
    

waru = 10**9+7
dp[0] = 1

for i in range(1,N+1):
    if disable[i] == 1:
        dp[i] = 0
    else:
        dp[i] = ( dp[i-1] + dp[i-2] )  % waru

print(dp[N])
from collections import Counter,defaultdict
import sys,heapq,bisect,math,itertools,string,queue
mod = 10**9+7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

#素因数分解
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

s = inp()
fa = prime_factorize(s)
h = 1
print(fa)
n = len(fa)
if n >= 4:
    for i in range(n//4):
        # print(i,fa[i])
        h *= fa[i]
    for i in range(n-1,n-n//4-1,-1):
        # print(i,fa[i])
        h *= fa[i]
else:
    h = fa[-1] 
w = s//h

print(0,0,w,0,0,h)






### FIXED CODE ###

from collections import Counter,defaultdict
import sys,heapq,bisect,math,itertools,string,queue
mod = 10**9+7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

s = inp()
y3 = math.ceil(s/(10**9))
x3 = 10**9*y3 - s
print(0,0,10**9,1,x3,y3)
n=int(input())
t=[int(input()) for _ in range(n)]

import fractions
a,b=t[0],t[1]
res=a*b//fractions.gcd(a,b)
for i in range(2,n):
    tmp=t[i]
    res = res*tmp//fractions.gcd(res,tmp)
print(res)

### FIXED CODE ###

n=int(input())
t=[int(input()) for _ in range(n)]

import fractions
if n==1: print(t[0])
else:
    a,b=t[0],t[1]
    res=a*b//fractions.gcd(a,b)
    for i in range(2,n):
        tmp=t[i]
        res = res*tmp//fractions.gcd(res,tmp)
    print(res)
from sys import stdin
from math import sqrt


def is_prime(q, primes):
    if len(primes) == 0:
        return True
    for prime in primes:
        if q % prime == 0:
            return False
    return True

def get_primes(n):
    # special case
    if n < 2:
        return []

    max = int(sqrt(n))
    primes = []
    for q in range(2, max+1):
        if is_prime(q, primes):
            primes.append(q)

    return primes

def breakdown_to_primes_as_dic(n, primes):
    prime_dic = {}
    for prime in primes:
        if n % prime != 0:
            continue
        prime_dic[prime] = 0
        while n % prime == 0:
            prime_dic[prime] += 1
            n = n // prime
    if n != 1:
        prime_dic[n] = 1
    return prime_dic

def get_int_sums(n):
    int_sums = [0]
    for i in range(1, n+1):
        int_sums.append(int_sums[i-1] + i)
    int_sums.pop(0)
    return int_sums


def main():
    for line in stdin:
        n = int(line)
        break

    primes = get_primes(n)
    prime_dic = breakdown_to_primes_as_dic(n, primes)

    max_prime_occurance = max(prime_dic.values())
    int_sums = get_int_sums(max_prime_occurance)

    answer = 0
    for prime in prime_dic.keys():
        occr = prime_dic[prime]
        for i in range(1, len(int_sums)):
            if occr >= int_sums[i-1] and occr < int_sums[i]:
                answer += i
                break

    print(answer)

main()

### FIXED CODE ###

from sys import stdin
from math import sqrt


def is_prime(q, primes):
    if len(primes) == 0:
        return True

    maxq = int(sqrt(q))
    for prime in primes:
        if prime > maxq:
            break
        if q % prime == 0:
            return False
    return True

def get_primes(n):
    if n < 2:
        return []
    if n == 2:
        return [2]

    max = int(sqrt(n))
    primes = [2]
    for q in range(3, max+1):
        if is_prime(q, primes):
            primes.append(q)

    return primes

def breakdown_to_primes_as_dic(n, primes):
    prime_dic = {}
    for prime in primes:
        if n % prime != 0:
            continue
        prime_dic[prime] = 0
        while n % prime == 0:
            prime_dic[prime] += 1
            n = n // prime
    if n >= 2:
        prime_dic[n] = 1
    return prime_dic

def get_int_sums(n):
    int_sums = [0]
    for i in range(1, n+1):
        int_sums.append(int_sums[i-1] + i)
    int_sums.pop(0)
    return int_sums


def main():
    for line in stdin:
        n = int(line)
        break

    primes = get_primes(n)
    prime_dic = breakdown_to_primes_as_dic(n, primes)

    if len(prime_dic.keys()) == 0:
        print(0)
        return

    max_prime_occurance = max(prime_dic.values())
    int_sums = get_int_sums(max_prime_occurance + 1)

    answer = 0
    for prime in prime_dic.keys():
        occr = prime_dic[prime]
        for i in range(1, len(int_sums)):
            if occr >= int_sums[i-1] and occr < int_sums[i]:
                answer += i
                break

    print(answer)


main()
input_list = input()

result = input_list[0]*input_list[1]

if result % 2 == 0:
  return 'Even'
else:
  result 'Odd'

### FIXED CODE ###

x, y = map(int,input().split())

result = x*y
 
if result % 2 == 0:
  print('Even')
else:
  print('Odd')
A,B=map(int,input().split())
print((a + b) % 24)

### FIXED CODE ###

A,B=map(int,input().split())
print((A + B) % 24)
x, y, a, b, c = map(int, input().split())
arrayP = list(map(int, input().split()))
arrayQ = list(map(int, input().split()))
arrayR = list(map(int, input().split()))
arrayP.sort(reverse=True)
arrayQ.sort(reverse=True)
arrayR.sort(reverse=True)
arrayAns = []
for i in range(x):
    arrayAns.append(int(arrayP[i]))
for i in range(y):
    arrayAns.append(int(arrayQ[i]))
arrayAns.sort()
for i in range(len(arrayR)):
    if len(arrayAns) >= i
        if arrayAns[i] <= int(arrayR[i]):
           arrayAns[i] = int(arrayR[i])
        else:
            break
print(sum(arrayAns))


### FIXED CODE ###

s = input()
if s[2] == s[3]:
    if s[4] == s[5]:
        print("Yes")
    else:
        print("No")
else:
    print("No")
s=input()
if s=="AAA" or s=="BBB":
  print(No)
else:
  print(Yes)

### FIXED CODE ###

s=input()
if s=="AAA" or s=="BBB":
  print("No")
else:
  print("Yes")
# -*- coding: utf-8 -*-
import sys
import os
f = open('/Users/yuigawada/Desktop/競プロ/Atcoder/input.txt', 'r')
sys.stdin = f

import itertools
import numpy as np
import fractions
from itertools import combinations
from functools import reduce
from functools import lru_cache
import math
from collections import deque
import decimal
import bisect
import heapq
from collections import defaultdict
import sys
sys.setrecursionlimit(10**9)

def mi(): return map(int,input().split())
def ii(): return int(input())
def isp(): return input().split()
def deb(text): print("-------\n{}\n-------".format(text))

INF=10**20
def main():
    N=ii()
    print(N**2)




if __name__ == "__main__":
    main()

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**9)

def mi(): return map(int,input().split())
def ii(): return int(input())
def isp(): return input().split()
def deb(text): print("-------\n{}\n-------".format(text))

INF=10**20
def main():
    N=ii()
    print(N**2)




if __name__ == "__main__":
    main()
x, y, z, k = map(int, input().split())
a = sorted(list(map(int, input().split())), reverse=True)
b = sorted(list(map(int, input().split())), reverse=True)
c = sorted(list(map(int, input().split())), reverse=True)

a_b = []
for i in range(x):
    for j in range(y):
        a_b.append(a[i] + b[j])
a_b.sort(reverse=True)
ans = []
for i in range(k):
    for j in range(k):
        ans.append(a_b[i] + c[j])
ans.sort(reverse=True)
for i in range(k):
    print(ans[i])

### FIXED CODE ###

x, y, z, k = map(int, input().split())
a = sorted(list(map(int, input().split())), reverse=True)
b = sorted(list(map(int, input().split())), reverse=True)
c = sorted(list(map(int, input().split())), reverse=True)

ans = []
for i in range(x):
    for j in range(y):
        for l in range(z):
            if (i+1) * (j+1) * (l+1) <= k:
                ans.append(a[i] + b[j] + c[l])
            else:
                break

ans.sort(reverse=True)
for i in range(k):
    print(ans[i])
dt = {}
def loop():
    while True:
        line = input()
        if line == '':
            break
        try:
            c, d = map(int, line.split(','))
            dt[c] = [d] if c not in dt else dt[c]+[d]
        except:
            break

loop()
loop()
for ab in sorted(dt.items(), key=lambda x: x[0]):
    a, b = ab[0], ab[1]
    if len(b) > 1:
        print(a, len(b))

### FIXED CODE ###

flag = 1
a, b = {},{}
def loop():
    global flag
    while True:
        try:
            c, d = map(int, input().split(','))
        except:
            flag = 0
            break
        if flag:
            a[c] = 1 if c not in a else a[c]+1
        else:
            b[c] = 1 if c not in b else b[c]+1

loop()
loop()
for k in sorted(a.keys()):
    if b.get(k, 0):
        tmp = a[k]+b[k]
        if tmp > 1:
            print(k, tmp)
N=int(input())
S=list(int(input()) for _ range(N))
S=sorted(S)
ans=0
if sun(S)%10!=0:
  ans=sum(S)
for i in range(N):
  if (sum(S)-S[i])%10!=0:
    ans=sum(S)-S[i]
    break
    
print(ans)

### FIXED CODE ###

N=int(input())
S=list(int(input()) for _  in range(N))
S=sorted(S)
ans=0
if sum(S)%10!=0:
  ans=sum(S)
else:
    for i in range(N):
      if (sum(S)-S[i])%10!=0:
        ans=sum(S)-S[i]
        break
    
print(ans)
N,K = map(int,input().split())
A = list(map(int,input().split()))
n = 1
B = [0]*N
for i in range(K):
    B[n-1] = i+1
    n = A[n-1]
    if B[n-1] != 0:
        t = i+2
        break
c = t-B[n-1]
s = (K+1-B[n-1])%c
for i in range(s):
    n = A[n-1]
print(n)

### FIXED CODE ###

N,K = map(int,input().split())
A = list(map(int,input().split()))
n = 1
B = [0]*N
state = 0
for i in range(2*N+1):
    if i == K:
        state = 1
        break
    B[n-1] = i+1
    n = A[n-1]
    if B[n-1] != 0:
        t = i+2
        break
if state:
    print(n)
else:
    c = t-B[n-1]
    s = (K+1-t)%c
    for i in range(s):
        n = A[n-1]
    print(n)
# https://atcoder.jp/contests/agc008/tasks/agc008_a
# どう見ても符号反転は1回するのが最適
# ひたすら場合分け


x, y = map(int, input().split())
if x * y < 0:  # 異符号ならば答えは一つ
    print(abs(abs(x) - abs(y)) + 1)
elif 0 <= x < y:
    print(y - x)
elif 0 <= y < x:
    print(x + y + 1)
elif x < y <= 0:
    print(y - x)
    raise ValueError()
else:
    print(2 + x - y)


### FIXED CODE ###

# https://atcoder.jp/contests/agc008/tasks/agc008_a
# どう見ても符号反転は1回するのが最適
# ひたすら場合分け


x, y = map(int, input().split())
if x * y < 0:  # 異符号ならば答えは一つ
    print(abs(abs(x) - abs(y)) + 1)
    exit()
elif 0 <= x < y:
    print(y - x)
    exit()
elif 0 < y < x:
    print(2 + x - y)
    exit()
elif y == 0 and y < x:
    print(1 + x)
    exit()
elif x < y <= 0:
    print(y - x)
    exit()
elif y < x < 0:
    print(2 + x - y)
    exit()
elif x == 0 and y < x:
    print(1 - y)
    exit()
raise ValueError()
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
import sys, math, bisect, random, itertools
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
bisect_left = bisect.bisect_left
bisect_right = bisect.bisect_right
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def LS(): return list(map(list, input().split()))
def S(): return list(input().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

#A
def A():
    n = II()
    print(n*n*3)
    return

#B
def B():
    n, d = LI()
    print((n-1)//(2*d+1)+1)
    return

#C
def C():
    n = II()
    a = IR(n)
    b = a[::1]
    b.sort()
    for i in range(n):
        if a[i] == b[-1]:
            print(b[-2])
        else:
            print(b[-1])
    return

#D
def D():
    return

#E
def E():
    return

#F
def F():
    return

#Solve
if __name__ == '__main__':
    B()


### FIXED CODE ###

#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
import sys, math, bisect, random, itertools
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
bisect_left = bisect.bisect_left
bisect_right = bisect.bisect_right
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def LS(): return list(map(list, input().split()))
def S(): return list(input().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

#A
def A():
    n = II()
    print(n*n*3)
    return

#B
def B():
    n, d = LI()
    print((n-1)//(2*d+1)+1)
    return

#C
def C():
    n = II()
    a = IR(n)
    b = a[::1]
    b.sort()
    for i in range(n):
        if a[i] == b[-1]:
            print(b[-2])
        else:
            print(b[-1])
    return

#D
def D():
    return

#E
def E():
    return

#F
def F():
    return

#Solve
if __name__ == '__main__':
    C()
from numpy.linalg import solve
mod = 10**9+7
x,y=map(int,input().split(' '))
left = [[1,2],
        [2,1]]
right = [x,y]

A=solve(left,right)
ax,ay=float(A[0]),float(A[1])
if (not float.is_integer(ax) or not float.is_integer(ay)):
    print(0)
    exit()
ax,ay=int(ax),int(ay)
fac=[0 for i in range(ax+ay+1)]
inv=[0 for i in range(ax+ay+1)]
finv=[0 for i in range(ax+ay+1)]
fac[0] = 1
fac[1] = 1
finv[0]=1
finv[1]=1
inv[1] = 1
for i in range(2,ax+ay+1):
    fac[i] = fac[i-1]*i%mod
    inv[i] = mod-inv[mod%i]*(mod//i)%mod
    finv[i]= finv[i-1] * inv[i]%mod
ans = fac[ax+ay]*(finv[ax]*finv[ay])
ans %= mod
print(int(ans))

### FIXED CODE ###

from numpy.linalg import solve
mod = 10**9+7
x,y=map(int,input().split(' '))
left = [[1,2],
        [2,1]]
right = [x,y]

A=solve(left,right)
ax,ay=float(A[0]),float(A[1])
if not 0.5 <= y/x <= 2:
    print(0)
    exit()
if not float.is_integer(ax) or not float.is_integer(ay):
    print(0)
    exit()
ax,ay=int(ax),int(ay)
fac=[0 for i in range(ax+ay+1)]
inv=[0 for i in range(ax+ay+1)]
finv=[0 for i in range(ax+ay+1)]
fac[0] = 1
fac[1] = 1
finv[0]=1
finv[1]=1
inv[1] = 1
for i in range(2,ax+ay+1):
    fac[i] = fac[i-1]*i%mod
    inv[i] = mod-inv[mod%i]*(mod//i)%mod
    finv[i]= finv[i-1] * inv[i]%mod
ans = fac[ax+ay]*(finv[ax]*finv[ay])
ans %= mod
print(int(ans))
N = int(input())
L = int(input())

aji = [(i+1)+L-1 for i in range(N)]
min = min(list(map(abs, aji)))
print(sum(aji)-min)

### FIXED CODE ###

N,L = input().split()

aji = [(i+1)+int(L)-1 for i in range(int(N))]
abs = list(map(abs, aji))
index = abs.index(min(abs))

print(sum(aji)-aji[index])
N = int(input())
st = input()
ans_st = ""

for i in range(N):
  ch_ord = ord(st[i])
  if ch_ord + N > 122:
    ans_st += chr(ch_ord + N - 26)
  else:
    ans_st += chr(ch_ord + N)
print(ans_st)

### FIXED CODE ###

N = int(input())
st = input()
ans_st = ""

for i in range(len(st)):
  ch_ord = ord(st[i])
  if ch_ord + N > 90:
    ans_st += chr(ch_ord + N - 26)
  else:
    ans_st += chr(ch_ord + N)
print(ans_st)
import sys
sys.setrecursionlimit(4100000)

line = input().split()
nPerson = int(line[0])
nFriend = int(line[1])
nBlock  = int(line[2])

friends = [[] for i in range(nFriend)]
for i in range(nFriend):
  line = input().split()
  friends[i] =[int(line[0]), int(line[1]) ]

blocks = [[] for i in range(nBlock)]
for i in range(nBlock):
  line = input().split()
  blocks[i] = [int(line[0]), int(line[1]) ]
  
connected = [[] for i in range(nPerson+1)]
  
for i in friends:
  if i[1] not in connected[i[0]]:
    connected[i[0]].append(i[1])
  if i[0] not in connected[i[1]]:
    connected[i[1]].append(i[0])

blocked = [[] for i in range(nPerson+1)]
for i in blocks:
  if i[1] not in blocked[i[0]]:
    blocked[i[0]].append(i[1])
  if i[0] not in blocked[i[1]]:
    blocked[i[1]].append(i[0])
  
for i in range(len(connected)):
  connected[i] = set(connected[i])
for i in range(len(blocked)):
  blocked[i] = set(blocked[i])
  
nCand = [0]*(nPerson+1)

def findCand(target,curPer):
  if visited[curPer] == True :
    return
  visited[curPer] = True
  if curPer not in connected[target] and curPer not in blocked[target]:
    nCand[target] += 1
  for i in connected[curPer]:
    findCand(target,i)

for i in range(1,nPerson+1):
  visited = [False]*(nPerson+1)
  visited[i] = True
  for j in connected[i]:
    findCand(i,j)

res = ""
for i in range(1,nPerson+1):
  res += str(nCand[i]) + " "
  
print(res)
  

### FIXED CODE ###

N = int(input())
print( N//2 + N%2)