Harryxun/stf_run huggingface dataset:
import math
#試し割法
def trial_division(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

N = trial_division(int(input()))

key = []
val = []

dupli = set()
for i in range(len(N)):
    if (not N[i] in dupli):
        key.append(N[i])
        dupli.add(N[i])

for i in range(len(key)):
    val.append(N.count(key[i]))


numList = [0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6]

sum = 0
for i in range(len(key)):
    sum += numList[val[i]]
    # count = 1
    # length = val[i]
    # if (length < 3):
    #     sum += 1
    # else:
    #     while(length > 0):
    #         sum += 1
    #         length -= count
    #         if (length == count):
    #             break
    #         count += 1

print(sum)


### FIXED CODE ###

import math
#試し割法
def trial_division(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

N = trial_division(int(input()))

key = []
val = []

dupli = set()
for i in range(len(N)):
    if (not N[i] in dupli):
        key.append(N[i])
        dupli.add(N[i])

for i in range(len(key)):
    val.append(N.count(key[i]))


def maxvalue(n):
    if (n < 3):
        return 1
    elif (n < 6):
        return 2
    elif (n < 10):
        return 3
    elif (n < 15):
        return 4
    elif (n < 21):
        return 5
    elif (n < 28):
        return 6
    elif (n < 36):
        return 7
    elif (n < 45):
        return 8
    elif (n < 55):
        return 9
    elif (n < 66):
        return 10

sum = 0
for i in range(len(key)):
    sum += maxvalue(val[i])
    # count = 1
    # length = val[i]
    # if (length < 3):
    #     sum += 1
    # else:
    #     while(length > 0):
    #         sum += 1
    #         length -= count
    #         if (length == count):
    #             break
    #         count += 1

print(sum)
mx, h = [], []
for ch in input():
    if ch in ['A', 'C', 'G', 'T']:
        h += ch
    else:
        mx += [h]
        h = []
else:
    print(max([len(l) for l in mx]))


### FIXED CODE ###

mx, h = [], []
for ch in str(input()):
    if ch in ['A', 'C', 'G', 'T']:
        h += ch
    else:
        mx += [h]
        h = []
else:
    mx += [h]
    print(max([len(l) for l in mx]))
import collections

s = list(raw_input())
count = 0
for i in range(len(s) - 1):
	if s[i] == s[i + 1]:
		s[i] = 1- s[i]
		count +=1
print count


### FIXED CODE ###

import collections

s = map(int,list(raw_input()))

count = 0
for i in range(1,len(s)):
	if s[i] == s[i - 1]:
		s[i] = 1 - s[i]
		count += 1
print count
from collections import Counter
N,M=map(int,input().split())

road=[[str(s) for s in input().split()] for m in range(M)]

ans=[]

for m in range(M):
  roadm_counter=Counter(road[m])
  ans_counter=Counter(ans)
  ans_counter=ans_counter+roadm_counter
  ans=dict(ans_counter)

for a in range(N):
  print(ans[str(a+1)])

### FIXED CODE ###

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

roads=[[str(s) for s in input().split()] for m in range(M)]

ans={}

for m in range(M):
  for road in roads[m]:
    if road in ans:
      ans[road]+=1
    else:
      ans[road]=1

for n in range(N):
  if str(n+1) in ans:
    print(ans[str(n+1)])
  else:
    print(0)
h, w = [int(n) for n in input().split()]
i,j = [h,w].sort()
area = i*j
if i % 3 == 0 or j % 3:
    print(0)
else:
    p=j//3+1
    a = i*(p)
    b= i//2*(j-p)
    print(abs(a-b))

### FIXED CODE ###

h, w = [int(n) for n in input().split()]
i = min(h, w)
j = max(h, w)
area = i * j
if i % 3 == 0 or j % 3 == 0:
    print(0)
else:
    lst = []
    for r, s in [(i, j), (j, i)]:
        
        p = s // 3 + 1
        q = s // 3 
        a1 = r * p
        a2 = r * q
        b1 = r // 2 * (s - p)
        bb1 = (r // 2 - 1) * (s - p)
        b2 = r // 2 * (s - q)
        bb2 = (r // 2 - 1) * (s - q)
        c1 = (s - p) // 2 * r
        cc1 = ((s - p) // 2- 1) * r
        c2 = (s - q) // 2 * r
        cc2 = ((s - q) // 2 - 1) * r
        tup = [(a1, b1), (a2, b2), (a1, c1), (a2, c2),
               (a1, bb1), (a2, bb2), (a1, cc1), (a2, cc2)]
        lst.extend([abs(max(a, b, area - a - b) - min(a, b, area - a - b))
                    for a, b in tup])
    print(min(lst))
N,M = map(int,(input().split()))
X = list(map(int,(input().split())))
X.sort()
if len(X) > 1:
    dist = [X[i+1]-X[i] for i in range(len(X) - 1)]
    dist.sort(reverse = True)
    for i in range(N - 1):
        del dist[0]
    print(sum(dist))
else:
 print(0)

### FIXED CODE ###

N,M = map(int,(input().split()))
X = list(map(int,(input().split())))
X.sort()
if M > N:
    dist = [X[i+1]-X[i] for i in range(M - 1)]
    dist.sort(reverse = True)
    for i in range(N - 1):
        del dist[0]
    print(sum(dist))
else:
 print(0)
S = input()
T = input()
print(T+S)

### FIXED CODE ###

S,T = map(str,input().split())
print(T+S)
O = input()
E = input()
answer = ""
i = 1
o = 0
e = 0
while i < len(E):
  if i % 2 != 0:
    answer.append(O[o])
    o += 1
  else:
    answer.append(E[e])
    e += 1
  i += 1

if len(O) - len(E) == 1:
  answer.append(O[-1])

return answer

### FIXED CODE ###

O = input()
E = input()
answer = ""
i = 1
o = 0
e = 0
while i < len(E)+len(O)+1:
  if i % 2 != 0:
    answer += O[o]
    o += 1
  else:
    answer += E[e]
    e += 1
  i += 1

print(answer)
import sys
W = input()
print(sys.stdin.read().rstrip('END_OF_TEXT').lower().split(" ").count())

### FIXED CODE ###

import sys
W = input().lower()
print(sys.stdin.read().rstrip('END_OF_TEXT').lower().split().count(W))
h, w, k = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))

ans = 0
total = 0
while total <= k:
  if len(a) != 0 and len(b) != 0:
    if a[0] < b[0]:
      total += a.pop(0)
    else:
      total += b.pop(0)
    ans += 1
  elif len(a) == 0:
    total += b.pop(0)
    ans += 1
  elif len(b) == 0:
    total += a.pop(0)
    ans += 1
  else:
    break
if total > k:
  print(ans - 1)
else:
  print(ans)

### FIXED CODE ###

n, m, k = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
 
a = [0]
b = [0]
for i in range(n):
  a.append(a[i]+A[i])
for j in range(m):
  b.append(b[j]+B[j])
#print(a,b)
 
ans = 0
j = m
for i in range(n+1):
  if a[i] > k:
    break
  while (k - a[i]) < b[j]:
    j -= 1
    if j == -1:
      break
  
  ans = max(ans, i+j)
     
print(ans)
from numba import njit

@njit
def main():
    import collections
 
    H, W, M_ko = map(int, input().split())
 
    zahyou = [[0 for i in range(W)] for j in range(H)]
    zahyou_H = [0 for i in range(H)]
    zahyou_W = [0 for i in range(W)]
 
    for i in range(M_ko):
        height, width = map(int, input().split())
 
        zahyou[height - 1][width - 1] = 1
        
        zahyou_H[height - 1] += 1
        zahyou_W[width - 1] += 1
 
    CTR_H = collections.Counter(zahyou_H)
    CTR_W = collections.Counter(zahyou_W)
 
    max_h = max(zahyou_H)
    max_w = max(zahyou_W)
 
    len_h = CTR_H[max_h]
    len_w = CTR_W[max_w]
 
    index_h = [i for i, x in enumerate(zahyou_H) if x == max_h]
    index_w = [i for i, x in enumerate(zahyou_W) if x == max_w]
 
 
    maxi = max_h + max_w
    FLAG = False
 
 
    if (len_h == 1 and len_w == 1):    
        maxi -= zahyou[index_h[0]][index_w[0]]
 
 
    else:
        for i in range(len_h):        
            for j in range(len_w):
                val = zahyou[index_h[i]][index_w[j]]
                
                if (val == 0):
                    FLAG = True
                    break
        
        if (not FLAG):
            maxi -= 1
 
    print(maxi)
 
 
if __name__ == '__main__':
    main()

### FIXED CODE ###

import numpy as np
import numba
import sys
from numba import njit, b1, i4, i8, f8

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines


@njit((i8, i8, i8[:]), cache=True)
def main(Height, Width, XY):
    UP = 300010
    row = np.zeros(UP, np.int64)
    col = np.zeros(UP, np.int64)
    
    for i in range(0, len(XY), 2):
        x, y = XY[i:i + 2] - 1
        row[x] += 1
        col[y] += 1
    
    row_max = row.max()
    col_max = col.max()

    judge = np.sum(row == row_max) * np.sum(col == col_max)

    for i in range(0, len(XY), 2):
        x, y = XY[i:i + 2] - 1
        
        if (row[x] == row_max and col[y] == col_max):
            judge -= 1
    
    summ = row_max + col_max
    
    return (summ if judge else summ - 1)


Height, Width, M_ko = map(int, readline().split())
XY = np.array(read().split(), np.int64)

ans = main(Height, Width, XY)
print(ans)
# coding: utf-8
# Your code here!

from collections import Counter

def flatten_2dim(array):
    return [item for sublist in array for item in sublist]
    
N, M = map(int, input().split())
arr = [[int(i) for i in input().split()] for j in range(M)]

dic = Counter(flatten_2dim(arr))
sort_dic = sorted(dic.items())

for i in range(M):
    print(sort_dic[i][1])

### FIXED CODE ###

# coding: utf-8
# Your code here!

N, M = map(int, input().split())
arr = [0 for i in range(N)]

for i in range(M):
    A, B = map(int, input().split())
    arr[A - 1] += 1
    arr[B - 1] += 1
  
for j in arr:
    print (j)
print("a")
N = int(input("N = ?"))
X = int(input("X = ?"))
T = int(input("T = ?"))
if N % X = 0:
    c = N / X
else:
    c = int(N / X) + 1 
print(c)

### FIXED CODE ###

n, x, t = input().split()
N = int(n)
X = int(x)
T = int(t)
if N % X == 0:
    c = N / X
else:
    c = int(N / X) + 1 
C = int(c)
print(C*T)
import sys

def red_or_nod(a:int, s:str):
  if int(a) >= 3200:
    print(s)
  else:
    print('red')
    
red_or_nod(sys.argv[1], sys.argv[2])


### FIXED CODE ###


import sys
 
inputs = []
for line in sys.stdin:
    inputs.append(line)
    
if int(inputs[0]) >= 3200:
  print(inputs[1])
else:
  print('red')
from sys import stdin
n = int(stdin.readline().rsprit())
li = list(map(int,stdin.readline().rstrip().split()))
s = 0
for i in range(n):
    s += 1/li[i]
print(1/s)

### FIXED CODE ###

from sys import stdin
n = int(stdin.readline().rstrip())
li = list(map(int,stdin.readline().rstrip().split()))
s = 0
for i in range(n):
    s += 1/li[i]
print(1/s)
def D(n,d):
  r=0
  while n>0:
    r=r+n%d
    n=n//d
  return r

n=int(input())
s=int(input())
A=[]
for i in range(1,int((n-s)**(1/2))+3):
  if (n-s)%i==0:
    A.append(i)
for i in range(len(A)):
  if D(n,A[i]+1)==s:
    print(A[i]+1)
    exit()
print(-1)

### FIXED CODE ###

def D(n,d):
  r=0
  while n>0:
    r=r+n%d
    n=n//d
  return r

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    divisors.sort()
    return divisors

n=int(input())
s=int(input())
if n-s==0:
  print(n+1)
  exit()
if s>n:
  print(-1)
  exit()

A=make_divisors(n-s)
for i in range(len(A)):
  if D(n,A[i]+1)==s:
    print(A[i]+1)
    exit()
print(-1)
import sys
[x.strip() for x in sys.stdin.readlines()]
cnt=1
for i in x:
	if i==0:
        break
    else:
        print('Case '+repr(cnt)+': '+repr(i))
        cnt+=1

### FIXED CODE ###

import sys
cnt = 1
for x in sys.stdin:
    i= int(x)
    if i == 0: break
    print('Case '+repr(cnt)+': '+repr(i))
    cnt+=1
# C - Bridge
# https://atcoder.jp/contests/abc075/tasks/abc075_c

from collections import deque

def dfs(start, graph):
  visited = [False] * n
  stack = deque()
  stack.append(start)
  visited[start] = True
  while stack:
    q = stack.popleft()
    nxts = graph[q]
    for nxt in nxts:
      if not visited[nxt]:
        visited[nxt] = True
        stack.append(nxt)
  return visited

n, m = map(int, input().split())
edge = [list(map(int, input().split())) for _ in range(m)]

ans = 0
for i in range(m):
  graph = [[] for _ in range(n)]
  for itr, (a, b) in enumerate(edge):
    if itr != i:
      graph[a - 1].append(b - 1)
      graph[b - 1].append(a - 1)

  if not all(dfs(i, graph)):
    ans += 1

print(ans)


### FIXED CODE ###

from scipy.sparse.csgraph import dijkstra
N, M = map(int, input().split())
edge = [list(map(int, input().split())) for _ in range(M)]

graph = [[0] * (N + 1) for _ in range(N + 1)]
for a, b in edge:
  graph[a][b] = 1

answer = 0
INF = 10 ** 9
for a, b in edge:
  # a-bのedgeを取り除いた場合にa-bの距離を測る
  graph[a][b] = INF
  dist = dijkstra(graph, indices = a, directed = False)
  if dist[b] >= INF:
    answer += 1
  # a-bのedgeを戻す
  graph[a][b] = 1

print(answer)
l = map(int, raw_input().split())

if l[0] + l[1] < 2 * l[2]:
	if l[3] < l[4]:
		return l[3] * 2 * l[2] + (l[4] - l[3]) * l[1]
	else:
		return l[4] * 2 * l[2] + (l[3] - l[4])  * l[0]
else:
	return l[3] * l[0] + l[4] * l[1]

### FIXED CODE ###

l = map(int, raw_input().split())

if l[0] + l[1] > 2 * l[2]:
	if l[3] < l[4]:
		if (l[4] - l[3]) * l[1] < (l[4] - l[3]) * 2 * l[2]:
			print l[3] * 2 * l[2] + (l[4] - l[3]) * l[1]
		else:
			print l[4] * 2 * l[2]
	else:
		if (l[3] - l[4]) * l[0] < (l[3] - l[4]) * 2 * l[2]:
			print l[4] * 2 * l[2] + (l[3] - l[4])  * l[0]
		else:
			print l[3] * 2 * l[2]
else:
	print l[3] * l[0] + l[4] * l[1]
a = int(input())
b = int(input())
c = int(input())
d = int(input())

if a - b <= d and b - c <= d or a - c <= d:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

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

if abs(a - c) <= d:
    print('Yes')
elif (a < b and b < c) or (a > b and b > c):
    if abs(a - b) <= d and abs(b - c) <= d:
        print('Yes')
    else:
        print('No')
else:
    print('No')
a,b,c,k = map(int, input().split())

ti = [1] * a
[ti.append(0) for _ in range(b)]
[ti.append(-1) for _ in range(c)]

res = 0
for i in range(k):
    res += ti[i]
print(res)

### FIXED CODE ###

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

a_ = k - a
b_ = k - a - b

res = 0
if a_ <= 0:
    res += k
elif b_ <= 0:
    res += a 
else:
    res += a - b_

print(res)
N,M =map(int, input().split())
L,R =[],[]

for i in range(M+1):
  x,y = map(int,input().split())
  L.append(x)
  R.append(y)

print(max(0,min(R)-max(L)+1))

### FIXED CODE ###

N,M =map(int, input().split())
L,R =[],[]
 
for i in range(M):
  x,y = map(int,input().split())
  L.append(x)
  R.append(y)
 
print(max(0,min(R)-max(L)+1))
if x==0:
  return 1
elif x==1:
  return 0
else:
  break

### FIXED CODE ###

x=int(input())

if x==0:
  print(1)
else:
  print(0)
import sys

def cheaperprice(item):
    rawprice=rawprices[item]
    if item in checkloop:
        return rawprice
    elif item not in menus:
        checkloop.append(item)
        return rawprice
    else:
        checkloop.append(item)
        indegrients=menus[item]
        combinedprice=0
        for i in indegrients:
            combinedprice+=cheaperprice(i)
        return min(combinedprice,rawprice)


n=0 #how many numbers of lists
flag=0
rawprices={}
menus={}
checkloop=[]
for line in sys.stdin:
    line=line.strip()
    if n==0:
        if flag==0 and line=='0':
            break
        elif flag!=2:
            n=int(line)
        else:
            print cheaperprice(line)
            rawprices={}
            menus={}
            checkloop=[]
        flag=(flag+1)%3
    else:
        line=line.split(' ')
        if flag==1: #rawprices
            rawprices[line[0]]=int(line[1])
        elif flag==2:
            menus[line[0]]=line[2:]
        n-=1

### FIXED CODE ###

while(1):
    n=int(raw_input())
    if n==0:
        break
    else:
        pricelist=[]
        recipedict={}
        costdict={}
        for i in range(n):
            [ii,p]=raw_input().split()
            pricelist.append([ii,int(p)])
            costdict[ii]=1000000000000
        pricelist.sort(key=lambda x:x[1])
        m=int(raw_input())
        for i in range(m):
            rec=raw_input().split()
            o=rec[0]
            k=int(rec[1])
            recipedict[o]=rec[2:]
        query=raw_input()
        while(1):
            cheapest=pricelist.pop(0)
            #if able to make
            if cheapest[0] in recipedict:
                priceifmade=0
                for reqitem in recipedict[cheapest[0]]:
                    priceifmade=priceifmade+costdict[reqitem]
                if priceifmade<cheapest[1]:
                    costdict[cheapest[0]]=priceifmade
                else:
                    costdict[cheapest[0]]=cheapest[1]
            else:
                costdict[cheapest[0]]=cheapest[1]
            for item in recipedict:
                priceifmade=0
                for reqitem in recipedict[item]:
                    priceifmade=priceifmade+costdict[reqitem]
                if priceifmade<costdict[item]:
                    costdict[item]=priceifmade
            if cheapest[0]==query:
                print costdict[cheapest[0]]
                break
a,b = map(double,input().split())
print(int(a * b))

### FIXED CODE ###

from decimal import Decimal
a,b = input().split()
print(int(Decimal(a)*Decimal(b)))
n,T=map(int,input().split())
data=[input().split() for i in range(n)]
lc=[]
for row in data:
    if int(row[1]) <=T:
        lc.append(row[0])
if  len(lc)==0:
    print("TLE")
else:
    print(min(lc))

### FIXED CODE ###

n=int(input())
if n==1:
    print("Hello World")
else:
    a=int(input())
    b=int(input())
    print(a+b)
n=int(input())
a=[0]*n
for _ in range(n):
  a[_]=int(input())
c=0
p=a[0]
while True:
  p=a[p-1]
  c+=1
  if p=2:
    break
  if p=1:
    c=-1
    break
print(c)

### FIXED CODE ###

n=int(input())
a=[int(input()) for i in range(n)]
c,s=1,a[0]
while s!=2 and c<n:
  c+=1
  s=a[s-1]
print(c if c<n else -1)
# https://qiita.com/c-yan/items/e117269cc447fa61dddf
N = int(input())
A = list(map(int, input().split()))

d = {}
for a in A:
    d.setdefault(a, 0)
    d[a] += 1

A = sorted(set(A))
t = [True] * (10 ** 6 + 1)
for a in A:
    if d[a] > 1:
        t[a] = False
    for i in range(a + a, 10 ** 6 + 1, a):
        t[i] = False
print(sum(1 for a in A if t[a]))

### FIXED CODE ###

import sys
def input():
    return sys.stdin.readline()[:-1]


def test():
    # x = map(int, input().split())
    x = input().split()
    print(x.index("0") + 1)

test()
n, k = map(int, input().split())
p_i = input().split()
answer = 0
for x in range(n):
    if x <= k - 1:
        sum = 0
        for y in range(k):
            sum += int(p_i[x + y])
        answer = max(answer, sum)
print((answer + k) / 2)

### FIXED CODE ###

n, k = map(int, input().split())
p_i = list(map(int,input().split()))
answer = 0
sum = 0
for x in range(n):
    if x <= k - 1: 
        sum += p_i[x]
        if x == k - 1: answer = sum
    else:
        sum += p_i[x] - p_i[x - k]
        answer = max(answer, sum)
print((answer + k) / 2)
N, M = map(int, input().split())
def combinations_count(n, r):
  	if n==1 or n==0:
      return 0
    else:
      return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

print(combinations_count(N, 2)+combinations_count(M, 2))


### FIXED CODE ###

from scipy.misc import comb
N, M = [int(i) for i in input().split()]
ans = comb(N,2,exact=True) + comb(M,2,exact=True)
print(ans)
def main():
    N = int(input())

    
    for n in range(1, N + 1):

        max_itr = min(101, int(math.sqrt(n)) + 1)
                
        
        ans = 0

        for x in range(1, max_itr):
            for y in range(1, max_itr):
                for z in range(1, max_itr):

                    # left_eq = x * x + y * y + z * z + x * y + y * z + z * x
                    left_eq=x**2+y**2+z**2+x*y+y*z+z*x
                    if (left_eq == n):
                        ans += 1
        
        
        print(ans)


if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    import math

    N = int(input())
    
    ans_list = [0 for i in range(N)]
    
    for x in range(1, 101):
        for y in range(1, 101):
            for z in range(1, 101):

                left_eq = x * x + y * y + z * z + x * y + y * z + z * x
                if (left_eq <= N):
                    ans_list[left_eq - 1] += 1
    
    for i in range(N):
        print(ans_list[i])

if __name__ == '__main__':
    main()
H, N=map(int, input().split())
List=[int(i) for i in input().split()]
a = 0:
for j in range(N):
  a = a + List[j]

if a >= H:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

H, N=map(int, input().split())
List=list(map(int,input().split()))
a = 0
for j in range(N):
  a = a + List[j]

if a >= H:
  print("Yes")
else:
  print("No")
# -*- coding: utf-8 -*-
n, m = map(int, input().split())
BIGNUM = 1000000007

last_ana = int(input())
blocks = [last_ana]

for _ in range(1, m):
    ana = int(input())
    blocks.append(ana - last_ana - 1)
    last_ana = ana

blocks.append(n - last_ana)

if 0 in blocks:
    ans = 0
else:
    b_max = max(blocks)

    c = [1, 1]
    for i in range(2, b_max):
        ctmp = c[i - 1] + c[i - 2]
        c.append(ctmp % 1000000007)

    ans = 1
    for num in blocks:
        if num == 1:
            continue
        ans = (ans * c[num - 1]) % BIGNUM
        if ans == 0:
            break

print(ans)

### FIXED CODE ###

# -*- coding: utf-8 -*-
n, m = map(int, input().split())
BIGNUM = 10 ** 9 + 7

if m > 0:
    last_ana = int(input())
    blocks = [last_ana]

    for _ in range(1, m):
        ana = int(input())
        blocks.append(ana - last_ana - 1)
        last_ana = ana
    blocks.append(n - last_ana)
else:
    blocks = [n + 1]

if 0 in blocks:
    ans = 0
else:
    b_max = max(blocks)
    c = [1, 1]
    for i in range(2, b_max):
        ctmp = c[i - 1] + c[i - 2]
        c.append(ctmp % BIGNUM)

    ans = 1
    for num in blocks:
        if num == 1:
            continue
        ans = (ans * c[num - 1]) % BIGNUM
        if ans == 0:
            break

print(ans)
n=int(input())
a=[int(i) for i in input().split()]
e=a[0]
l=[]
for i in range(0,len(a)-1):
    f=0
    for j in range(i,len(a)-1):
        if(a[j+1]<=a[j]):
            f=f+1
        else:
            break
    l.append(f)
print(max(l))

### FIXED CODE ###

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

ans = []
now = 0

for i in range(1,n):
    if h[i-1] >= h[i]:
        now += 1
    else:
        ans.append(now)
        now = 0

ans.append(now)

print(max(ans))
a=list(map(int,input().split()))
b=len(a)
c=[a]
w=0
for i in range(b-1):
    c.append(list(map(int,input().split())))
N=int(input())
d=[]
for y in range(N):
    d.append(int(input()))
for n in d:
    for p in c:
        for j in p:
            if n in j:
                j=0
for t in c:
    for h in t:
        if c.count(0)==b:
            o=1
            break
    else:
        continue
    break
for v in range(b):
    w=0
    for k in c:
        if k[v]==0:
            w+=1
        if w==b:
            o=1
w=0
for ji in range(b):
    if c[ji][ji]==0:
        w+=1
    if w==b:
        o=1
w=0
for ji2 in range(b):
    if c[ji2][b-ji2]==0:
        w+=1
    if w==b:
        o=1
if o==1:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

p1=list(map(int,input().split()))
p2=list(map(int,input().split()))
p3=list(map(int,input().split()))
p=p1+p2+p3
n=int(input())
for _ in range(n):
    b=int(input())
    if b in p:
        p[p.index(b)]=0
if p[0]+p[1]+p[2]==0 or p[3]+p[4]+p[5]==0 or p[6]+p[7]+p[8]==0 or p[0]+p[3]+p[6]==0 or p[1]+p[4]+p[7]==0 or p[2]+p[5]+p[8]==0 or p[0]+p[4]+p[8]==0 or p[2]+p[4]+p[6]==0:
    print("Yes")
else:
    print("No")
import copy
n=int(input())
A=[int(input()) for i in range(n)]
B=copy.copy(A)
for i in range(n):
    A.pop(i)
    print(max(A))
    A = B
    

### FIXED CODE ###

n=int(input())
A=[int(input()) for i in range(n)]
B=sorted(A)
for a in A:
    if a == B[-1]:
      print(B[-2])
    else:
        print(B[-1])
N,M=map(int,input().split())
A=map(int,input().split())
if N>=sum(A):
    print(N-sum(A))
else:
    print(-1

### FIXED CODE ###

N,M=map(int,input().split())
A=list(map(int,input().split()))
ans=N-sum(A)
if ans<0:
    print(-1)
else:
    print(ans)