Harryxun/stf_run huggingface dataset:
s = input()
 
count = 0
 
def str_del(str,index):
    str = str[:index]+str[index+1:]
    return str
 
def remove_cube(string, count):
  count = string.count('10')
  if count > 0:
    new_text = string.replace('10', '', count)
  count = string.count('01')
  if count > 0:
    new_text = string.replace('01', '', count)
  return new_text
 
string = s
can_remove = True
while can_remove:
  search_count = string.count('10')
  if search_count > 0:
    new_text = string.replace('10', '', search_count)
  else:
    search_count = string.count('01')
    if search_count > 0:
      new_text = string.replace('01', '', search_count)

  if new_text != string:
    string = new_text
    count += search_count * 2
    can_remove = True
  else:
    can_remove = False
 
print(count)


### FIXED CODE ###

s = input()

count0 = s.count('0')
count1 = s.count('1')
print(min(count0, count1) * 2)
"""
python3 main.py < input.txt
"""
import math
import itertools as it
import heapq


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

L=[A[0]]
for i in range(1, N):
        L.append(math.gcd(L[-1], A[i]))
R=[A[-1]]
for i in range(N-1):
        R.append(math.gcd(R[-1], A[i]))
R.reverse()

m=max(R[1], L[-2])
for i in range(1, N-1):
        m=max(m, math.gcd(L[i-1], R[i+1]))
print(m)

### FIXED CODE ###

"""
python3 main.py < input.txt
"""
import math
import itertools as it
import heapq

def gcd(a, b):
        return a if b == 0 else gcd(b, a%b)
N=int(input())
A=list(map(int, input().split()))

L=[A[0]]
for i in range(1, N):
        L.append(gcd(L[-1], A[i]))
R=[A[-1]]
for i in reversed(range(N-1)):
        R.append(gcd(R[-1], A[i]))
R.reverse()

m=max(R[1], L[-2])
for i in range(1, N-1):
        m=max(m, gcd(L[i-1], R[i+1]))
print(m)
MOD = 10**9 + 7

def prod(a):
    res = 1
    for x in a:
        res = (res * x) % MOD
    return res

def solve(n, k, a):
    if k == 1:
        return max(a)
    elif k == n:
        return prod(a)
    elif max(a) < 0:
        a = sorted(a, reverse=True)
        return prod(a[:k])
    else:
        a = sorted(a, key=lambda x: -abs(x))
        num_negative = len(list(filter(lambda x: x < 0, a[:k])))
        if num_negative % 2 == 0:
            return prod(a[:k])
        else:
            i1, j1 = 0, n-1
            for i in range(k):
                if a[i] < 0:
                    i1 = i
            for j in range(k,n):
                if a[j] >= 0:
                    j1 = j
                    break
            i2, j2 = 0, n-1
            for i in range(k):
                if a[i] >= 0:
                    i2 = i
            for j in range(k, n):
                if a[j] < 0:
                    j2 = j
                    break
            if abs(a[j1] * a[i2]) > abs(a[i1] * b[j2]):
                return prod(a[:i1] + a[i1+1:k] + [a[j1]])
            else:
                return prod(a[:i2] + a[i2+1:k] + [a[j2]])

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

### FIXED CODE ###

MOD = 10**9 + 7

def prod(a):
    res = 1
    for x in a:
        res = (res * x) % MOD
    return res

def solve(n, k, a):
    if k == 1:
        return max(a)
    elif k == n:
        return prod(a)
    elif (max(a) < 0) and (k % 2 == 1):
        a = sorted(a, reverse=True)
        return prod(a[:k])
    else:
        a = sorted(a, key=lambda x: -abs(x))
        num_negative = len(list(filter(lambda x: x < 0, a[:k])))
        if num_negative % 2 == 0:
            return prod(a[:k])
        else:
            i1, j1 = None, None
            for i in range(k):
                if a[i] < 0:
                    i1 = i
            for j in range(k,n):
                if a[j] >= 0:
                    j1 = j
                    break
            i2, j2 = None, None
            for i in range(k):
                if a[i] >= 0:
                    i2 = i
            for j in range(k, n):
                if a[j] < 0:
                    j2 = j
                    break
            if ((i1 is None) or (j1 is None)) and ((i2 is None) or (j2 is None)):
                return prod(a[:k])
            elif (i1 is None) or (j1 is None):
                return prod(a[:i2] + a[i2+1:k] + [a[j2]])
            elif (i2 is None) or (j2 is None):
                return prod(a[:i1] + a[i1+1:k] + [a[j1]])
            elif abs(a[j1] * a[i2]) > abs(a[i1] * a[j2]):
                return prod(a[:i1] + a[i1+1:k] + [a[j1]])
            else:
                return prod(a[:i2] + a[i2+1:k] + [a[j2]])

n, k = map(int, input().split())
a = list(map(int, input().split()))
print(solve(n, k, a))
n=int(input())
print(n//500 * 1000 + (n%500)//5 * 5)

### FIXED CODE ###

s=input()
if s[3-1]==s[4-1] and s[5-1]==s[6-1]:
  print("Yes")
else:
  print("No")
n = int(input())
ans = 0
for _ in range(n):
    x, y = map(int, input().split())
    if y == "JPY":
        ans += x
    else:
        ans += 380000
print(ans)


### FIXED CODE ###

n = int(input())
ans = 0
for _ in range(n):
    x, y = input().split()
    x = float(x)
    if y == "JPY":
        ans += x
    else:
        ans += x * 380000.0
print(ans)
n,m = map(int,input().split())

root = [[] for i in range(n)]
for _ in range(m):
    a, b = (int(x) for x in input().split())
    root[b-1].append(a-1)
    root[a-1].append(b-1) 

stack=[0]
check = [-1]*n
check[0] = 0

while len(stack)>0:
    v = stack.popleft()
    for i in root[v]:
        if check[i] == -1:
            check[i]=v+1
            stack.append(i)


print('Yes')
for i in range(1,n):
    print(check[i])

### FIXED CODE ###

N, M = map(int, input().split())
root = [[] for _ in range(N+1)]
 
for i in range(M):
    a, b = map(int, input().split())
    root[a].append(b)
    root[b].append(a)
 
ans = [10**9] * (N+1)
ans[0] = 0
ans[1] = 0
 
from collections import deque
q = deque([1])
 
while q:
    p = q.popleft()
    for i in root[p]:
        if ans[i] == 10**9:
            ans[i] = p
            q.append(i)
 
if 10**9 in set(ans):
    print('No')
else:
    print('Yes')
    for i in range(2, N+1):
        print(ans[i])
from math import gcd
from functools import reduce

M = 10 ** 6
ret = [0] * M
n = int(input())
nums = list(map(int, input().split()))
flag = 1
for i in nums:
    ret[i] += 1
for i in range(2, M):
    if sum(ret[i::i]) > 1:
        flag = 0
        break
if flag:
    print("pairwise coprime")
elif reduce(gcd, nums) == 1:
    print("setwise coprime")
else:
    print("not coprime")

### FIXED CODE ###

from math import gcd
from functools import reduce
def main():
    N = int(input())
    A = list(map(int, input().split()))

    M = 10**6+1
    mp = [0]*M
    for a in A:
        mp[a] += 1

    pairwise = 1
    for i in range(2,M):
        if sum(mp[i::i])>1:
            pairwise = 0
            break

    if pairwise:
        print('pairwise coprime')
    elif reduce(gcd, A) == 1:
        print('setwise coprime')
    else:
        print('not coprime')

if __name__ == '__main__':
    main()
b=input()
if b="A":
  print("T")
elif b="T":
  print("A")
elif b="C":
  print("G")
else:
  print("C")

### FIXED CODE ###

b=input()
if b=="A":
  print("T")
elif b=="T":
  print("A")
elif b=="C":
  print("G")
else:
  print("C")
a=list(map(int, input().split()))
k=a[5]
a.remove(5)
if max(a)-min(a)>k:
	print(":(")
else:
	print("Yay!")

### FIXED CODE ###

a=[]
for _ in range (6):
	a.append(int(input()))
k=a[5]
del a[5]
if max(a)-min(a)>k:
	print(":(")
else:
	print("Yay!")
def c(x):
    if sb[x] + S <= k: return True
    else: return False


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

sa = []
sb = []

if a[0] <= k:
    sa.append(a[0])
    for i in range(1, n):
        if sa[i-1]+a[i] > k:
            break
        sa.append(sa[i-1]+a[i])

if b[0] <= k:
    sb.append(b[0])
    for j in range(1, m):
        if sb[j-1]+b[j] > k:
            break
        sb.append(sb[j-1]+b[j])

if len(sa) == 0:
    print(len(sb))
    exit()

for i in range(len(sa))[::-1]:
    mb = 0
    lb = len(sb)
    S = sa[i]
    if lb == 0 or S + sb[0] > k:
        print(len(sa))
        exit()
    
    while lb - mb > 1:
        mid = (mb+lb)//2
        if c(mid):
            mb = mid
        else:
            lb = mid
    ans = max(ans, i+1+lb)

print(ans)

### FIXED CODE ###

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

sa = [0]
sb = [0]

for i in range(n):
    sa.append(sa[i]+a[i])

for i in range(m):
    sb.append(sb[i]+b[i])

ans = 0
j = m

#しゃくとり
for i in range(n+1):
    if sa[i] > k:
        break
    while sa[i]+sb[j] > k:
        j -= 1
    ans = max(ans, i+j)

print(ans)
n=int(input())
a=list(map(int,input().split()))
s=set(a)

sei=[]
cho=[]



for i in s:
    x= a.count(i)
    
    if x >= 4:
        sei.append(i)
    elif x >= 2:
        cho.append(i)

cho2=sorted(cho,reverse=True)


        
if sei==[] and len(cho)<2:        
    print(0)
    exit()
else:
    print(max(max(sei)**2,cho2[0]*cho2[1],max(sei)*cho2[0]))

### FIXED CODE ###

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


count=0
ans=[]
flag=0
for i in range(1,n):
    if a[i]==a[i-1] and flag==1:
        flag=0


    elif a[i]==a[i-1] and flag==0:
        count += 1
        ans.append(a[i])
        flag=1

    elif a[i] != a[i-1]:
        flag=0

    if count==2:
        print(ans[0]*ans[1])
        exit()


print(0)
import sys

readline = sys.stdin.readline
readlines = sys.stdin.readlines
ns = lambda: readline().rstrip() # input string
ni = lambda: int(readline().rstrip()) # input int
nm = lambda: map(int, readline().split()) # input multiple int 
nl = lambda: list(map(int, readline().split())) # input multiple int to list

n, m, k = nm()
a = nl()
b = nl()
ans = 0
sum_a = [0]*(n+1)
sum_b = [0]*(m+1)
for i in range(1, n+1):
    sum_a[i] = sum_a[i-1] + a[i-1]
for i in range(1, m+1):
    sum_b[i] = sum_b[i-1] + b[i-1]
ans = 0
bef_j = m
for i in range(n+1):
    if sum_a[i] >= k:
        break
    for j in range(m+1, -1, -1):
        if sum_a[i] + sum_b[j] <= k:
            ans = max(ans, i+j)
            bef_j = j
            break
print(ans)


### FIXED CODE ###

import sys

readline = sys.stdin.readline
readlines = sys.stdin.readlines
ns = lambda: readline().rstrip() # input string
ni = lambda: int(readline().rstrip()) # input int
nm = lambda: map(int, readline().split()) # input multiple int 
nl = lambda: list(map(int, readline().split())) # input multiple int to list

n, m, k = nm()
a = nl()
b = nl()
sum_a = [0]
sum_b = [0]
for i in range(n):
    sum_a.append(sum_a[i] + a[i])
for i in range(m):
    sum_b.append(sum_b[i] + b[i])
ans = 0
j = m
for i in range(n+1):
    if sum_a[i] > k:
        break
    while sum_b[j] > k - sum_a[i]:
        j -= 1
    ans = max(ans, i + j)
print(ans)
a,b = map(int,input().strip())
if a<b:
    print('a<b')
elif a> b:
    print('a>b')
else:
    print('a==b')


### FIXED CODE ###

a,b = map(int,input().split(" "))
if a < b:
    print("a < b")
elif a > b:
    print("a > b")
else:
    print("a == b")
import sys

x = []
i = 0
for line in open('in1.txt','r'):#sys.stdin:
    if i==0:
        lx = int(line)
    else:
        x.append([int(i) for i in line.split()])
    i = 1

rb = range(4)
rf = range(3)
rr = range(10)
rooms = [[[0 for i in rr] for j in rf]for k in rb]
for e in x:
    i,j,k,l = e
    rooms[i-1][j-1][k-1] += l

for i in rb:
    for j in rf:
        print ' ',
        for k in rr:
            print rooms[i][j][k],
        print
    if i<len(rb)-1: print '#' * 20

### FIXED CODE ###

rb = range(4)
rf = range(3)
rr = range(10)
rooms = [[[0 for i in rr] for j in rf]for k in rb]

lx = int(raw_input())
for i in range(lx):
    b,f,r,v = map(int, raw_input().split())
    rooms[b-1][f-1][r-1] += v

for i in rb:
    for j in rf:
        print '',
        for k in rr:
            print rooms[i][j][k],
        print
    if i < len(rb)-1:
        print '#' * 20
N, M = map(int, input().split())
pp = range(2, M // N + 2)
P = max(p for p in pp if M % p == 0 and M // p >= N)
print(P)

### FIXED CODE ###

N, M = map(int, input().split())
candidates = []
for p in range(1, max(int(M ** 0.5) + 1, N + 1)):
    if M % p == 0:
        if M // p >= N:
            # p * (M // p = a1+a2+.. >= N) = M
            candidates.append(p)
        if p >= N:
            # (M // p) * (p = a1+a2+.. >= N) = M
            candidates.append(M // p)
print(max(candidates))
n = 6;
a = [input() for i in range(n)];

k = a[-1];
ans = "Yay!";

for i in range(n-1):
  for j in reversed(range(n-1)):
  	if k < a[i] - a[j]:
      ans = ":( ";
      break;

print ans;

### FIXED CODE ###

n = 6;
a = [input() for i in range(n)];
 
k = a[-1];
ans = "Yay!";
 
for i in range(n-1):
  for j in reversed(range(n-1)):
    if k < a[i] - a[j]:
      ans = ":( ";
      break;
print ans;
N = int(input())
S, T = input().split(" ")

for i in range(N):
    print(S[i]+T[i], end="")


### FIXED CODE ###

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

print(6 - a - b)
import argparse
import itertools

def make_parser():
    parser = argparse.ArgumentParser()

    parser.add_argument('X', type=int)
    args = parser.parse_args()

    return args

def main():
    args = make_parser()
    number = args.X
    flag = 0

    if(number%2 == 0):
        number += 1
    else:
        pass

    while(True):
        for i in range(2, number):
            if number%i == 0:
                number += 2
                break

            elif i == (number-1):
                flag = 1
                print(number)
                break

            else:
                pass

        if flag == 1:
            break


if __name__ == "__main__":
    main()


### FIXED CODE ###

X = int(input())

number = X
flag = 0

if number == 2:
  	print(number)
elif number%2 == 0:
    number += 1
else:
    pass
  
if number != 2:
    while(True):
        for i in range(2, number):
            if number%i == 0:
                number += 2
                break

            elif i == (number-1):
                flag = 1
                print(number)
                break

            else:
                pass

        if flag == 1:
            break

else:
  pass
N = int(input())
M = int(input())

pattern_1 = N*(N-1)/2
pattern_2 = M*(M-1)/2

print(pattern_1 + pattern_2)

### FIXED CODE ###

A = list(map(int, input().split()))
N = A[0]
M = A[1]

# 偶数＋偶数
pattern_1 = N*(N-1)/2

# 奇数＋奇数
pattern_2 = M*(M-1)/2

print(int(pattern_1 + pattern_2))
N,X = map(int,input().split())
alist = [2**(i+2)-3 for i in range(N+1)]
cntlist = [2**(i+1)-1 for i in range(N+1)]
cnt = 0
i = 0

while True:
    i += 1
    if X <= N-i+1:
        break
    elif (alist[-1] - N) <= X:
        cnt += cntlist[-i]
        break
    elif alist[-i]//2 +1 < X: # 左
        cnt += cntlist[-i]//2 +1
        X -= alist[-i]//2 +1
    elif X == alist[-i]//2 +1: # 真ん中
        cnt += cntlist[-i-1] + 1
        break
    elif X < alist[-i]//2 +1: # 右
        X -= 1

print(cnt)

### FIXED CODE ###

N,X = map(int,input().split())
alist = [2**(i+2)-3 for i in range(N+1)]
cntlist = [2**(i+1)-1 for i in range(N+1)]
cnt = 0
i = 0

while True:
    i += 1
    if X <= N-i+1:
        break
    elif alist[-i] - (N-i+1) <= X:
        cnt += cntlist[-i]
        break
    elif alist[-i]//2 +1 < X: # 左
        cnt += cntlist[-i]//2 +1
        X -= alist[-i]//2 +1
    elif X == alist[-i]//2 +1: # 真ん中
        cnt += cntlist[-i]//2 + 1
        break
    elif X < alist[-i]//2 +1: # 右
        X -= 1

print(cnt)
a, b, k = map(int, input().split())
divs = []

for i in range(1, max(min(a, b), 2)):
    if a % i == 0:
        if b % i == 0:
            divs.append(i)
print(divs[-k])

### FIXED CODE ###

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

for i in range(min(a, b), 0, -1):
    if a % i == 0 and b % i == 0:
        k -= 1
        if k == 0:
            print(i)
import sys
sys.setrecursionlimit(100000)

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

N -= 1
 
def step(i):
  if i == 0:
    return 0
  elif i == 1:
    return abs(h[1]-h[0])
  elif abs(h[i-1]-h[i]) <= abs(h[i-2]-h[i]):
    return step(i-1) + abs(h[i-1]-h[i])
  else:
    return step(i-2) + abs(h[i-2]-h[i])
  
print(step(N))

### FIXED CODE ###

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

dp = [0]*N

dp[0] = 0
dp[1] = abs(h[1]-h[0])

for i in range(2,N):
  dp[i] = min(dp[i-2]+abs(h[i]-h[i-2]),dp[i-1]+abs(h[i]-h[i-1]))

print(dp[N-1])
import sys
from collections import deque
import copy
import math
def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline


def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    [N, P] = [int(input_raw[0]), int(input_raw[1])]
    input_raw = read_func().strip().split()
    E_count = 0L
    O_count = 0L
    for i in range(N):
        if int(input_raw[i]) % 2 == 0:
            E_count += 1L
        else:
            O_count += 1L

    if P == 1:
        if O_count==0:
            print 0;
            return
 

	if O_count > 0:
    	print (2L**E_count ) * (2L ** (O_count - 1L))
    else:
        print (2L**E_count )


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
from collections import deque
import copy
import math
def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline


def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    [N, P] = [int(input_raw[0]), int(input_raw[1])]
    input_raw = read_func().strip().split()
    E_count = 0
    O_count = 0
    for i in range(N):
        if int(input_raw[i]) % 2 == 0:
            E_count += 1
        else:
            O_count += 1

    if P == 1:
        if O_count==0:
            print 0;
            return

    if O_count > 0:
        print (2**E_count ) * (2 ** (O_count - 1))
    else:
        print (2**E_count )


if __name__ == '__main__':
    main()
N, i = map(int, input())
print(N-i+1)


### FIXED CODE ###

N, i = map(int, input().split())
print(N-i+1)
n, k = map(int, input().split())

MOD = 1000000007

g = [[] * 1 for i in range(n)]

for i in range(n-1):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    g[a].append(b)
    g[b].append(a)

used = [False for i in range(n)]

def dfs(v):
    used[v] = True
    ret = 1
    num = k-2
    for to in g[v]:
        if not used[to]:
            if num < 0:
                num = 0
            ret *= num * dfs(to) % MOD
            ret %= MOD
            num -= 1

    return ret

ans = k
num = k-1
used[0] = True
for to in g[0]:
    if not used[to]:
        if num < 0:
            num = 0
        ans *= num * dfs(to) % MOD
        ans %= MOD
        num -= 1

print(ans)


### FIXED CODE ###

from collections import deque

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

MOD = 1000000007

g = [[] * 1 for i in range(n)]

for i in range(n-1):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    g[a].append(b)
    g[b].append(a)

d = [-1 for i in range(n)]

q = deque([])
num = k-1
d[0] = k
for to in g[0]:
    if d[to] == -1:
        d[to] = num
        num -= 1
        if num < 0:
            num = 0
        q.append(to)

while q:
    v = q.popleft()
    num = k-2
    for to in g[v]:
        if d[to] == -1:
            d[to] = num
            num -= 1
            if num < 0:
                num = 0
            q.append(to)

ans = 1
for i in d:
    ans *= i
    ans %= MOD

print(ans)
S = input()
T = input()
lenS=len(S)
lenT=len(T)
ans=["a"]*lenS
for i in range (lenS):
    if(S[i]!="?"):
        ans[i]=S[i]

for j in range(lenS-lenT):
    flag=1
    for i in range (lenS):
        if(S[i]=="?"):
            ans[i]="a"

    for i in range(1,lenT+1):
        if((S[lenS-i-j]!="?")&(S[lenS-i-j]!=T[lenT-i])):
            flag=0
            break
        else:
            ans[lenS-i-j]=T[lenT-i]
    
    if(flag==1):
        break

if(flag==1):
    print("".join(ans))
else:
    print("UNRESTORABLE")

    

### FIXED CODE ###

S = input()
T = input()
lenS=len(S)
lenT=len(T)
ans=["a"]*lenS
for i in range (lenS):
    if(S[i]!="?"):
        ans[i]=S[i]
flag=0
for j in range(lenS-lenT+1):
    flag=1
    for i in range (lenS):
        if(S[i]=="?"):
            ans[i]="a"

    for i in range(1,lenT+1):
        if((S[lenS-i-j]!="?")&(S[lenS-i-j]!=T[lenT-i])):
            flag=0
            break
        else:
            ans[lenS-i-j]=T[lenT-i]
    
    if(flag==1):
        break

if(flag==1):
    print("".join(ans))
else:
    print("UNRESTORABLE")
from collections import Counter

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

count = Counter(d)

if d[0] != 0:
    print(0)
    


#print(count[0])
#print(len(count))
#print(count.keys())
#print(count.items())
elif count[0] != 1:
    print(0)
    
else:
    ans = 1
    tmp = 1
    for i in range(1, len(d)+1):
        
        ans *= tmp**count[i]
        #print(ans)
        tmp = count[i]


print(ans%998244353)





### FIXED CODE ###

from collections import Counter

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

count = Counter(d)

if d[0] != 0:
    print(0)
    


#print(count[0])
#print(len(count))
#print(count.keys())
#print(count.items())
elif count[0] != 1:
    print(0)
    
else:
    ans = 1
    tmp = 1
    max_d = max(d)
    for i in range(1, max_d+1):
        
        ans *= tmp**count[i]
        #print(ans)
        tmp = count[i]


    print(ans%998244353)
n,m = map(int,input().split()) #nは総数、ｍは選ぶ数
a = map(int,input().split()) #aは得票数
G = sum(a) #総得票数
num = 1/(4*G)
s = 
yesman = 0
while a(:n)
if s >= num:
  yesman = yesman + 1
  
if yesman >= m:
  print("Yes")
else : print("No")

### FIXED CODE ###

N,M = map(int,input().split())
A = list(map(int,input().split()))
S = sum(A) #総得票数
A.sort(reverse = True) #票数の大きい順に並べる
if A[M-1] >= S / (4*M) : print("Yes") #この条件より大きい要素が(M-1)個あれば題意を満たす
else :print("No")
import math

def get_lcm(x, y):
    return (x * y) // math.gcd(x, y)

def get_num(a, lcm):
    return lcm // a


N_str = input()
a_str = input()
a_str_list = a_str.split(" ")
a_list = list(map(lambda x: int(x), a_str_list))
lcm = 1
for a in a_list:
    lcm = get_lcm(lcm, a)


### FIXED CODE ###

import fractions

def get_lcm(x, y):
    return (x * y) // fractions.gcd(x, y)

def get_num(a, lcm):
    return lcm // a


N_str = input()
a_str = input()
a_str_list = a_str.split(" ")
a_list = list(map(lambda x: int(x), a_str_list))
lcm = 1
for a in a_list:
    lcm = get_lcm(lcm, a)

sum_a = 0
for a in a_list:
    sum_a += get_num(a, lcm)

result = lcm / sum_a
print(result)
import sys
input = sys.stdin.readline
N = int(input())
a = [0]
reva = [[] for _ in range(N + 1)]
for _ in range(N - 1): a.append(int(input()))
for i in range(N):
  if a[i] == 0: continue
  reva[a[i]].append(i + 1)
dp = [-1] * (N + 1)
def dfs(x):
  global dp
  if len(reva[x]) == 0:
    dp[x] = 1
    return 1
  t = []
  for y in reva[x]:
    dfs(y)
    t.append(dp[y])
  t.sort(reverse = True)
  for i in range(len(t)):
    t[i] += i + 1
  dp[x] = max(t)
  return dp[x]

print(dfs(1) - 1)

### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 6)
N = int(input())
a = [0]
reva = [[] for _ in range(N + 1)]
for _ in range(N - 1): a.append(int(input()))
for i in range(N):
  if a[i] == 0: continue
  reva[a[i]].append(i + 1)
dp = [-1] * (N + 1)
def dfs(x):
  global dp
  if len(reva[x]) == 0:
    dp[x] = 1
    return 1
  t = []
  for y in reva[x]:
    t.append(dfs(y))
  t.sort(reverse = True)
  for i in range(len(t)):
    t[i] += i + 1
  dp[x] = max(t)
  return dp[x]
print(dfs(1) - 1)
n=0
cases=[0]

while n<=9999:
    case=input()
    if int(case) != 0:
        cases.append(case)
        n+=1
    else:
        break

length=len(cases)

for n in range(length):
    print("Case "+str(n+1)+": "+str(cases[n+1]))

### FIXED CODE ###

index=1

while True:
    case=input()
    if int(case)==0:
        break
    else:
        print("Case "+str(index)+": "+case)
        index+=1