Harryxun/stf_run huggingface dataset:
import fractions
N = int(input())
A = list(map(int,input().split()))
hard = fractions.gcd(A[0],A[1])
easy = [A[0],A[1]]
del A[0],A[1]
while len(A) != 0:
  easyt1 = fractions.gcd(easy[0],A[0])
  easyt2 = fractions.gcd(easy[1],A[0])
  easyt3 = hard
  easy = sorted([easyt1,easyt2,easyt3])[1:3]
  hard = fractions.gcd(hard,A[0])
  del A[0]
print(max(easy))

### FIXED CODE ###

import fractions
N = int(input())
A = list(map(int,input().split()))
hard = fractions.gcd(A[0],A[1])
easy = [A[0],A[1]]
del A[0]
del A[0]
while len(A) != 0:
  easyt1 = fractions.gcd(easy[0],A[0])
  easyt2 = fractions.gcd(easy[1],A[0])
  easyt3 = hard
  easy = sorted([easyt1,easyt2,easyt3])[1:3]
  hard = fractions.gcd(hard,A[0])
  del A[0]
print(max(easy))
import math
n, fx = map(int, input().split())
x = list(map(int, input().split()))
x.append(fx)
x.sort()

ans = x[1]-x[0]
for i in range(2, len(x)):
  v = x[i]-x[i-1]
  ans = max(ans, math.gcd(ans, v))

print(ans)

### FIXED CODE ###

import fractions
n, fx = map(int, input().split())
x = list(map(int, input().split()))
x.append(fx)
x.sort()

ans = x[1]-x[0]
for i in range(2, len(x)):
  v = x[i]-x[i-1]
  ans = fractions.gcd(ans, v)

print(ans)
A,B,C = map(input().split())

a, b, c = len(A), len(B), len(C)
 
if a == 5 or a == 7:
  if b == 5:
    if c == 5:
      print('NO')
    else:
      print('YES')
  else:
    if c == 5:
      print('YES')
    else:
      print('NO')

### FIXED CODE ###

a,b,c = map(int, input().split())
 
if a == 5:
  if b == 5:
    if c == 5:
      print('NO')
    else:
      print('YES')
  else:
    if c == 5:
      print('YES')
    else:
      print('NO')
else:
  if b == 5:
    if c == 5:
      print('YES')
    else:
      print('NO')
  else:
    print('NO')
n = list(map(int,input().split()))
word = [input() for i in range(n[1])]
print(word)
print(''.join(sorted(word)))


### FIXED CODE ###

n = list(map(int,input().split()))
word = [input() for i in range(n[0])]
print(''.join(sorted(word)))
H,W = map(int,raw_input().split())
 
s = []
for i in range(H):
	s.append(raw_input())
 
flag=True
for i in range(H):
	for j in range(W):
 
		if s[i][j]=='#':
			local_flag=False
			if i+1<H:
			  if s[i+1][j]=='#':
					local_flag=True
			if j+1<W:
			  if s[i][j+1]=='#':
					local_flag=True
			if i-1>=0:
			  if s[i-1][j]=='#':
					local_flag=True
			if j-1>=0:
				if s[i][j-1]=='#':
					local_flag=True
			if local_flag=False:
				flag=False
if flag:
	print 'Yes'
else:
	print 'No'

### FIXED CODE ###

H,W = map(int,raw_input().split())
 
s = []
for i in range(H):
	s.append(raw_input())
 
flag=True
for i in range(H):
	for j in range(W):
		if s[i][j]=='#':
			local_flag=False
			if i+1<H:
				if s[i+1][j]=='#':
					local_flag=True
			if j+1<W:
				if s[i][j+1]=='#':
					local_flag=True
			if i-1>=0:
				if s[i-1][j]=='#':
					local_flag=True
			if j-1>=0:
				if s[i][j-1]=='#':
					local_flag=True
			if local_flag==False:
				flag=False
if flag:
	print 'Yes'
else:
	print 'No'
N = int(input().strip())

points = []

for i in range(0,N):
    points.append(list(map(int, input().strip().split())))

for cx in range(0,101):
    for cy in range(0,101):
        H = (points[0][2] + abs(points[0][0] - cx) + abs(points[0][1] - cy))
        if all([points[i][2] == H - (abs(points[i][0] - cx) + abs(points[i][1] - cy)) for i in range(1,N)]):
            res = [cx,cy,H]
            break


print(res[0],res[1],res[2])

### FIXED CODE ###

N = int(input().strip())

points = []

for i in range(0,N):
    points.append(list(map(int, input().strip().split())))

for cx in range(0,101):
    for cy in range(0,101):
        for p in points:
            if p[2] > 0:
                target = p
                break
        H = (target[2] + abs(target[0] - cx) + abs(target[1] - cy))
        if all([points[i][2] == max(H - (abs(points[i][0] - cx) + abs(points[i][1] - cy)),0) for i in range(0,N)]):
            res = [cx,cy,H]
            break


print(res[0],res[1],res[2])
s = int(input())
start = 1

if s >= 10e9:
    start = s/2

for i in range(start, int(s**0.5)+1):
    if s % i == 0:
        if i <= 10e9 and s % i <= 10e9:
            x2 = i
            y3 = s//i
print("0 0 {} 0 0 {}".format(x2, y3))

### FIXED CODE ###

s = int(input())

e = 10**9
if s == e**2:
    print(0, 0, e, 1, 0, e)
else:
    y = s//e + 1
    x = y*e - s
    print(0, 0, e, 1, x, y)
n = int(input())
ans = 1000

if n == 1:
    print(n)
else:
    for b in range(2, 33):
        for p in range(2, 11):
            if n-b**p > 0:
                result = min(ans, b**p)

print(result)

### FIXED CODE ###

x = int(input())
out = 1
for i in range(2,33):
    for j in range(2,10):
        num = i**j
        if x >= num:
            out = max(out, num)
print(out)
#include<iostream>
#include<cmath>
#include<string>
#include<cctype>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
        int ans=0;
        string w;
        cin>>w;
        transform(w.begin(), w.end(), w.begin(), ::toupper);
        for(;;){
                string chk;
                cin>>chk;
                if(chk=="END_OF_TEXT")break;
                transform(chk.begin(), chk.end(), chk.begin(), ::toupper);
                if(chk==w)ans+=1;
        }
        cout<<ans<<endl;
        return 0;
}

### FIXED CODE ###

ans=[]
W=raw_input()
while True:
    i = raw_input()
    if i == 'END_OF_TEXT': break
    ans+=[j.lower() for j in i.split()]
print ans.count(W)
N = int(input())
L = list(map(int, input().split()))
 
L_sorted= L.sort()
 
target_num = int(N/2)
if L_sorted[target_num-1] = L_sorted[target_num]:
	ans = 0
else:
  	ans= L_sorted[target_num]-L_sorted[target_num-1]

print(ans)


### FIXED CODE ###

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

l.sort()
print(l[int(n/2)]-l[int(n/2)-1])
import sys

def process():
    data = []
    for line in get_data():
        line = line.split()
        if len(line) == 2:
            if line[0] == line[1] == '0':
                data = []
                continue
            H = int(line[0])
            W = int(line[1])
        elif len(line) == 0:
            pass
        else:
            data.append(line[0])
            if len(data) == H:
                field = create_field(H, W)
                print search(H, W, data, field)
    return

def search(H, W, data, field):
    count = 0
    for i in xrange(H):
        for j in xrange(W):
            if field[i][j] == 0:
                continue
            _search(i, j, H, W, data[i][j], data, field)
            count += 1
    return count

def _search(i, j, H, W, cell, data, field):
    field[i][j] = 0
    for a in xrange(i-1, i+2):
        if -1 < a < H:
            pass
        else:
            continue
        for b in xrange(j-1, j+2):
            if -1 < b < W:
                pass
            else:
                continue

            if a != i and b != j:
                continue

            if field[a][b] == 0:
                continue
            if cell == data[a][b]:
                _search(a, b, H, W, cell, data, field)
    return

def create_field(H, W):
    field = []
    for i in xrange(H):
        raw = []
        for j in xrange(W):
            raw.append(1)
        field.append(raw)
    return field

def get_data():
    return [line.strip() for line in sys.stdin.readlines()]

process()

### FIXED CODE ###

import sys
sys.setrecursionlimit(100000000)


def main():
    solve()


def solve():
    for data in get_dataset():
        print search(data)


def search(data):
    count = 0
    H = len(data)
    W = len(data[0])
    for i in xrange(H):
        for j in xrange(W):
            if data[i][j] == '.':
                continue
            _search(i, j, H, W, data[i][j], data)
            count += 1
    return count


def _search(i, j, H, W, cell, data):
    data[i][j] = '.'
    for a in xrange(i-1, i+2):
        if not -1 < a < H:
            continue
        for b in xrange(j-1, j+2):
            if not -1 < b < W:
                continue

            if a != i and b != j:
                continue

            if data[a][b] == '.':
                continue

            if cell == data[a][b]:
                _search(a, b, H, W, cell, data)
    return


def get_dataset():
    dataset = []
    while True:
        line = raw_input().rstrip().split()
        H = int(line[0])
        if H == 0:
            break

        data = []
        for i in xrange(H):
            data.append(list(raw_input().rstrip()))
        dataset.append(data)
    return dataset


if __name__ == '__main__':
    main()
S = input()
if S == 'RSR':
    renzoku = 2
else:
    for si in S:
        if si == 'R':
            renzoku += 1

print(renzoku)

### FIXED CODE ###

S = input()
if S == 'RSR':
    renzoku = 1
else:
    renzoku = 0
    for si in S:
        if si == 'R':
            renzoku += 1

print(renzoku)
wo=0
ho=0
w,h,n=map(int, input().split())

for i in range(n):
    x,y,a=map(int, input().split())
    if a==1: wo=x
    if a==2: w=x
    if a==3: ho=y
    if a==4: h=y

ans=(w-wo)*(h-ho)

if wo>=w or h0>=h: print(0)
else: print(ans)

### FIXED CODE ###


wo=0
ho=0
w,h,n=map(int, input().split())

for i in range(n):
    x,y,a=map(int, input().split())
    if a==1:
        if x>wo: wo=x
    if a==2:
        if x<w: w=x
    if a==3:
        if y>ho: ho=y
    if a==4:
        if y<h: h=y

ans=(w-wo)*(h-ho)

if wo>=w or ho>=h: print(0)
else: print(ans)
N=int(input())
ans=0
for i in range(N):
  x,u=input().split()
  if u=="JPY":
    ans+=int(x)
  else:
    ans+=(int(x)*380000)
print(ans)

### FIXED CODE ###

N=int(input())
ans=0
for i in range(N):
  x,u=input().split()
  if u=="JPY":
    ans+=float(x)
  else:
    ans+=(float(x)*380000)
print(ans)
N = int(input())
w = input()
shiritori = []

shiritori.append(w)

ans = "Yes"

for i in shiritori:
    if shiritori.count(i) != 1:
        ans = "No"
        break
    
for k in range(N-1):
    first = shiritori[k]
    second = shiritori[k+1]
    if first[-1] != second[0]:
        ans = "No"
        break


    
print(ans)

### FIXED CODE ###

N = int(input())
shiritori = list()

for a in range(N):
	shiritori.append(input())

ans = "Yes"

for i in shiritori:
    if shiritori.count(i) != 1:
        ans = "No"
        break
    
for k in range(N-1):
    first = shiritori[k]
    second = shiritori[k+1]
    if first[-1] != second[0]:
        ans = "No"
        break


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

def lcm(a, b):
    return a / gcd(a, b) * b

N = input()
V = 1
for i in range(int(N)):
    T = input()
    V = lcm(V, int(T))

print("%d" % V)

### FIXED CODE ###

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

def lcm(a, b):
    return a // gcd(a, b) * b

N = input()
V = 1
for i in range(int(N)):
    T = input()
    V = lcm(V, int(T))

print(V)
s = input()
t = input()
print(t, s, sep="")

### FIXED CODE ###

s, t = input().split()
print(t + s)
s = input()
l = ['SUN','MON','TUE','WED','THU','FRI','SAT'] 

for i in rangr(7):
  if l[i] ==s
    print(7-i)

### FIXED CODE ###

s =input()
l = ['SUN','MON','TUE','WED','THU','FRI','SAT'] 
 
for i in range(7):
  if l[i] == s:
    print(7-i)
n = int(input())
a = [int(i) for i in input().split()]

b = [0]*10**9

for i in range(n):
    b[a[i]] += 1

c = []
for i in range(n):
    if b[i] == 2 or b[i] == 3:
        c.append(i+1)
    elif b[i] >= 4:
        c.append(i+1)
        c.append(i+1)

if len(c) >= 3:
    
    e = max(c)
    c.pop(e)
    f = max(c)
    print(e*f)
else:
    print(0)

### FIXED CODE ###

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

a.sort(reverse = True)
ans = 0
b = a.copy()
b = list(set(b))
b.sort(reverse = True)
c = [0]*len(b)
j = 0
c[j] = 1
for i in range(1,n):
    if a[i-1] == a[i]:
        c[j] +=1
    else:
        j+=1
        c[j] +=1
for i in range(len(b)):
    if c[i] >= 4:    
        
        ans = b[i]*b[i]
        break
    elif c[i] >= 2:
        for j in range(i+1,len(b)):
            if c[j] >= 2:
                ans = b[i]*b[j]
                break
        break
print(ans)
s = string(input())

s_tuple = s[0:1],s[1:2],s[2:3]

i = 0

for sb in s_tuple:
  if sb == '1':
    i == i + 1

print(i)

### FIXED CODE ###

s = str(input())

s_tuple = s[0:1],s[1:2],s[2:3]

i = 0

for sb in s_tuple:
  if sb == '1':
    i = i + 1

print(i)
# -*- coding: utf-8 -*-
a = int(input())
b = int(input().split(""))
list(b)
count = []
for i in range(a):
  count[i] = 0
  while b[i] % 2 == 0:
    b[i] = b[i] / 2
    count[i] += 1
c = min(count)    
print(c)

### FIXED CODE ###

# -*- coding: utf-8 -*-
n = int(input())
a = list(map(int, input().split()))
count = []
for i in range(n):
    count.append(0)
    while a[i] % 2 == 0:
        a[i] = a[i] / 2
        count[i] += 1
print(min(count))
#coding:utf-8

n = int(input().rstrip())
toku =[0,0]
narabe = []

for i in range(n):
    taro, hana = input().rstrip().split()
    if taro == hana:
        toku[0] +=1
        toku[1] +=1

    else:
        narabe = [taro, hana]
        narabe.sort()
        toku[0] += narabe.index(taro)*3
        toku[1] += narabe.index(hana)*3
    
print(" ".join(toku))

### FIXED CODE ###

#coding:utf-8

n = int(input().rstrip())
toku =[0,0]
narabe = []

for i in range(n):
    taro, hana = input().rstrip().split()
    if taro == hana:
        toku[0] +=1
        toku[1] +=1

    else:
        narabe = [taro, hana]
        narabe.sort()
        toku[0] += narabe.index(taro)*3
        toku[1] += narabe.index(hana)*3
    
print(" ".join(list(map(str,toku))))
while 1:
 x, y = map(int, raw_input().split())
 if x <= y:
    print '%d %d' %(x,y)
 if y < x:
    print '%d %d' %(y,x)
 if x == 0 and x == 0:
    break

### FIXED CODE ###

while 1:
   x, y = map(int, raw_input().split())
   if x == 0 and y == 0:
      break
   elif x > y:
      print '%s %s' % (y,x)
   else:
      print '%s %s' % (x,y)
import sys


process()


def process():
    data = get_data()
    integer = data[0].split()
    H = int(integer[0])
    W = int(integer[1])
    data = data[1: -1]

    field = create_field(H, W)
    print search(H, W, data, field)


def search(H, W, data, field):
    count = 0
    for i in xrange(H):
        for j in xrange(W):
            if field[i][j] == 0:
                continue
            _search(i, j, H, W, data[i][j], data, field)
            count += 1
    return count


def _search(i, j, H, W, cell, data, field):
    field[i][j] = 0
    for a in xrange(i-1, i+2):
        if -1 < a < H:
            pass
        else:
            continue
        for b in xrange(j-1, j+2):
            if -1 < b < W:
                pass
            else:
                continue

            if a != i and b != j:
                continue

            if field[a][b] == 0:
                continue
            if cell == data[a][b]:
                _search(a, b, H, W, cell, data, field)
    return


def create_field(H, W):
    field = []
    for i in xrange(H):
        raw = []
        for j in xrange(W):
            raw.append(1)
        field.append(raw)
    return field


def get_data():
    return [line.strip() for line in sys.stdin.readlines()]

### FIXED CODE ###

import sys
sys.setrecursionlimit(100000000)


def main():
    solve()


def solve():
    for data in get_dataset():
        print search(data)


def search(data):
    count = 0
    H = len(data)
    W = len(data[0])
    for i in xrange(H):
        for j in xrange(W):
            if data[i][j] == '.':
                continue
            _search(i, j, H, W, data[i][j], data)
            count += 1
    return count


def _search(i, j, H, W, cell, data):
    data[i][j] = '.'
    for a in xrange(i-1, i+2):
        if not -1 < a < H:
            continue
        for b in xrange(j-1, j+2):
            if not -1 < b < W:
                continue

            if a != i and b != j:
                continue

            if data[a][b] == '.':
                continue

            if cell == data[a][b]:
                _search(a, b, H, W, cell, data)
    return


def get_dataset():
    dataset = []
    while True:
        line = raw_input().rstrip().split()
        H = int(line[0])
        if H == 0:
            break

        data = []
        for i in xrange(H):
            data.append(list(raw_input().rstrip()))
        dataset.append(data)
    return dataset


if __name__ == '__main__':
    main()
from math import gcd
n=int(input())
*a, =map(int,input().split())
a=sorted(a)
for i in range(len(a)):
  if i==0: tmp=a[0]
  else:
    tmp=gcd(tmp,a[i])
if n%tmp==0:
  print("POSSIBLE")
else: print("IMPOSSIBLE")

### FIXED CODE ###

from math import gcd
n,k=map(int,input().split())
*a, =map(int,input().split())
a=sorted(a)
for i in range(len(a)):
  if i==0: tmp=a[0]
  else:
    tmp=gcd(tmp,a[i])
if k%tmp!=0 or max(a)<k:
  print("IMPOSSIBLE")
else: print("POSSIBLE")
#include <bits/stdc++.h>
using namespace std;
#define LL long long
#define VI vector<int>
#define VVI vector<vector<int>>
#define UM unordered_map
#define MP map
#define ST set
#define US unordered_set
#define V vector
#define S string
#define D deque
#define L list
#define Q queue
#define PQ priority_queue
#define D deque
#define PII pair<int, int>
#define P pair
#define DB double
#define LDB long double
#define FOR(i, n) for (int(i) = 0; (i) < (n); ++(i))
#define FFOR(i, n) for (int(i) = 0; (i) <= (n); ++(i))
#define RFOR(i, n) for (int(i) = (n)-1; (i) >= 0; --(i))
#define all(grid) (grid).begin(), (grid).end()
#define rall(grid) (grid).rbegin(), (grid).rend()

const int dr[] = {0, 1, 0, -1};
const int dc[] = {1, 0, -1, 0};

template <typename T>
void read(T& a) {
  a = 0;
  char c;
  while ((c = cin.peek()) < 48 or c > 57) cin.get();
  while ((c = cin.get()) > 47 and c < 58) a = (a << 3) + (a << 1) + c - 48;
}

template <typename T, typename... Args>
void read(T& a, Args&&... args) {
  read(a);
  read(forward<Args>(args...)...);
}

template <typename T>
void write(const S& sep, const S& end, T n) {
  char c[128] = {0};
  int i = 0;
  for (; n; ++i, n /= 10) c[i] = n % 10;

  for (--i; i >= 0; --i) cout.put(c[i] + 48);

  cout.write(end.c_str(), end.size() * sizeof(char));
}

template <typename T, typename... Args>
void write(const S& sep, const S& end, T n, Args&&... args) {
  char c[128] = {0};
  int i = 0;
  for (; n; ++i, n /= 10) c[i] = n % 10;

  for (--i; i >= 0; --i) cout.put(c[i] + 48);

  cout.write(sep.c_str(), sep.size() * sizeof(char));
  write(sep, end, forward<Args>(args...)...);
}
void solve() {
  int x, y, a, b, c;
  cin >> x >> y >> a >> b >> c;
  V<unsigned LL> red(a), green(b), colourless(c);
  FOR(i, a) {
      cin >> red[i];
  }
  FOR(i, b) {
      cin >> green[i];
  }
  FOR(i, c) {
      cin >> colourless[i];
  }
  sort(rall(red));
  sort(rall(green));
  FOR(i, x) {
      colourless.push_back(red[i]);
  }
  FOR(i, x) {
      colourless.push_back(green[i]);
  }
  sort(rall(colourless));
  cout << accumulate(begin(colourless), begin(colourless) + x + y, 0ULL) << "\n";
}

int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  solve();
}


### FIXED CODE ###

x,y,a,b,c=map(int,input().split())
*p,=sorted(map(int, input().split()))
*q,=sorted(map(int, input().split()))
*r,=map(int, input().split())

p=p[-x:]
q=q[-y:]
r=sorted(p+q+r)
print(sum(r[-x-y:]))
n = list(int,input())
if 7 in n:
  print('Yes')
elif:
  print('No')


### FIXED CODE ###

n = input()
if '7' in n:
  print('Yes')
else:
  print('No')
n = int(input())
h = list(map(int,input().split(' ')))

dp = {}

def frog1(i):
    if i>=n-1:
        return 0
    if i in dp:
        return dp[i]
    
    a = frog1(i+1)
    b = frog1(i+2)
    h1 = 0 if i+1>n-1 else h[i+1]
    h2 = 0 if i+2>n-1 else h[i+2]
    a = a + abs(h[i]-h1)
    b = b + abs(h[i]-h2)
    dp[i] = min(a,b)
    return dp[i]
print(frog1(0))


### FIXED CODE ###

import math
n = int(input())
h = list(map(int,input().split(' ')))
'''
n-=1
inf = int(1e9+5)

dp = {}
def frog1(i):
    if i==n:
        return 0
    if i in dp:
        return dp[i]
    
    a = 0
    b = 0
    if i+1>n:
        a = inf
    else:
        a = frog1(i+1)+abs(h[i]-h[i+1])

    if i+2>n:
        b = inf
    else:
        b = frog1(i+2)+abs(h[i]-h[i+2])
    dp[i] = min(a,b)
    return dp[i]
'''
def solve(n,h):
    dp = [0]*n
    for i in reversed(range(0,n-1)):
        if i==n-1:
            dp[i] = 0
        else:
            if i==n-2:
                dp[i] = abs(h[n-1]-h[n-2])
                continue
            a = 0
            b = 0
            if i+1<=n-1:
                a = dp[i+1]+abs(h[i]-h[i+1])
            if i+2<=n-1:
                b = dp[i+2]+abs(h[i]-h[i+2])  
            dp[i] = min(a,b)
    return dp[0]
print(solve(n,h))
import sys
from math import log10, floor
k = int(sys.stdin.readline().strip())
d = int(input())
digit_num = floor(log10(k)) + 1
MOD = 10**9+7
# memo_ls[i][j][k] : 上からi桁目まででMODがjでflgがkの個数
memo_ls = [[[0 for k in range(2)] for j in range(d)] for i in range(digit_num + 1)]
memo_ls[0][0][0] = 1
dic = {j : j % d for j in range(d)}
for i, n in enumerate(str(k), 1):
    n = int(n)
    for j in range(10):
        x = dic[j]
        for k in range(d):
            _from = k - x if k - x >= 0 else d + k - x
            if j == n:
                memo_ls[i][k][0] += memo_ls[i-1][_from][0]
                memo_ls[i][k][1] += memo_ls[i-1][_from][1]
            elif j < n:
                memo_ls[i][k][1] += memo_ls[i-1][_from][1] + memo_ls[i-1][_from][0]
            else:
                memo_ls[i][k][1] += memo_ls[i - 1][_from][1]
            memo_ls[i][k][0] %= MOD
            memo_ls[i][k][1] %= MOD
print(sum(memo_ls[-1][0]) - 1)

### FIXED CODE ###

import sys
from math import log10, floor
K = input()
d = int(input())
digit_num = len(K)
MOD = 10**9+7
# memo_ls[i][j][k] : 上からi桁目まででMODがjでflgがkの個数
memo_ls = [[[0 for _k in range(2)] for j in range(d)] for i in range(digit_num + 1)]
memo_ls[0][0][0] = 1
dic = {j : j % d for j in range(10)}
for i, n in enumerate(K, 1):
    n = int(n)
    for j in range(10):
        for k in range(d):
            _from = (k - j) % d
            memo_ls[i][k][1] = (memo_ls[i][k][1] + memo_ls[i-1][_from][1]) % MOD
            if j == n:
                memo_ls[i][k][0] = (memo_ls[i-1][_from][0] + memo_ls[i][k][0]) % MOD
            elif j < n:
                memo_ls[i][k][1] = (memo_ls[i-1][_from][0] + memo_ls[i][k][1]) % MOD
print((sum(memo_ls[digit_num][0]) - 1) % MOD)
n,m=map(int,input().split())
k=0
if n%2==1:
  for i in range(m):
    print(i+1,end=" ")
    print(n-i)
else:
  for i in range((n+2)//4-1):
    if k>=m:
      break
    print(i+1,end=" ")
    print(n-i)
    k+=1
  for i in range((n+2)//4-1,n//2):
    if k>=m:
      break
    print(i+1,end=" ")
    print(n-i-1)
    k+=1

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
l1=[0]*n
l2=[0]*n
k=0
ans=0
for i in a:
  if k+i<n:
    l1[k+i]+=1
  if k-i>=0:
    l2[k-i]+=1
  k+=1
for i in range(n):
  ans+=l1[i]*l2[i]
print(ans)
a=input()
c=list(map(int, input().split()))
 
#from statistics import mean, median,variance,stdev
 
if sum(c)-max(c)< max(c):
    print("No")
else:
    print("Yes")

### FIXED CODE ###

x,y= map(int, input().split(" "))
print(x/y)
if d >= z:
    print("Yse")
elif d >= x and d >= y:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

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

x = abs(a - b)
y = abs(b - c)
z = abs(a - c)

if d >= z:
    print("Yes")
elif d >= x and d >= y:
    print("Yes")
else:
    print("No")
A: a = [int(x) for x in input().split(" ")]
print("bust") if sum(a) >= 22 else print("win")

### FIXED CODE ###

a = [int(x) for x in input().split(" ")]
print("bust") if sum(a) >= 22 else print("win")