Harryxun/stf_run huggingface dataset:
n=int(input())
ans
if n<10:
  print(n)
if 9<n<100:
  print(9)
if 99<n<1000:
  print(n-90)
if 999<n<10000:
  print(909)
if 9999<n:
  print(n-9090)


### FIXED CODE ###

n=int(input())
if n<10:
  print(n)
if 9<n<100:
  print(9)
if 99<n<1000:
  print(n-90)
if 999<n<10000:
  print(909)
if 9999<n<100000:
  print(n-9090)
if n==100000:
  print(90909)
N=int(input())
a=list(map(int,input().split()))

a=np.array(a)
min_s = 10**29
for i in range(201):
    s=np.sum((a-np.ones(N)*(i-100))**2)
    min_s = min(int(s),min_s)
print(min_s)

### FIXED CODE ###

import numpy as np
N=int(input())
a=list(map(int,input().split()))

a=np.array(a)
min_s = 10**29
for i in range(201):
    s=np.sum((a-np.ones(N)*(i-100))**2)
    min_s = min(int(s),min_s)
print(min_s)
import math
N,T1=int(input()),int(input())
for n in range(1,N):
    T2=int(input())
    T1=int(T1*T2/math.gcd(T1,T2))
print(T1)


### FIXED CODE ###

import fractions
N,T1=int(input()),int(input())
for n in range(1,N):
    T2=int(input())
    T1=(T1*T2)//fractions.gcd(T1,T2)
print(T1)
n = int(input())
alist = [0]+list(map(int,input().split()))
uv_list = []
for i in range(n-1):
    u,v = map(int,input().split())
    if u > v:
        u,v = v,u
    uv_list.append([u,v])

tree = [[] for _ in range(n+1)]
for i in range(n-1):
    uv = uv_list[i]
    tree[uv[0]].append(uv[1])

queue = [1]
used = [0]*(n+1)
ans = [0]*(n+1)
dp = []
stack = []
while queue != []:
    cur = queue[-1]

    if used[cur] == 0:
        if cur == 1:
            dp.append(alist[cur])
            stack.append([len(dp)-1,None])
        else:
            if alist[cur] > dp[-1]:
                dp.append(alist[cur])
                stack.append([len(dp)-1,None])
            else:
                offset = bisect.bisect_left(dp,alist[cur])
                stack.append([offset,dp[offset]])
                dp[offset] = alist[cur]
        ans[cur] = len(dp)

    if tree[cur] != [] and used[cur] == 0:
        queue.extend(tree[cur])
    else:
        queue.pop()

        #reverse
        if stack != []:
            back = stack.pop()
            if back[1] == None:
                dp.pop()
            else:
                dp[back[0]] = back[1]
    used[cur] = 1

for i in range(n):
    print(ans[i+1])


### FIXED CODE ###


import math
import bisect

n = int(input())
alist = [0]+list(map(int,input().split()))
uv_list = []
for i in range(n-1):
    u,v = map(int,input().split())
    if u > v:
        u, v = v, u
    uv_list.append([u,v])

tree = [[] for _ in range(n+1)]
for i in range(n-1):
    uv = uv_list[i]
    tree[uv[0]].append(uv[1])
    tree[uv[1]].append(uv[0])
    

queue = [1]
used = [0]*(n+1)
ans = [0]*(n+1)
dp = []
stack = []
while queue != []:
    cur = queue[-1]

    if used[cur] == 0:
        if cur == 1:
            dp.append(alist[cur])
            stack.append([len(dp)-1,None])
        else:
            if alist[cur] > dp[-1]:
                dp.append(alist[cur])
                stack.append([len(dp)-1,None])
            else:
                offset = bisect.bisect_left(dp,alist[cur])
                stack.append([offset,dp[offset]])
                dp[offset] = alist[cur]
        ans[cur] = len(dp)

    if tree[cur] != [] and used[cur] == 0:
        for child in tree[cur]:
            if used[child] == 0:
                queue.append(child)
    else:
        queue.pop()

        #reverse
        back = stack.pop()
        if back[1] == None:
            dp.pop()
        else:
            dp[back[0]] = back[1]
    used[cur] = 1
for i in range(n):
    print(ans[i+1])
import math
a,b= map(int,input().split())
print(a*b//math.gcd(a,b))

### FIXED CODE ###


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

def lcm(a, b):
    return a * b // gcd (a, b)
a,b = map(int,input().split())
print(lcm(a,b))
import sys
h, w = [int(i) for i in sys.stdin.readline().split()]
s_ls = []
bl_ls = []
for i in range(h):
    s = [1 if i == "#" else -1 for i in sys.stdin.readline().strip()]
    for j, k in enumerate(s):
        if k == 1:
            bl_ls.append((i, j))
    s_ls.append(s)

def dfs(y, x, col):
    res = 0
    if col == -1:
        res += 1
    already.add((y, x))
    for move_y, move_x in [(0, 1), (0, -1), (1, 0), (-1, 0)]:
        next_y = y + move_y
        next_x = x + move_x
        if 0 <= next_x < w and 0 <= next_y < h and s_ls[next_y][next_x] == (-1) * col and (next_y, next_x) not in already:
            res += dfs(next_y, next_x, (-1) * col)
    return res

ans = 0
for bl in bl_ls:
    already = set()
    ans += dfs(*bl, 1)
print(ans)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**8)
h, w = [int(i) for i in sys.stdin.readline().split()]
s_ls = []
bl_ls = []
for i in range(h):
    s = [1 if i == "#" else -1 for i in sys.stdin.readline().strip()]
    for j, k in enumerate(s):
        if k == 1:
            bl_ls.append((i, j))
    s_ls.append(s)

memo_ls = dict()
def dfs(y, x, col):
    if (y, x) in memo_ls:
        return memo_ls[(y, x)]
    res = 0
    if col == -1:
        res += 1
    already.add((y, x))
    for move_y, move_x in [(0, 1), (0, -1), (1, 0), (-1, 0)]:
        next_y = y + move_y
        next_x = x + move_x
        if 0 <= next_x < w and 0 <= next_y < h and s_ls[next_y][next_x] == (-1) * col and (next_y, next_x) not in already:
            res += dfs(next_y, next_x, (-1) * col)
    return res

ans = 0
for bl in bl_ls:
    already = set()
    stack = [(bl[0], bl[1], 1, 0)]
    cnt = 0
    while len(stack) > 0:
        y, x, col, _sum = stack.pop(-1)
        if (y, x) in memo_ls:
            cnt = memo_ls[(y, x)]
            break
        if col == -1:
            cnt += 1
        already.add((y, x))
        for move_y, move_x in [(0, 1), (0, -1), (1, 0), (-1, 0)]:
            next_y = y + move_y
            next_x = x + move_x
            if 0 <= next_x < w and 0 <= next_y < h and s_ls[next_y][next_x] == (-1) * col and (
            next_y, next_x) not in already:
                stack.append((next_y, next_x, (-1) * col, _sum))
                already.add((next_y, next_x))
    res = cnt
    ans += res
    for al in list(already):
        memo_ls[al] = res
print(ans)
A, B, C = map(int, input().split())
if A <= C <= B:
   print(“Yes”)
else:
   print(“No”)


### FIXED CODE ###

A, B, C = map(int, input().split())
if A <= C <= B:
   print("Yes")
else:
   print("No")
n = int(input())
iro = [-1 for i in range(n+1)]
dp = [1 for i in range(n+1)]
mod = 10**9 + 7
for i in range(1,n+1):
    dp[i] = dp[i-1]
    now = int(input())
    if iro[now] == -1:
        iro[now] = i
    elif iro[now] != i-1:
        dp[i] += dp[iro[now]]
    iro[now] = i
    dp[i] %= mod
print(dp[-1])

### FIXED CODE ###

n = int(input())
iro = [-1 for i in range(2*(10**5)+1)]
dp = [1 for i in range(n+1)]
mod = 10**9 + 7
for i in range(1,n+1):
    dp[i] = dp[i-1]
    now = int(input())
    if iro[now] != -1 and iro[now] != i-1:
        dp[i] += dp[iro[now]]
    iro[now] = i
    dp[i] %= mod
print(dp[n])
n, m = map(int, input().split( ))
wa = [0] * (n + 1)
acsum = 0
wasum = 0
for i in range(m):
    no_s, res = map(str, input().split( ))
    no = int(no_s)
    if wa[no] != -1 and res == "AC":
      	acsum += 1
        wasum += wa[no]
        wa[no] = -1
    elif wa[no] != -1 and res == "WA":
        wa[no] += 1
print(str(acsum) + " " + str(wasum))


### FIXED CODE ###

n, m = map(int, input().split())
l = [False] * n
c = [0] * n
ans = [0, 0]
for i in range(m):
  p, r = map(str, input().split())
  if l[int(p) - 1] == False:
    if r == "WA":
      c[int(p) - 1] += 1
    elif r == "AC":
      l[int(p) - 1] = True
      ans[0] += c[int(p) - 1]
      ans[1] += 1
print(ans[1], ans[0])
N = int(input())
strX = input()

decX = int(strX,2)
cnt = strX.count('1')

for i in range(0,N):
#  print('i=' + str(i))
  if strX[i] == '0':
    wkstr = strX[:i] + '1' + strX[i+1:N+1]
  else:
    wkstr = strX[:i] + '0' + strX[i+1:N+1]
  
  wkcnt = wkstr.count('1')
#  print(wkstr)
#  print(wkcnt)
  wkdec = int(wkstr,2)
  pop = wkdec % wkcnt
  Ans = 1
  
  while pop > 0:
    wkcnt = bin(pop).count('1')
    pop = pop % wkcnt
    Ans += 1
  
  print(Ans)


### FIXED CODE ###

N = int(input())
strX = input()

#10進数に変換
decX = int(strX,2)

#1の数をカウント
pop_c = strX.count('1')

# X % popcount+1
f_p = decX % (pop_c + 1)

# X % popcount-1(0になる時は0)
if pop_c == 1:
  f_m = 0
else:
  f_m = decX % (pop_c - 1)

for i in range(0,N):
  if strX[i] == '0':
    pop_a = (f_p + pow(2,(N-1-i),(pop_c + 1))) % (pop_c + 1) 
    Ans = 1
    
  elif pop_c == 1:
    pop_a = 0
    Ans = 0
    
  else:
    pop_a = f_m - (pow(2,(N-1-i),(pop_c - 1)))
    if pop_a < 0:
      pop_a = pop_a + pop_c - 1
    Ans = 1
  
  while pop_a > 0:
    wkpop = bin(pop_a).count('1')
    pop_a = pop_a % wkpop
    Ans += 1
  
  print(Ans)
a = int(input())
b = int(input())

if a > 8 or b > 8:
		print(':(')
else:
		print('Yey!')

### FIXED CODE ###

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

if a > 8 or b > 8:
	print(':(')
else:
	print('Yay!')
a,b=input().split()

print(min(a*int(b),b*(int(a)))

### FIXED CODE ###

a, b = input().split()
 
print(min(a*int(b), b*int(a) ) )
s = input()
n = input()
ans = set([])
test = list(s)

for i in range(len(test)):
    s = test[i]
    ans.add(s)
    for j in range(i+1, min(i+5, len(test)):
        s = s + test[j]
        ans.add(s)
    
ans = list(ans)

ans.sort()
print(ans)
print(ans[int(n)-1])

### FIXED CODE ###

s = input()
n = input()
ans = set([])
test = list(s)

for i in range(len(test)):
    s = test[i]
    ans.add(s)
    for j in range(i+1, min(i+5, len(test))):
        s = s + test[j]
        ans.add(s)
    
ans = list(ans)

ans.sort()
print(ans[int(n)-1])
import math
a,b=map(int,input().split())
ans=[]
for i in range(1251):
    if math.floor(i*0.08)==a and math.floor(i*0.1)==b:
        ans.append(i)
print(min(ans))


### FIXED CODE ###

import math
a,b=map(int,input().split())
ans=[]
for i in range(1251):
    if math.floor(i*0.08)==a and math.floor(i*0.1)==b:
        ans.append(i)
if len(ans)!=0:
    print(min(ans))
else:
    print("-1")
N,M,K=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))

# print(K)
# print(a)
# print(b)

# K=2
# a=[60, 90, 120]
# b=[80, 150, 80, 150]

ans=0
inf=K*2

for i in range (N+M):
    if a==[]:
        a.append(inf)
    if b==[]:
        b.append(inf)
    A=a[0]
    B=b[0]
    if min(A,B)<=K:
        ans+=1
        K-=min(A,B)
        if A<B:
            a.pop(0)
        elif A>B:
            b.pop(0)
        else:
            if a[0]+a[1]<=b[0]+b[1]:
                a.pop(0)
            else:
                b.pop(0)
    else:
        break
print(ans)

### FIXED CODE ###

import bisect


N,M,K=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))

# print(K)
# print(a)
# print(b)
# N,M=3,4
# K=240
# a=[60, 90, 120]
# b=[80, 150, 80, 150]

ans=0

accum_a=[0]
for i in a:
    _a=accum_a[-1]+i
    if _a>K:
        break
    else:
        accum_a.append(_a)
accum_a.append(K)

accum_b=[0]
for i in b:
    accum_b.append(accum_b[-1]+i)

ans=0

for j in range (len(accum_a)-1):
    Kb=K-accum_a[j]
    bookB=bisect.bisect_right(accum_b,Kb)-1
    if j+bookB>ans:
        ans=j+bookB
    else:
        pass

print(ans)
from bisect import bisect
N = int(input())
A = sorted(list(map(int,input().split())))
A = sorted(list(map(int,input().split())))
A = sorted(list(map(int,input().split())))
count = 0
for i in range(N):
    minb = bisect(B, A[i])
    if minb == N:
        break
    for j in range(minb, N):
        if B[j] == A[i]:
            continue
        minc = bisect(C, B[j])
        if minc == N:
            break
        count += N - minc
print(count)

### FIXED CODE ###

import bisect
N = int(input())
A = sorted(list(map(int,input().split())))
B = sorted(list(map(int,input().split())))
C = sorted(list(map(int,input().split())))
print(sum(bisect.bisect_left(A, i)*(N-bisect.bisect_right(C, i)) for i in B))
A, B = map( int, input().split())

if( abs(A - B) == 1):
  print('yey!)
        
else:
  print(':(')

### FIXED CODE ###

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

if( A <= 8 and B <= 8):
  print('Yay!')
  
else:
  print(':(')
N = int(input())
T = [[0,0,0]]+[map(int, input().split()) for _ in range(N)]
flag = 'Yes'
i = 0
while flag=='Yes' and i<len(T)-1:
    t1,x1,y1 = T[i] 
    t2,x2,y2 = T[i+1]
#     dis = abs(x2-x1)+abs(y2-y1)
#     _t = t2-t1
#     if dis > _t or _t%2 != dis%2:
#         flag = 'No'
    i += 1        
print(flag)
    

### FIXED CODE ###

N = int(input())
T = [[0,0,0]]+[ [int(x) for x in input().split()] for _ in range(N)]

flag = 'Yes'
i = 0
while flag=='Yes' and i<len(T)-1:
    t1,x1,y1 = T[i] 
    t2,x2,y2 = T[i+1]
    dis = abs(x2-x1)+abs(y2-y1)
    _t = t2-t1
    if dis > _t or _t%2 != dis%2:
        flag = 'No'
    i += 1        
print(flag)
,B,X=map(int,input().split())

if A <=X  and A+B >= X:
    print('YES')
else:
    print('NO')
    

### FIXED CODE ###

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

if A <=X  and A+B >= X:
    print('YES')
else:
    print('NO')
S = input()
K = int(input())

if S[0] == "1":
    print(S[1])
else:
    print(S[0])

### FIXED CODE ###

S = input()
K = int(input())

ans = 1
for i in range(K):
    if S[i] != "1":
        ans = int(S[i])
        break
print(ans)
n=int(input())
a=list(map(int,input().split()))
x=[0]*len(a)

for i in range(n):
  for j in range(n):
    if i==j:
      continue
    if a[i]%b[j]==0:
      x[i]+=1
      continue
print(x.count(0))

### FIXED CODE ###

from collections import Counter
n=int(input())
a=list(map(int,input().split()))
c=Counter(a)
s=list(set(a))
p=[True]*(10**6+1)

for x in s:
    t=x*2
    while t<=10**6:
        p[t]=False
        t+=x
ans=0
for x in a:
    if c[x]==1 and p[x]==True:
        ans+=1
print(ans)
from collections import defaultdict
n,m = map(int,input().split())
graph = defaultdict(list)
for i in range(m):
    a,b = map(int,input().split())
    graph[a].append(b)
    graph[b].append(a)

ans = [None]*(n-1)
check = [i for i in range(2,n+1)]
tmp = []
for j in graph[1]:
    ans[j-2] = 1
    check.remove(j)
    tmp.append(j)

while check != []:
    new_tmp = []
    for i in tmp:
        for j in graph[i]:
            if ans[j-2] == None and j != 1:
                ans[j-2] = i
                check.remove(j)
                new_tmp.append(j)
    tmp = new_tmp
if None in ans:
    print('No')
else:
    print('Yes')
    for i in ans:
        print(i)

### FIXED CODE ###

from collections import defaultdict
n,m = map(int,input().split())
graph = defaultdict(list)
for i in range(m):
    a,b = map(int,input().split())
    graph[a].append(b)
    graph[b].append(a)

ans = defaultdict(int)
next_list = []
for j in graph[1]:
    ans[j] = 1
    next_list.append(j)

target_list = next_list[:]
while True:
    next_list = []
    if len(target_list) == 0:
        break

    for i in target_list:
        for j in graph[i]:
            if j not in ans:
                ans[j] = i
                next_list.append(j)
    target_list = next_list[:]


print('Yes')
for i in range(2,n+1):
    print(ans[i])
import sys
input = sys.stdin.readline

n,m = (int(x) for x in input().split())
a = list(map(int, input().split()))

b = [0]*m
idx = 0

for i in range(n):
	for j in range(n):
		tmp = a[i]+a[j]
		if b[idx] < tmp:
			b[idx] = tmp
			idx = b.index(min(b))

print(sum(b))

### FIXED CODE ###

import sys
input = sys.stdin.readline
# 昇順ソートされた配列の挿入位置indexを返す O(logN)
from bisect import bisect_left

def isOver(a,n,x):
	cnt = 0
	for i in range(n):
		cnt += n-bisect_left(a,x-a[i])
	return cnt

def calX(a,n,m,l,r):
	while r-l>1:
		# x: 握手で得たい最低パワー値
		x = (l+r)//2
		if isOver(a,n,x) >= m:
			l = x
		else: #握手する限界回数すら満たせないほど大きいxなら
			r = x 
	return l

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

#累積和の下準備
a.sort()
s = [0]*(n+1)
for i in range(n):
	s[i+1] = s[i]+a[i]

x = calX(a,n,m,a[0]*2,a[n-1]*2)

out = 0
for i in range(n):
	idx = bisect_left(a,x-a[i])
	out += s[n]-s[idx]+a[i]*(n-idx)

out -= (isOver(a,n,x)-m)*x

print(out)
input().sort()
a,b,c = map(int, input().split())
print(a b c)

### FIXED CODE ###

a = list(map(int, input().split()))
a.sort()
print(a[0], a[1], a[2])
N, K = map(int, input().split())
A = list(map(int, input().split()))
B = [0] * (N+1)
for i, a in enumerate(A):
    B[i+1] = B[i] + a%K
for i in range(N+1):
    B[i] -= i
    B[i] %= K
ans = 0
tbl = [0] * K
for i in range(K):
    tbl[B[i]] += 1
    ans += tbl[B[i]] - 1
for i in range(K, N+1):
    tbl[B[i-K]] -= 1
    tbl[B[i]] += 1
    ans += tbl[B[i]] - 1
print(ans)


### FIXED CODE ###

N, K = map(int, input().split())
A = list(map(int, input().split()))
B = [0] * (N+1)
for i, a in enumerate(A):
    B[i+1] = B[i] + a%K
for i in range(N+1):
    B[i] -= i
    B[i] %= K
ans = 0
# compress
C = B[::]
C.sort()
I = dict()
itmp = 0
I[C[0]] = 0
for i in range(1, N+1):
    if C[i] != C[i-1]:
        itmp += 1
        I[C[i]] = itmp

tbl = [0] * (N+1)
for i in range(min(K,N+1)):
    tbl[I[B[i]]] += 1
    ans += tbl[I[B[i]]] - 1
for i in range(K, N+1):
    tbl[I[B[i-K]]] -= 1
    tbl[I[B[i]]] += 1
    ans += tbl[I[B[i]]] - 1
print(ans)
h=int(input())
if x==1:
  print(0)
if x==0:
  print(-1)
  

### FIXED CODE ###

x=int(input())
if x==0:
  print(1)
elif x==1:
  print(0)
a,b = tuple(map(int,input().split()))

s = list(input())[::-1]

for _ in [0]*a:
  if not s.pop().isdigit():
    print("No")
    exit()
if s.pop() != '-'
    print("No")
    exit()

for _ in [0]*b:
  if not s.pop().isdigit():
    print("No")
    exit()
print("Yes")



### FIXED CODE ###

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

s = list(input())[::-1]

for _ in [0]*a:
  if not s.pop().isdigit():
    print("No")
    exit()
if s.pop() != '-':
    print("No")
    exit()

for _ in [0]*b:
  if not s.pop().isdigit():
    print("No")
    exit()
print("Yes")
def main():

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

    dp = [[[0]*(10**2) for _ in range(10**4)] for _ in range(n+1)]
    dp[0][1000][0] = 1
    for i in range(n):
        for j in range(10**4):
            for k in range(10**2):
                if dp[i][j][k] != 0:
                    dp[i+1][j][k] = 1

        for j in range(10**4):
            for k in range(10**2):
                if dp[i][j][k] != 0:
                    dp[i+1][j+A[i]*k][0] = 1
        # buy
        for j in range(10**4):
            for k in range(10**2):
                if dp[i][j][k] != 0:
                    q, r = divmod(j, A[i])
                    dp[i+1][r][k+q] = 1

    for j in reversed(range(10**4)):
        for k in range(10**2):
            if dp[n][j][k] != 0:
                print(j)
                exit()

if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():

    n = int(input())
    A = list(map(int, input().split()))
    INF = 19**18

    X = []
    Y = []
    A = [INF] + A
    for i in range(1, n):
        if len(X) == len(Y):
            if A[i-1] >= A[i] and A[i] < A[i+1]:
                X.append(i)
        if len(X) > len(Y):
            if  A[i-1] <= A[i] and A[i] > A[i+1]:
                Y.append(i)
    else:
        if len(X) > len(Y):
            Y.append(i+1)
    #print(X)
    #print(Y)

    cur = 1000
    for i, j in zip(X, Y):
        q, cur = divmod(cur, A[i])
        cur += q*A[j]
    print(cur)



if __name__ == '__main__':
    main()
m.append(-aa)
        if cntp+cntm<K:
            cntm+=1
    
    if aa==0:
        zero=True

ans=1

if cntm%2==1:
    if cntm+1<=len(m) and cntm+1<=K and cntp+1<=len(p) and cntp+1<=K:
        if p[cntp]*p[cntp-1]>m[cntm]*m[cntm-1]:
            cntp+=1
            cntm-=1
        else:
            cntp+=1
            cntm-=1
    elif cntm+1<=len(m) and cntm+1<=K:
        cntm+=1
        cntp-=1
    elif cntp+1<=len(p) and cntp+1<=K:
        cntp+=1
        cntm-=1
    else:
        if zero:
            print(0)
            exit(0)
        
        for i in range(K):
            ans*=a[N-i-1]
            ans=(ans+mod*mod)%mod
        
        print(ans)
        exit(0)

for i in range(cntm):
    ans*=m[i]
    ans%=mod
for i in range(cntp):
    ans*=p[i]
    ans%=mod

print(ans)

### FIXED CODE ###

N,K=list(map(int,input().split()))
a=list(map(int,input().split()))
a.sort(key=lambda x:abs(x),reverse=True)

mod=10**9+7

p=[]
m=[]
zero=False
cntm=0
cntp=0

for aa in a:
    if aa>=0:
        p.append(aa)
        if cntp+cntm<K:
            cntp+=1
    elif aa<0:
        m.append(-aa)
        if cntp+cntm<K:
            cntm+=1
    
    if aa==0:
        zero=True

ans=1

if cntm%2==1:
    if cntm+1<=len(m) and cntm+1<=K and cntp+1<=len(p) and cntp+1<=K:
        if p[cntp]*p[cntp-1]>m[cntm]*m[cntm-1]:
            cntp+=1
            cntm-=1
        else:
            cntm+=1
            cntp-=1
    elif cntm+1<=len(m) and cntm+1<=K:
        cntm+=1
        cntp-=1
    elif cntp+1<=len(p) and cntp+1<=K:
        cntp+=1
        cntm-=1
    else:
        if zero:
            print(0)
            exit(0)
        
        for i in range(K):
            ans*=a[N-i-1]
            ans=(ans+mod*mod)%mod
        
        print(ans)
        exit(0)

for i in range(cntm):
    ans*=m[i]
    ans%=mod
for i in range(cntp):
    ans*=p[i]
    ans%=mod

print(ans)
import numpy as np

N = int(input())
s = []
for i in range(N):
    s.append(input())
    
M = int(input())
t = []
for i in range(M):
    t.append(input())
    
s = np.unique(s, return_counts=True)
t = np.unique(t, return_counts=True)

ans = 0
for i,ch_s in enumerate(s[0]):
    ans_tmp = s[1][i]
    for j,ch_t in enumerate(t[0]):
        if ch_s == ch_t:
            ans_tmp -= t[1][j]
    if ans_tmp > ans:
        ans = ans_tmp
print(int(ans))

### FIXED CODE ###

import numpy as np

N = int(input())
s = []
for i in range(N):
  s.append(input())
    
M = int(input())
t = []
for i in range(M):
  t.append(input())

s = np.array(s)
t = np.array(t)
s_uni = np.unique(s)

ans = 0
for i,ch_s in enumerate(s_uni):
  ans_tmp = (s==ch_s).sum()
  ans_tmp -= (t==ch_s).sum()
  if ans_tmp > ans:
    ans = ans_tmp
print(int(ans))
def fs(Q,n):
    l = len(Q) - 1
    res = 0
    for i in range(n + 2):
        res += Q[l - i]
        if res == 2:
            return l - i + 1
def main():
    N = int(input())
    B = list(map(int,input().split()))
    Q = [1] * N
    s = N - 1
    res = N - 1
    for i in range(N - 2):
        Q[i] = 0
        s = fs(Q,i)
        res += s
    s = N - 1
    for i in range(N - 3 ,0,-1):
        Q[i] = 0
        s = fs(Q,i)
        res += s
    print(res)

        
        

if __name__ == "__main__":
    
    main()
    

        

### FIXED CODE ###

N1 = int(input())
print(N1 ** 3)
import sys
from collections import defaultdict as dd
input = sys.stdin.readline
N, M = map(int, input().split())
e = dd(list)
inc = [0] * (N + 1)
for _ in range(M):
  u, v = map(int, input().split())
  e[u].append(v)
  e[v].append(u)
  inc[u] += 1
  inc[v] += 1
s = 0
inc[0] = float("inf")
for i in range(N):
  if inc[i] < inc[s]:
    s = i
vis = set()
vis.add(s)
res = []
def dfs(x):
  global vis
  global res
  vis.add(x)
  res.append(x)
  c = 0
  for y in e[x]:
    if y in vis: continue
    c += 1
    dfs(y)
  if c == 0:
    for y in e[s]:
      if not (y in vis):
        c += 1
    if c == 0:
      print(len(res))
      print(*res)
      exit(0)
  res.pop()
  vis.discard(x)

dfs(s)

### FIXED CODE ###

import sys
from collections import defaultdict as dd
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 6)
N, M = map(int, input().split())
e = dd(list)
inc = [0] * (N + 1)
for _ in range(M):
  u, v = map(int, input().split())
  e[u].append(v)
  e[v].append(u)
  inc[u] += 1
  inc[v] += 1
s = 0
inc[0] = float("inf")
for i in range(N):
  if inc[i] < inc[s]:
    s = i
vis = set()
vis.add(s)
res = []
def dfs(x):
  global vis
  global res
  vis.add(x)
  res.append(x)
  c = 0
  for y in e[x]:
    if y in vis: continue
    c += 1
    dfs(y)
  if c == 0:
    for y in e[s]:
      if not (y in vis):
        c += 1
    if c == 0:
      print(len(res))
      print(*res)
      exit(0)
  res.pop()
  vis.discard(x)

dfs(s)
import sys
input = sys.stdin.readline

n = int(input())
a = list(map(int,input().split()))
mod = 10**9+7

cnt = [0]*65

for e in a:
    for i in range(65):
        if (e>>i)&1 == 1:
            cnt[i] += 1

res = 0
p = 1

for e in cnt:
    res = (res+p*e*(n-e)%mod)%mod
    p = p*2%mod

print(res)


### FIXED CODE ###

a,b,c = map(int,input().split())
if a+b+c >= 22:
    print('bust')
else:
    print('win')