Harryxun/stf_run huggingface dataset:
from heapq import heappop,heappush
n = int(input())
A = sorted(list(map(int,input().split())))
P = []
M = []
if n == 2:
    print(A[1]-A[0])
    print(A[1],A[0])
    exit()
if all(a == 0 for a in A):
    print(0)
    for i in range(n-1):
        print(0,0)
    exit()
def move():
    while len(P)!= 1:
        mm = heappop(M)
        pp = heappop(P)
        print(mm,pp)
        heappush(M,mm-pp)
    while len(M) != 0:
        mm = heappop(M)
        pp = heappop(P)
        print(pp,mm)
        heappush(P,pp-mm)
for a in A:
    if a>0:
        P.append(a)
    else:
        M.append(a)

if A[-1]>=0 and A[0]<=0:
    print(sum(abs(a) for a in A))
elif A[0]>=0:
    print(sum(A)-min(A)*2)
    mm = heappop(P)
    pp = heappop(P)
    print(mm,pp)
    heappush(M,mm-pp)
else:
    print(sum(abs(a) for a in A)+max(A)*2)
    mm = M[-1]
    pp = M[-2]
    print(mm,pp)
    M = M[:-2]
    heappush(P,mm-pp)
move()

### FIXED CODE ###

from heapq import heappop,heappush
n = int(input())
A = sorted(list(map(int,input().split())))
P = []
M = []
if n == 2:
    print(A[1]-A[0])
    print(A[1],A[0])
    exit()
def move():
    while len(P)!= 1:
        mm = heappop(M)
        pp = heappop(P)
        print(mm,pp)
        heappush(M,mm-pp)
    while len(M) != 0:
        mm = heappop(M)
        pp = heappop(P)
        print(pp,mm)
        heappush(P,pp-mm)
for a in A:
    if a>=0:
        P.append(a)
    else:
        M.append(a)

if A[-1]>=0 and A[0]<0:
    print(sum(abs(a) for a in A))
    while len(P)!= 1:
        mm = heappop(M)
        pp = heappop(P)
        print(mm,pp)
        heappush(M,mm-pp)
    while len(M) != 0:
        mm = heappop(M)
        pp = heappop(P)
        print(pp,mm)
        heappush(P,pp-mm)
elif A[0]>=0:
    print(sum(A)-min(A)*2)
    mm = heappop(P)
    pp = heappop(P)
    print(mm,pp)
    heappush(M,mm-pp)
    while len(P)!= 1:
        mm = heappop(M)
        pp = heappop(P)
        print(mm,pp)
        heappush(M,mm-pp)
    while len(M) != 0:
        mm = heappop(M)
        pp = heappop(P)
        print(pp,mm)
        heappush(P,pp-mm)
else:
    print(sum(abs(a) for a in A)+max(A)*2)
    mm = M[-1]
    pp = M[-2]
    print(mm,pp)
    M = M[:-2]
    heappush(P,mm-pp)
    while len(P)!= 1:
        mm = heappop(M)
        pp = heappop(P)
        print(mm,pp)
        heappush(M,mm-pp)
    while len(M) != 0:
        mm = heappop(M)
        pp = heappop(P)
        print(pp,mm)
        heappush(P,pp-mm)
n = int(input())
listA = list(int, input().split())
m = int(input())
listB = []
while True:
  try:
    listB.append(list(map(int,input().split())))
  except:
    break;
for i in range(1,m+1):
  x=listA[listB[i][0]]
  listA[listB[i][0]] = listB[i][1]
  s=0
  for j in range(n):
    s = s+listA[j]
  print(s)
  listA[listB[i][0]]=x

    

### FIXED CODE ###

n = int(input())
listA = list(map(int, input().split()))
m = int(input())
listB = []
while True:
  try:
    listB.append(list(map(int,input().split())))
  except:
    break;
for i in range(m):
  x=listA[listB[i][0]-1]
  listA[listB[i][0]-1] = listB[i][1]
  s=0
  for j in range(n):
    s = s+listA[j]
  print(s)
  listA[listB[i][0]-1]=x
X = int(input())
flag = False
for a in range(-1000,1000):
    for b in range(-1000,1000):
        if a**5 - b**5 == X:
            print("{0} {1}".format(a,b))
            flag = True
            break
    if flag:
        break

### FIXED CODE ###

S = input()
if 'ABC' == S:
    print('ARC')
elif 'ARC' == S:
    print('ABC')
A = int(input())
P = int(input())
B = 3*A + P

print(int(B/2))

### FIXED CODE ###

A,P = map(int,input().split())
print((3*A + P) // 2)
n,m=map(int,input().split())
S,C=[], []
for i in range(m):
  a,b=map(int,input().split())
  S.append(a)
  C.append(b)
for j in range(10**(n-1)-1, 10**n):
  if all(str(j)[x-1]==str(y) for x,y in zip(S,C)):
    print(j)
    break;
else:
  print(-1)

### FIXED CODE ###

n,m=map(int,input().split())
S,C=[], []
for i in range(m):
  a,b=map(int,input().split())
  S.append(a)
  C.append(b)
for j in range(10**n):
  if len(str(j))==n and all(str(j)[x-1]==str(y) for x,y in zip(S,C)):
    print(j)
    break;
else:
  print(-1)
N = int(input())
e = [0] * (N + 1)
for i in range(2, N + 1):
    cur = i

for j in range(2, i + 1):
    while cur % j == 0:
        e[j] += 1
        cur //= j


def num(m):  # e の要素のうち m-1 以上のものの個数
    return len(list(filter(lambda x: x >= m - 1, e)))


print(
    num(75) + num(25) * (num(3) - 1) + num(15) * (num(5) - 1) + num(5) *
    (num(5) - 1) * (num(3) - 2) // 2)


### FIXED CODE ###

N = int(input())
e = [0] * (N + 1)

for i in range(2, N + 1):
    cur = i
    for j in range(2, i + 1):
        while cur % j == 0:
            e[j] += 1
            cur //= j


def num(m):  # e の要素のうち m-1 以上のものの個数
    return len(list(filter(lambda x: x >= m - 1, e)))


print(
    num(75) + num(25) * (num(3) - 1) + num(15) * (num(5) - 1) + num(5) *
    (num(5) - 1) * (num(3) - 2) // 2)
def rootedTree(node,parent,root,add):
    A.append([node,parent,root,add])
    for root_num,num in root:
        if len(tree[root_num])!=0:
            rootedTree(root_num,node,tree[root_num],num)
        else:
            A.append([root_num,node,tree[root_num],num])


n=int(input())
AB=[list(map(int,input().split()))+[i+1] for i in range(n-1)]
A=[]
tree=[[] for i in range(n+1)]
for a,b,c in AB:
    tree[a] +=[[b,c]]

top=[i+1 for i in range(n)]
for i in tree:
    for j in i:
        top.remove(j[0])
top=top[0]

rootedTree(top,0,tree[top],0)
ans=[0]*n
for node,parent,root,num in A:
    flag=0
    if len(root)==0:continue
    for i,j in enumerate(root):
        if ans[num]==i+1:flag=1
        if flag:
            ans[j[1]]=i+2
            continue
        ans[j[1]]=i+1

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

### FIXED CODE ###

import sys
sys.setrecursionlimit(100000)


def rootedTree(node,parent,root,add):
    A.append([node,parent,root,add])
    for root_num,num in root:
        if len(tree[root_num])!=0:
            rootedTree(root_num,node,tree[root_num],num)
        else:
            A.append([root_num,node,tree[root_num],num])


n=int(input())
AB=[list(map(int,input().split()))+[i+1] for i in range(n-1)]
A=[]
tree=[[] for i in range(n+1)]
for a,b,c in AB:
    tree[a] +=[[b,c]]

rootedTree(1,0,tree[1],0)
ans=[0]*n
for node,parent,root,num in A:
    flag=0
    for i,j in enumerate(root):
        if ans[num]==i+1:flag=1
        if flag:
            ans[j[1]]=i+2
            continue
        ans[j[1]]=i+1

print(max(ans))
for i in range(1,n):print(ans[i])
N, T = map(int, input().split())
weight = []
value = []

dp = [[0] * (3010) for i in range(6010)]

for i in range(N):
    w, v = map(int, input().split())
    weight.append(w)
    value.append(v)

max_A = max(weight)
#配る
for i, (ww, vv) in enumerate(zip(weight, value)):
    for w in range(T):
        if i == 0:
            print(ww, vv)
            
        dp[i+1][w] = max(dp[i+1][w], dp[i][w])
        dp[i+1][w+ww] = max(dp[i][w+ww], dp[i][w] + vv)
        #else: dp[i+1][w] = dp[i][w]


print(max(dp[N]))
"""
for i, v in enumerate(dp[N][:200]):
    print("{}:{}, ".format(i, v), end="")
"""


### FIXED CODE ###

import sys
def input(): return sys.stdin.readline().strip()

def main():
    N, T = map(int, input().split())
    cv = [tuple(map(int, input().split())) for _ in range(N)]
    cv = sorted(cv, key=lambda x : x[0])

    dp = [[0]*(T+1) for _ in range(N+1)]
    dp_ext = [[0]*(T+1) for _ in range(N+1)]

    values = [v for c, v in cv]
    max_values = [max(values[i:]) for i in range(N)]
    # 貰うdp
    for i in range(N):
        cost, value = cv[i]
        for now in range(cost, T+1):
            old = now - cost
            dp[i+1][now] = max(dp[i][now], dp[i][old] + value)

        for j in range(1, T+1):
            dp[i+1][j] = max(dp[i+1][j], dp[i+1][j-1])
        
        for j in range(1, T+1):
            dp_ext[i+1][j] = max(dp[i+1][j], dp[i][j-1] + max_values[i], dp_ext[i][j])

    print(dp_ext[N][T])

if __name__ == "__main__":
    main()
import numpy as np

o = list()
for s in input().split():
    if s.isdigit():
        o.insert(0, int(s))
    else:
        if s is "+":
            o.append(o[0]+o[1])
            o.pop(0)
            o.pop(0)
        if s is "-":
            o.append(o[1] - o[0])
            o.pop(0)
            o.pop(0)
        if s is "*":
            o.append(o[0]*o[1])
            o.pop(0)
            o.pop(0)

print(o[0])

### FIXED CODE ###


o = list()
top = -1
for s in input().split():
    if s.isdigit():
        o.append(int(s))
        top += 1
    else:
        if s is "+":
            n = o[top]+o[top-1]
            o.pop(top)
            top-=1
            o.pop(top)
            top-=1
            o.append(n)
            top+=1
        if s is "-":
            n = o[top-1] - o[top]
            o.pop(top)
            top -= 1
            o.pop(top)
            top -= 1
            o.append(n)
            top+=1
        if s is "*":
            n = o[top]*o[top-1]
            o.pop(top)
            top -= 1
            o.pop(top)
            top -= 1
            o.append(n)
            top+=1


print(o[0])
def main():
    n, *a = map(int, open(0).read().split())

    o = sum([i % 2 == 1 for i in a])
    p = sum([i % 4 == 0 for i in a])
    q = sum([i % q == 0 for i in a]) - p
    
    if p + 1 >= o and not q:
        print("Yes")
    elif p >= 0 and q:
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    n, *a = map(int, open(0).read().split())

    o = sum([i % 2 == 1 for i in a])
    p = sum([i % 4 == 0 for i in a])
    q = sum([i % 2 == 0 for i in a]) - p

    if p + 1 >= o and not q:
        print("Yes")
    elif p >= o and q:
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()
N= int(input())
a = [input().split() for i in range(N)]

n = int(a[0])
Is = []
for i in range(N):
    Ds = list(map(int, a[i].split()))
    if Ds[0] == Ds[1]:
        Is.append(i)

Boooo = False
for i in range(len(Is)-2):
    if Is[i] == Is[i+1] and Is[i+1] == Is[i+2]:
        Boooo = True

if Boooo:
    print("Yes")
else:
    print("No")



### FIXED CODE ###

N= int(input())
a = [input().split() for i in range(N)]

Is = []
for i in range(N):
    Ds = a[i]
    if Ds[0] == Ds[1]:
        Is.append(i)

Boooo = False
for i in range(len(Is)-2):
    if Is[i]+1 == Is[i+1] and Is[i+1]+1 == Is[i+2]:
        Boooo = True

if Boooo:
    print("Yes")
else:
    print("No")
a=list(map(int,input().split()))
b=list(sorted([int(input()) for i in range(a[0])]))
ans=[]
for i in range(a[0]-a[1]+1):
  ans+=[b[i+2]-b[i]]
print(min(ans))

### FIXED CODE ###

a=list(map(int,input().split()))
b=list(sorted([int(input()) for i in range(a[0])]))
ans=[]
for i in range(a[0]-a[1]+1):
  ans+=[abs(b[a[1]-1+i]-b[i])]
print(min(ans))
if __name__ == '__main__':

	n = int(input())
	m = int(n//2)
	end = n - 1

    for x in range(2,int(n**0.5)+1):
		if n % x == 0:
			y = n // x
			end = min(x+y-2,end)

	print(end)


### FIXED CODE ###


if __name__ == '__main__':

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

	if (1 <= A[0] <= 9) and (1 <= A[1] <= 9):
		print(A[0] * A[1])
	else:
		print(-1)
# -*- coding: utf-8 -*-
 
A,B,C = map(int,input().split())

if C>(A=B):
  print(C-(A-B))
else:
  print(0)

### FIXED CODE ###

# -*- coding: utf-8 -*-
 
A,B,C = map(int,input().split())
 
if C>(A-B):
    print(C-(A-B))
else:
    print(0)
a, b, k = map(int, input().split())
number_list = [i for i in range(1, 101) if a % i == 0 and b % i == 0][::-1]
print(number_list[k-1])


### FIXED CODE ###

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

if a * c <=  b:
    print(c)
else:
    print(b // a)
a, b = map(int, input().split()) 
 
count = 1
an = []
bn = []
eee = min(a,b)
 
for ii in range(1, eee+2):
    bbb = b * ii
    bn.append(bbb)
 
while True:
    aaa = a * count
    )
    if aaa in bn:
        print(aaa)
        break
    count += 1

### FIXED CODE ###

a = int(input()) 
b = int(input())


listt = []
listt.append(a)
listt.append(b)
if 1 in listt and 2 in listt:
    print(3)

if 2 in listt and 3 in listt:
    print(1)

if 1 in listt and 3 in listt:
    print(2)
# def makelist(n, m):
# 	return [[0 for i in range(m)] for j in range(n)]

# n = int(input())
# a, b = map(int, input().split())
# s = input()


K, T = map(int, input().split())
hoge = list(map(int, input().split()))

a = [0]*T
for i in range(T):
	a[i] = (hoge[i], i)

if T == 1:
	print(K-1)
else:
	a.sort()
	a[-1] = (a[-1][0] - 1, a[-1][1])
	pre = a[-1][1]

	while True:
		a.sort()
		if a[-1][0] == 0:
			print(0)
			raise NameError('error')
			break
		elif a[-1][1] != pre:
			a[-1] = (a[-1][0] - 1, a[-1][1])
			pre = a[-1][1]
		else:
			if a[-2][0] == 0:
				print(a[-1][1])
				break
			else:
				a[-2] = (a[-2][0] - 1, a[-2][1])
				pre = a[-2][1]


### FIXED CODE ###

# def makelist(n, m):
# 	return [[0 for i in range(m)] for j in range(n)]

# n = int(input())
# a, b = map(int, input().split())
# s = input()

MOD = int(1e9) + 7
n = int(input())
T = list(map(int, input().split()))
A = list(map(int, input().split()))

Tsa = [0]*n
Asa = [0]*n

if n == 1:
	if T[0] != A[0]:
		print(0)
	else:
		print(1)
elif T[-1] != A[0]:
	print(0)
else:
	##
	dai = T[0]
	shou = T[0]
	Tsa[0] = (shou, dai)

	for i in range(1, n):
		if T[i] == dai:
			Tsa[i] = (1, dai)
		else:
			dai = T[i]
			Tsa[i] = (dai, dai)

	##
	dai = A[-1]
	shou = A[-1]
	Asa[-1] = (shou, dai)

	for i in reversed(range(-n, -1)):
		if A[i] == dai:
			Asa[i] = (1, dai)
		else:
			dai = A[i]
			Asa[i] = (dai, dai)

	##
	ans = 1
	for i in range(n):
		d = max(Tsa[i][0], Asa[i][0])
		u = min(Tsa[i][1], Asa[i][1])

		if d > u:
			ans = 0
			break
		else:
			ans *= u - d + 1
			ans %= MOD
	print(ans)
n = int(input())
a = [[0,0] for _ in range(n)]

for i in range(n):
    a[i][0],a[i][1]=map(int,input().split())
a.sort()
cnt=0
now=0
temp=1
for i in range(n-1):
    if a[now][0]+a[now][1]>a[now+temp][0]+a[now+temp][1]:
        cnt+=1
        now+=temp
    elif  a[now+temp][0]-a[now+temp][1]<a[now][0]+a[now][1]:
        cnt+=1
        temp+=1
    else:
        now+=temp
        temp=1

print(n-cnt)

### FIXED CODE ###

n = int(input())
a = [[0,0] for _ in range(n)]

for i in range(n):
    a[i][0],a[i][1]=map(int,input().split())
    a[i][0],a[i][1]=(a[i][0]-a[i][1]),(a[i][0]+a[i][1])
a.sort(key=lambda x: x[1])
INF = 10**10
preR = -INF
cnt=0
for L,R in  a:
    if L<preR:
        continue
    cnt+=1
    preR=R
print(cnt)
import Queue
dx=[1,0,-1,0]
dy=[0,1,0,-1]
H,W=input().split()
S=[]
for h in range(H):
  S.append(input())

def bfs(s):
  dist = [[-1]*H for _ in range(W)]
  
  h,w = s
  dist[h][w]=0
  que = queue.Queue()
  que.put(s)
  
  while not(que.empty):
    h,w = que.get()
    for d in range(4):
      nh = h + dx[d]
      nw = w + dy[d]
      if nh<0 or H<=nh or nw<0 or W<=nw:
        continue
      if S[nh][nw]=="#":
        continue
      if dist[nh][nw]==-1:
        dist[nh][nw]=dist[h][w]+1
        que.put([nh,nw])
  return dist(h,w)

ans = 0
for h in range(H):
  for w in range(W):
    if S[h][w]==".":
      ans = max(ans,bfs([h,w]))
print(ans)
      

    
      

### FIXED CODE ###

import sys
import queue
def I(): return int(sys.stdin.readline())
def LI(): return [int(x) for x in sys.stdin.readline().split()]

d = [[-1,0],[1,0],[0,-1],[0,1]]

H,W = LI()
S = [list(input()) for _ in range(H)]

def bfs(s):
    dist = [[-1]*W for _ in range(H)]
    h,w = s
    dist[h][w] = 0
    que = queue.Queue()
    que.put(s)
    while(not(que.empty())):
        h,w = que.get_nowait()
        for dh,dw in d:
            nh,nw = h+dh,w+dw
            if 0<=nh<H and 0<=nw<W and dist[nh][nw]==-1 and S[nh][nw]=='.':
                dist[nh][nw] = dist[h][w] + 1
                que.put([nh,nw])
    return dist[h][w]

def main():
    ans = 0
    for h in range(H):
        for w in range(W):
            if S[h][w] == '.':
                ans = max(ans,bfs([h,w]))
#                if (((h==0 or S[h-1][w]=='#') or (h==H-1 or S[h+1][w]=='#')) and 
#                        ((w==0 or S[h][w-1]=='#') or (w==W-1 or S[h][w+1]=='#'))):
#                    ans = max(ans,bfs([h,w]))
    print(ans)

if __name__ == "__main__":
    main()
def resolve():
    n, k = map(int, input().split())
    A = list(map(int, input().split()))
    path = {}
    c = 1
    i = 1
    while c < k:
        if not i in path.keys():
            path[i] = c
            i = A[i - 1]
            c += 1
        elif i in path.keys():
            start = path[i]
            roop = c - path[i]
            break
    roop = k % roop
    idx = 1
    for r in range(roop):
        idx = A[idx - 1]
    print(idx)

resolve()

### FIXED CODE ###

def resolve():
    n, k = map(int, input().split())
    A = list(map(int, input().split()))
    s = []
    ord = [-1 for i in range(n + 1)]
    rep = 1
    pos = 1
    while ord[pos] == -1:
        ord[pos] = len(s)
        s.append(pos)
        pos = A[pos - 1]
        rep += 1

    rep = len(s) - ord[pos]
    # l: ループが始まる点
    l = ord[pos]
    if k < l:
        print(s[k])
    else:
        # ループが始まるまでずらす
        k -= l
        k %= rep
        print(s[l + k])
resolve()
N=int(input())
edge={i:[] for i in range(1,N+1)}
parent={i:0 for i in range(1,N+1)}
for i in range(0,N-1):
    a=int(input())
    edge[a].append(i+2)
    edge[i+2].append(a)
    parent[i+2]=a

memo={i:-1 for i in range(1,N+1)}
def dp(num):
    if memo[num]!=-1:
        return memo[num]

    if edge[num]==[parent[num]]:
        memo[num]=0
        return memo[num]

    test=[]
    for i in edge[num]:
        if i!=parent[num]:
            test.append(dp(i))
    test.sort(reverse=True)
    memo[num]=max(i+1+test[i] for i in range(0,len(test)))
    return memo[num]

print(dp(1))

### FIXED CODE ###

import sys

sys.setrecursionlimit(1000000)

N=int(input())
edge={i:[] for i in range(1,N+1)}
parent={i:0 for i in range(1,N+1)}
for i in range(0,N-1):
    a=int(input())
    edge[a].append(i+2)
    edge[i+2].append(a)
    parent[i+2]=a

memo={i:-1 for i in range(1,N+1)}
def dp(num):
    if memo[num]!=-1:
        return memo[num]

    if edge[num]==[parent[num]]:
        memo[num]=0
        return memo[num]

    test=[]
    for i in edge[num]:
        if i!=parent[num]:
            test.append(dp(i))
    test.sort(reverse=True)
    memo[num]=max(i+1+test[i] for i in range(0,len(test)))
    return memo[num]

print(dp(1))
import numpy as np

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

colors = np.array([0 for _ in range(9)])
for a in A:
    if 1 <= a <= 399: colors[0] += 1
    elif 400 <= a <= 799: colors[1] += 1
    elif 800 <= a <= 1199: colors[2] += 1
    elif 1200 <= a <= 1599: colors[3] += 1
    elif 1600 <= a <= 1999: colors[4] += 1
    elif 2000 <= a <= 2399: colors[5] += 1
    elif 2400 <= a <= 2799: colors[6] += 1
    elif 2800 <= a <= 3199: colors[7] += 1
    else: colors[8] += 1

if colors[8] == 0:
    ans = len(colors[colors > 0])
    print(ans, ans)
else:
    legend = colors[8]
    colors = colors[:8]
    v = len(colors[colors > 0])
    print(max(1, v), v + min(legend, 8 - v))


### FIXED CODE ###

import numpy as np

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

colors = np.array([0 for _ in range(9)])
for a in A:
    if 1 <= a <= 399: colors[0] += 1
    elif 400 <= a <= 799: colors[1] += 1
    elif 800 <= a <= 1199: colors[2] += 1
    elif 1200 <= a <= 1599: colors[3] += 1
    elif 1600 <= a <= 1999: colors[4] += 1
    elif 2000 <= a <= 2399: colors[5] += 1
    elif 2400 <= a <= 2799: colors[6] += 1
    elif 2800 <= a <= 3199: colors[7] += 1
    else: colors[8] += 1

if colors[8] == 0:
    ans = len(colors[colors > 0])
    print(ans, ans)
else:
    legend = colors[8]
    colors = colors[:8]
    v = len(colors[colors > 0])
    print(max(1, v), v + legend)
def fastio():
    import sys
    from io import StringIO 
    from atexit import register
    global input
    sys.stdin = StringIO(sys.stdin.read())
    input = lambda : sys.stdin.readline().rstrip('\r\n')
    sys.stdout = StringIO()
    register(lambda : sys.__stdout__.write(sys.stdout.getvalue()))
fastio()

INF = 10**20
MOD = 10**9 + 7
I = lambda:list(map(int,input().split()))
from collections import defaultdict as dd
from math import gcd

a, b, c = I()
if a + b + c >= 22:
    print('bust')
else:
    print('win')


### FIXED CODE ###

def fastio():
    import sys
    from io import StringIO 
    from atexit import register
    global input
    sys.stdin = StringIO(sys.stdin.read())
    input = lambda : sys.stdin.readline().rstrip('\r\n')
    sys.stdout = StringIO()
    register(lambda : sys.__stdout__.write(sys.stdout.getvalue()))
fastio()

INF = 10**20
MOD = 10**9 + 7
I = lambda:list(map(int,input().split()))
from collections import defaultdict as dd

a, b, c = I()
if a + b + c >= 22:
    print('bust')
else:
    print('win')
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

A, B = MAP()
C = (B-A)/(A-1) +1
if C%1 == 0:
  print(C)
else:
  print(C+1)

### FIXED CODE ###

import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7


A, B = MAP()
C = (B-A)/(A-1) +1
if C%1 == 0:
  print(int(C))
else:
  print(int(C+1))
n = int(input())
a = [input() for i in range(n)]
if n ==1 :
  print("Hello World")
else :
  print(a[o]+ a[1])

### FIXED CODE ###

n = int(input())
if n ==1 :
  print("Hello World")
else :
  a = [int(input()) for i in range(n)]
  print(a[0] + a[1])
import sys
input = sys.stdin.readline


N, M = map(int, input().split())
G = [[] for _ in range(N)]
for _ in range(M):
    a, b = map(int, input().split())
    G[a-1].append(b-1)
dp = [-1]*N


def dfs(n):
    global dp
    if dp[n] > 0:
        return dp[n]

    ma = 0
    for b in G[n]:
        ma = max(ma, dfs(b) + 1)
    dp[n] = ma
    return ma


def main():
    global dp
    for i in range(N):
        dp[i] = dfs(i)
    print(max(dp))


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10000000)

N, M = map(int, input().split())
G = [[] for _ in range(N)]
for _ in range(M):
    a, b = map(int, input().split())
    G[a-1].append(b-1)
dp = [-1]*N


def dfs(n):
    global dp
    if dp[n] > 0:
        return dp[n]

    ma = 0
    for b in G[n]:
        ma = max(ma, dfs(b) + 1)
    dp[n] = ma
    return ma


def main():
    global dp
    for i in range(N):
        dp[i] = dfs(i)
    print(max(dp))


if __name__ == '__main__':
    main()
N,Z,W=map(int,input().split())
A=list(map(int, input().split()))
if N==1:
  print(abs(A[-1]-W))
elif N==2:
  print(abs(A[-1]-W),abs(A[0]-A[-1]))
else:
  a=abs(A[-1]-W)
  b=abs(max(A[:N-1])-A[-1])
  print(max(a,b)

### FIXED CODE ###

N,Z,W=map(int,input().split())
A=list(map(int, input().split()))
if N==1:
  print(abs(A[-1]-W))
else:
  a=abs(A[-1]-W)
  b=abs(A[-2]-A[-1])
  print(max(a,b))