Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

N=int(input())
A=[]
for i in range(N):
    A.append(int(input()))
    
    
import copy
U=copy.deepcopy(A)
del U[U.index(max(U))]
for i in range(N):
    if i==A.index(max(A)):
        print(max(U))
    else:
        print(max(A))

### FIXED CODE ###

N=int(input())
A=[]
for i in range(N):
    A.append(int(input()))
    
    
import copy
U=copy.deepcopy(A)
del U[U.index(max(U))]
X=max(U)
Q=max(A)
Z=A.index(Q)
for i in range(N):
    if i==Z:
        print(X)
    else:
        print(Q)
### BUGGY CODE ###

N,K=map(int,input().split())
mod=1000000007
path=[[] for i in range(N)]
for i in range(N-1):
  a,b=map(int,input().split())
  a=a-1
  b=b-1
  path[a].append(b)
  path[b].append(a)
#print(path)
  
abc=[False for i in range(N)] #0ならまだ塗ってない

abc[0]=True
cnt=0
ans=K%mod
nx=[]
for i in range(len(path[0])):
  child=path[0][i]
  if abc[child]:
    continue
  ans=ans*(K-1-cnt)
  ans=ans%mod
  cnt=cnt+1
  abc[child]=1
  nx.append(child)
while len(nx)>0:
  a=nx.pop(0)
  cnt=0
  for i in range(len(path[a])):
    child=path[a][i]
    if abc[child]:
      continue
    ans=ans*(K-2-cnt)
    ans=ans%mod
    cnt=cnt+1
    abc[child]=1
    nx.append(child)
      
print(ans%mod)
      
      
    
    

### FIXED CODE ###

N,K=map(int,input().split())
mod=1000000007
path=[[] for i in range(N)]
for i in range(N-1):
  a,b=map(int,input().split())
  a=a-1
  b=b-1
  path[a].append(b)
  path[b].append(a)
#print(path)
  
abc=[False for i in range(N)] #0ならまだ塗ってない

abc[0]=True
cnt=0
ans=K%mod
nx=[]
for i in range(len(path[0])):
  child=path[0][i]
  if abc[child]:
    continue
  ans=ans*(K-1-cnt)
  ans=ans%mod
  cnt=cnt+1
  abc[child]=True
  nx.append(child)
while len(nx)>0:
  a=nx.pop()
  cnt=0
  for i in range(len(path[a])):
    child=path[a][i]
    if abc[child]:
      continue
    ans=ans*(K-2-cnt)
    ans=ans%mod
    cnt=cnt+1
    abc[child]=True
    nx.append(child)
      
print(ans%mod)
### BUGGY CODE ###

import numpy as np

n = list(map(int, input().split()))
d = np.array(list(map(int, input().split())))
a = len(str(n[0]))
x = np.zeros(a + 1)

for i in range(a + 1):
    x[i] = (n[0] % np.power(10, a - i + 1)) // np.power(10, a - i)

i = 1
while 1:
    while np.any(d == x[i]):
        x[i] += 1
        x[i + (i != a):] = 0
    if x[i] == 10:
        x[i - 1] += 1
        x[i:] = 0
        i = 0
    i += 1
    if np.any(d == x[0]) and x[0] != 0:
        i = 0
    if i == a + 1:
        break
        
ans = 0
for i in range(a + 1):
    ans += x[i] * np.power(10, a - i)

print(int(ans))

### FIXED CODE ###

import numpy as np

n = list(map(int, input().split()))
d = np.array(list(map(int, input().split())))
a = len(str(n[0]))
x = np.zeros(a + 1)

for i in range(a + 1):
    x[i] = (n[0] % np.power(10, a - i + 1)) // np.power(10, a - i)

i = 0
while i != a:
    i += 1
    while np.any(d == x[i]):
        x[i] += 1
        if i != a:
            x[i + 1:] = 0
        if x[i] == 10:
            x[i - 1] += 1
            x[i:] = 0
            i -= 1

ans = 0
for i in range(a + 1):
    ans += x[i] * np.power(10, a - i)

print(int(ans))
### BUGGY CODE ###

import math
from functools import reduce


def gcd(*numbers):
    return reduce(math.gcd, numbers)


total = 0
N = int(input())
for i in range(1,N+1):
    for j in range(1,N+1):
        for k in range(1,N+1):
            total += gcd(i, j, k)

print(total)


### FIXED CODE ###

import math
from functools import reduce


def gcd(*numbers):
    return reduce(math.gcd, numbers)


total = 0
N = int(input())
for i in range(1,N+1):
    for j in range(1,N+1):
        for k in range(1,N+1):
            total += gcd(i, j, k)

print(total)
### BUGGY CODE ###

N,Ma,Mb=map(int,input().split())
dp=[[[10**9]*401 for i in range(401)] for i in range(N)]
for i in range(N):
  a,b,c=map(int,input().split())
  if i==0:
    dp[0][a][b]=c
    dp[0][0][0]=0
  else:
    for p in range(401):
      for q in range(401):
        if p>=a and q>=b:
          dp[i][p][q]=min(dp[i-1][p][q],dp[i-1][p-a][q-b]+c)
        else:
          dp[i][p][q]=dp[i-1][p][q]
ans=10**9
for a in range(1,401):
  if Mb*a/Ma<=400 and Mb*a%Ma==0:
    ans=min(ans,dp[N-1][a][Mb*a//Ma])
if ans==10**9:
  print(-1)
else:
  print(ans)

### FIXED CODE ###

N,Ma,Mb=map(int,input().split())
dp=[[[10**9]*401 for i in range(401)] for i in range(N)]
for i in range(N):
  a,b,c=map(int,input().split())
  if i==0:
    dp[0][a][b]=c
    dp[0][0][0]=0
  else:
    for p in range(401):
      for q in range(401):
        if p>=a and q>=b:
          dp[i][p][q]=min(dp[i-1][p][q],dp[i-1][p-a][q-b]+c)
        else:
          dp[i][p][q]=dp[i-1][p][q]
ans=10**9
for a in range(1,401):
  if Mb*a/Ma<=400 and Mb*a%Ma==0:
    ans=min(ans,dp[N-1][a][Mb*a//Ma])
if ans==10**9:
  print(-1)
else:
  print(ans)
### BUGGY CODE ###

import numpy as np

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

def gcd(a,b):
    while b!=0:
        a,b = b,a%b
    return a

def seachPrimeNum(N):
    max = int(np.sqrt(N))
    seachList = [i for i in range(2,N+1)]
    primeNum = []
    while seachList[0] <= max:
        primeNum.append(seachList[0])
        tmp = seachList[0]
        seachList = [i for i in seachList if i % tmp != 0]
    primeNum.extend(seachList)
    primeNum.append(1)
    return primeNum

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr[-1][0]

N=gcd(A,B)

if N==1:
    print(1)
else:
    ms = factorization(N)
    pl = seachPrimeNum(ms)
    ans=0
    for i in range(len(pl)):
        if N%pl[i]==0:
            ans+=1
    print(ans)

### FIXED CODE ###

import collections

def gcd(a,b):
    while b!=0:
        a,b = b,a%b
    return a

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

A,B=map(int, input().split())
N=gcd(A,B)
c = collections.Counter(prime_factorize(N))
print(len(list(c.keys()))+1)
### BUGGY CODE ###

n = int(input())
val = 1
for num in range(0,n):
    val *= num+1
print (val % (10**9 + 7))

### FIXED CODE ###

import math
n = int(input())
val = math.factorial(n)
print (val % (10**9 + 7))
### BUGGY CODE ###

N = int(input())
a = [""]*N

text = input()
k = 0
for x in text:
    if x == " ":
        k = k+1
    else:
        a[k] = a[k]+x

for i in range(N):
    a[i] = int(a[i])

def output(a):
    for i in range(N-1):
        for j in range(i+1,N):
            if a[i] == a[j]:
                return "NO"
    return "YES"

print(output(a))
        

### FIXED CODE ###

N = int(input())
a = [""]*N

text = input()
k = 0
for x in text:
    if x == " ":
        k = k+1
    else:
        a[k] = a[k]+x

dic ={}
def judge():
    for i in range(N):
        if (a[i] in dic.keys())==True:
            return "NO"
        else:
            dic[a[i]] = 1
    return "YES"

print(judge())
### BUGGY CODE ###

n = int(input())
a = list(map(int, input().split()))
m = 1
for i in range(n):
  m = m*a[i]
if m<= 10**18:
  print(m)
else:
  print(-1)

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
m = 1
if 0 in a:
    print(0)
else:
    for i in range(n):
        m = m * a[i]
        if m > 10 ** 18:
            print(-1)
            break
        elif i == n - 1:
            print(m)
### BUGGY CODE ###

import sys


# sys.stdin = open('d1.in')


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


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


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


def read_str():
    return input()


def main():
    n = read_int()
    adj = [[] for u in range(n+1)]
    for i in range(n - 1):
        a, b, c = map(int, input().split())
        adj[a].append((b, c))
        adj[b].append((a, c))

    d = [0] * (n+1)
    q, k = read_int_list()

    Q = [(k, 0, 0)]
    while Q:
        u, parent, dist = Q.pop(0)
        Q.extend([(v, u, dist+w) for v, w in adj[u] if v != parent])
        d[u] = dist

    res = [0] * q
    for i in range(q):
        x, y = map(int, input().split())
        res[i] = d[x] + d[y]
    print(*res, sep='\n')


main()


### FIXED CODE ###

import sys
from collections import deque


# sys.stdin = open('d1.in')


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


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


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


def read_str():
    return input()


def main():
    n = read_int()
    adj = [[] for u in range(n+1)]
    for i in range(n - 1):
        a, b, c = map(int, input().split())
        adj[a].append((b, c))
        adj[b].append((a, c))

    d = [0] * (n+1)
    q, k = read_int_list()

    # Q = [(k, 0, 0)]
    Q = deque([(k, 0, 0)])
    while Q:
        u, parent, dist = Q.popleft()
        for v, w in adj[u]:
            if v != parent:
                Q.append((v, u, dist+w))
        d[u] = dist

    res = [0] * q
    for i in range(q):
        x, y = map(int, input().split())
        res[i] = d[x] + d[y]
    print(*res, sep='\n')


main()
### BUGGY CODE ###

S = input()
ans=0

for i in range(len(S)-3):
    for j in range(i+3,len(S)):
        if int(S[i:j+1]) % 2019 == 0:
            ans+=1

print(ans)

### FIXED CODE ###

from collections import defaultdict

S = input()
B = defaultdict(int)
B[0]=1
ans=0
prev=0

for i in range(len(S)):
    m=(prev+int(S[-i-1])*pow(10,i,2019))%2019
    ans+=B[m]
    B[m]+=1
    prev=m

print(int(ans))
### BUGGY CODE ###

# a>b
dic = {}

def gcd(a, b):
    key = (a, b)
    if key in dic:
        return dic[key]
    ans = 0
    if b == 0:
        ans = a
    else:
        ans = gcd(b, a%b)
    dic[key] = ans
    return ans

N = int(input())
As = [int(s) for s in input().split()]
ans = 0

for i in range(N):
    curr = None
    for j in range(N):
        if i==j:
            continue
        curr = As[j] if curr is None else gcd(max(curr, As[j]), min(curr, As[j]))
    ans = max(curr, ans)
    
print(ans)

### FIXED CODE ###

from functools import reduce
from fractions import gcd

N = int(input())
A = [int(a) for a in input().split(" ")]
if N==2:
    print(max(A))
else:
    left, right = [-1]*(N-1), [-1]*(N-1)
    lacc, racc = (A[0], A[-1])
    for i in range(N-1):
        lacc, racc = gcd(lacc, A[i]), gcd(racc, A[N-1-i])
        left[i], right[i] = lacc, racc
    ans = max(right[-1], left[-1])
    for l, r in zip(left[:-1], reversed(right[:-1])):
        ans = max(ans, gcd(l,r))
    print(ans)
### BUGGY CODE ###

#for _ in range(int(input())):
def zeroPad(numberString, zeros, left = True):
    """Return the string with zeros added to the left or right."""
    for i in range(zeros):
        if left:
            numberString = '0' + numberString
        else:
            numberString = numberString + '0'
    return numberString
def karatsubaMultiplication(x ,y):
    """Multiply two integers using Karatsuba's algorithm."""
    #convert to strings for easy access to digits
    x = str(x)
    y = str(y)
    #base case for recursion
    if len(x) == 1 and len(y) == 1:
        return int(x) * int(y)
    if len(x) < len(y):
        x = zeroPad(x, len(y) - len(x))
    elif len(y) < len(x):
        y = zeroPad(y, len(x) - len(y))
    n = len(x)
    j = n//2
    #for odd digit integers
    if (n % 2) != 0:
        j += 1    
    BZeroPadding = n - j
    AZeroPadding = BZeroPadding * 2
    a = int(x[:j])
    b = int(x[j:])
    c = int(y[:j])
    d = int(y[j:])
    #recursively calculate
    ac = karatsubaMultiplication(a, c)
    bd = karatsubaMultiplication(b, d)
    k = karatsubaMultiplication(a + b, c + d)
    A = int(zeroPad(str(ac), AZeroPadding, False))
    B = int(zeroPad(str(k - ac - bd), BZeroPadding, False))
    return A + B + bd
n,k=map(int,input().split())
x=[int(x) for x in input().split()]
ans=[1]*n
ans[0]=x[0]
for i in range(1,k):
  ans[i]=ans[i-1]*x[i]
c=0
for i in range(k,n):
  ans[i]=karatsubaMultiplication(ans[i-1]//x[c],x[i])
  if ans[i]>ans[i-1]:
    print('Yes')
  else:print('No')
  c+=1


### FIXED CODE ###


n,k=map(int,input().split())
x=[int(x) for x in input().split()]
ans=[1]*n
ans[0]=x[0]
c=0
for i in range(k,n):

  if x[c]<x[i]:
    print('Yes')
  else:print('No')
  c+=1
### BUGGY CODE ###

from fractions import gcd
from functools import reduce
n=int(input())
a=list(map(int,input().split()))
x=reduce(lambda x,y: y//gcd(x,y)*x, set(a))
ans=0
for i in a:
  ans+=x//i
  ans%=1000000007
print(ans)

### FIXED CODE ###

def PrimeFactorization(m):
    pf = {}
    for i in range(2, int(m ** 0.5) + 1):
        while m % i == 0:
            pf[i] = pf.get(i, 0) + 1
            m //= i
    if m > 1:
        pf[m] = 1
    return pf


def lcmlist(l):
    from collections import defaultdict
    d = defaultdict(int)
    for i in set(l):
        for k, v in PrimeFactorization(i).items():
            if v > d[k]:
                d[k] = v
    n = 1
    for k, v in d.items():
        n *= k ** v
    return n

n=int(input())
a=list(map(int,input().split()))
x=lcmlist(a)
ans=0
for i in a:
  ans+=x//i
ans%=1000000007
print(ans)
### BUGGY CODE ###

from functools import reduce
N = int(input())
listA = list(map(int, input().split()))

result = reduce(lambda x, y: x*y, listA)
if result > 10 ** 18:
	print(-1)
else:
	print(result)

### FIXED CODE ###

N=int(input())
listA = list(map(int, input().split()))

if 0 in listA:
    print(0)
    exit()
result = 1
maxA = 10 ** 18
for a in listA:
    result *= a
    if result > maxA:
        result = -1
        break
print(result)
### BUGGY CODE ###

# -*- coding: utf-8 -*-
S = input()
Q = int(input())

flip = 0
for i in range(Q):
  st = input()
  if(st[0] == '1'):
    flip += 1
  else:
    if((st[2] == '1' and flip % 2 == 0) or (st[2] == '2' and flip % 2 == 1)):
      nS = st[4] + S
    else:
      nS = S + st[4]
    S = nS

if(flip % 2 != 0):
  S = S[::-1]
print(S)


### FIXED CODE ###

# -*- coding: utf-8 -*-
S = input()
Q = int(input())

flip = 0
ad1 = []
ad2 = []
for i in range(Q):
  st = input()
  if(st[0] == '1'):
    flip += 1
  else:
    if((st[2] == '1' and flip % 2 == 0) or (st[2] == '2' and flip % 2 == 1)):
      #nS = st[4] + S
      ad1.append(st[4])
    else:
      #nS = S + st[4]
      ad2.append(st[4])

ft = ''.join(ad1)
ft = ft[::-1]
ed = ''.join(ad2)

S = ft + S + ed

if(flip % 2 != 0):
  S = S[::-1]
print(S)
### BUGGY CODE ###

def gcd(a,b):
    a,b = (max(a,b),min(a,b))
    if a%b == 0:
        return b
    else:
        return gcd(a%b,b)

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

L_gcd = [A[0]]
R_gcd = [A[-1]]

for i in range(1,N):
    L_gcd.append(gcd(L_gcd[i-1],A[i]))
    R_gcd.insert(0,gcd(A[N-i-1],R_gcd[0]))

ans = max(L_gcd[-2],R_gcd[1])

for i in range(N-2):
    if gcd(L_gcd[i],R_gcd[i+2])>ans:
        ans = gcd(L_gcd[i],R_gcd[i+2])
print(ans)

### FIXED CODE ###

def gcd(a,b):
    if a <= b:
        a,b = b,a
    if b == 0:
        return a
    if a%b == 0:
        return b
    else:
        return gcd(b,a%b)

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

L_gcd = [0]*(N+1)
R_gcd = [0]*(N+1)

for i in range(N):
    L_gcd[i+1] = gcd(L_gcd[i],A[i])
    R_gcd[N-i-1] = gcd(R_gcd[N-i],A[N-i-1])

ans = 0
for i in range(N):
    if gcd(L_gcd[i],R_gcd[i+1])>ans:
        ans = gcd(L_gcd[i],R_gcd[i+1])
    
print(ans)
### BUGGY CODE ###

A, B, M = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
# 2次元配列
grid = []
for i in range(M):
    array = list(map(int, input().strip().split()))
    grid.append(array)
    
sum_fee = []
for i in a:
    for j in b:
        sum_fee.append(i+j)

for l, m , n in grid:
    sum_fee.append(a[l-1] + b[m-1] - n)
    
print(min(sum_fee))

### FIXED CODE ###

import itertools
A, B, M = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

#2次元配列
grid = []
for i in range(M):
    array = list(map(int, input().strip().split()))
    grid.append(array)
    
sum_fee = []
a_min = min(a)
b_min = min(b)
sum_fee.append(a_min+b_min)

for l, m, n in grid:
    sum_fee.append(a[l-1] + b[m-1] - n)
    

print(min(sum_fee))
### BUGGY CODE ###

import sys
from copy import deepcopy

def canMake(k, Nums):#Numsにある数でkを作れるか
    L = len(Nums)
    index = 0
    bit = []
    for i in reversed(range(60)):
        flag = 0
        for j in range(index, L):
            if Nums[j] & (1 << i) == (1 << i):
                flag = 1
                Nums[index], Nums[j] = Nums[j], Nums[index]
                bit.append(i)
                break
        if flag == 1:
            for j in range(L):
                if Nums[j] & (1 << i) == (1 << i) and index != j: Nums[j] ^= Nums[index]
        if flag == 1: index += 1
    ans = 0
    for i in range(60):
        if k & (1 << i) == (1 << i):
            if i in bit: ans ^= Nums[bit.index(i)]
    if ans == k: return True
    else: return False


def solve():
    input = sys.stdin.readline
    T = int(input())
    Ans = [0] * T
    for t in range(T):
        N = int(input())
        A = [int(a) for a in input().split()]
        S = input().strip("\n")
        used = []
        for i in reversed(range(N)):
            if S[i] == "0":
                used.append(A[i])
            else:
                compare = deepcopy(used)
                if not canMake(A[i], compare):
                    Ans[t] = 1
                    break
    
    print(*Ans, sep="\n")

    return 0

if __name__ == "__main__":
    solve()


### FIXED CODE ###

import sys
from copy import deepcopy

def canMake(k, Nums):#Numsにある数でkを作れるか
    L = len(Nums)
    index = 0
    bit = []
    for i in reversed(range(60)):
        flag = 0
        for j in range(index, L):
            if Nums[j] & (1 << i) == (1 << i):
                flag = 1
                Nums[index], Nums[j] = Nums[j], Nums[index]
                bit.append(i)
                break
        if flag == 1:
            for j in range(L):
                if Nums[j] & (1 << i) == (1 << i) and index != j: Nums[j] ^= Nums[index]
        if flag == 1: index += 1
    ans = 0
    for i in range(60):
        if k & (1 << i) == (1 << i):
            if i in bit: ans ^= Nums[bit.index(i)]
    if ans == k: return True
    else: return False


def solve():
    input = sys.stdin.readline
    T = int(input())
    Ans = [0] * T
    for t in range(T):
        N = int(input())
        A = [int(a) for a in input().split()]
        S = input().strip("\n")
        used = []
        for i in reversed(range(N)):
            if S[i] == "0":
                used.append(A[i])
            else:
                compare = deepcopy(used)
                if not canMake(A[i], compare):
                    Ans[t] = 1
                    break
    
    print(*Ans, sep="\n")

    return 0

if __name__ == "__main__":
    solve()
### BUGGY CODE ###

# _*_ coding:utf-8 _*_
#  Atcoder_Beginners_Contest051-B
#  https://atcoder.jp/contests/abc051/tasks/abc051_b
from itertools import product
def  queueAnswer(maxValue,sumNumber):
	baseList = list(range(0,maxValue+1,1))
	pools = product(baseList,baseList,baseList)
	counter = 0
	for x,y,z in pools:
		checkSum = x + y + z
		if checkSum == sumNumber:
			counter = counter + 1
	answer = counter
	return answer


if __name__ == '__main__':
	k,s = map(int,input().strip().split(' '))
	solution=queueAnswer(k,s)
	print(solution)

### FIXED CODE ###

# _*_ coding:utf-8 _*_
#  Atcoder_Beginners_Contest051-B
#  https://atcoder.jp/contests/abc051/tasks/abc051_b
from itertools import product
def  queueAnswer(maxValue,sumNumber):
	baseList = list(range(0,maxValue+1,1))
	xyPool = product(baseList,baseList)
	counter = 0
	for x,y in xyPool:
		z = sumNumber - x - y
		if ( 0 <= z ) and ( z <= maxValue):
			counter = counter + 1

	answer = counter
	return answer


if __name__ == '__main__':
	k,s = map(int,input().strip().split(' '))
	solution=queueAnswer(k,s)
	print(solution)
### BUGGY CODE ###

n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=[]
d=[]
for i in range(n):
  if a[i]>b[i]:
    c.append(a[i]-b[i])
  elif a[i]<b[i]:
    d.append(b[i]-a[i])
c.sort(reverse=True)
if sum(c)<sum(d):
  print(-1)
elif sum(c)==sum(d):
  print(len(c)+len(d))
else:
  ans=0
  if len(c)==1:
    print(1+len(d))
  else:
    for i in range(len(c)):
      if sum(c[:i])>=sum(d):
        ans=i
        break
    print(ans+len(d))

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=[]
d=[]
for i in range(n):
  if a[i]>b[i]:
    c.append(a[i]-b[i])
  elif a[i]<b[i]:
    d.append(b[i]-a[i])
c.sort(reverse=True)
if sum(c)<sum(d):
  print(-1)
elif sum(c)==sum(d):
  print(len(c)+len(d))
else:
  ans=0
  if len(c)==1:
    print(1+len(d))
  else:
    for i in range(len(c)):
      if sum(c[:i])>=sum(d):
        ans=i
        break
    print(ans+len(d))
### BUGGY CODE ###

def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]


N = int(input())
ans = 0



for i in range(N):
    i += 1
    ans += i * len(make_divisors(i))

print(ans)


### FIXED CODE ###

N = int(input())

ans = 0
for i in range(1,N+1):
    n = N // i
    ans += i * (n*(n+1))//2

print(ans)
### BUGGY CODE ###

n=int(input())
paper=list()
for _ in range(n):
    a = input()
    if a in paper:
        paper.remove(a)
    else:
        paper.append(a)
print(len(paper))

### FIXED CODE ###

n=int(input())
s=set()
for _ in range(n):
    a = input()
    if a in s:
        s.remove(a)
    else:
        s.add(a)
print(len(s))
### BUGGY CODE ###

n, k = map(int, input().split())
a = list(map(int, input().split()))


def diff(now, d):
    return abs(a[now] - a[now - d])

dp = [0] * n
dp[1] = diff(1, 1)
for depth in range(2, n):
    # dp[depth] = min(dp[depth - 1] + diff(depth, 1), dp[depth - 2] + diff(depth, 2))
    dp[depth] = min(dp[depth - x] + diff(depth, x) for x in range(1, min(depth, k) + 1))
print(dp[-1])


### FIXED CODE ###

n, k = map(int, input().split())
a = list(map(int, input().split()))


def diff(now, d):
    return abs(a[now] - a[now - d])

dp = [0] * n
dp[1] = diff(1, 1)
for depth in range(2, n):
    # dp[depth] = min(dp[depth - 1] + diff(depth, 1), dp[depth - 2] + diff(depth, 2))
    dp[depth] = min(dp[depth - x] + diff(depth, x) for x in range(1, min(depth, k) + 1))
print(dp[-1])
### BUGGY CODE ###

#abc 063 c
n=int(input())
s=[]
for i in range(n):
    num=int(input())
    s.append(num)

def dfs(i,score):
    if i==n:
        if score%10==0:
            score=0
        return score
    ret=max(dfs(i+1,score),dfs(i+1,score+s[i])) #選ぶか選ばないか
    return ret

ans=dfs(0,0)
print(ans)


### FIXED CODE ###

#abc 063 c
n=int(input())
s=[]
for i in range(n):
    num=int(input())
    s.append(num)

dp=[[False]*11000 for _ in range(110)]
dp[0][0]=True
for i in range(n):
    for j in range(11000):
        if dp[i][j]==True:
            dp[i+1][j]=True
            dp[i+1][j+s[i]]=True

ans=0
for i in range(11000):
    if dp[n][i]==True and i%10!=0:
        ans=i
print(ans)
### BUGGY CODE ###

n = int(input())
a = [int(s) for s in input().split()]
d = 0
ans = 0
mod = 10**9+7
for d in range(60):
	c0 = 0
	c1 = 0
	for v in a:
		if v >> d & 1:
			c1 += 1
		else:
			c0 += 1
	ans = (ans + (c0 * c1 << d)) % mod
print(ans)

### FIXED CODE ###

n = int(input())
a = [int(s) for s in input().split()]
d = 0
ans = 0
mod = 10**9+7
for d in range(60):
	c0 = 0
	c1 = 0
	for v in a:
		if v >> d & 1:
			c1 += 1
		else:
			c0 += 1
	ans = (ans + (c0 * c1 << d)) % mod
print(ans)