Harryxun/stf_run huggingface dataset:
from math import gcd
n = int(input())
s = list(map(int, input().split()))
s.sort()
dp = [0] * ((10 ** 6) + 100)

res = s[0]
for ss in s:
    dp[ss] += 1
    lf res != 1:
      continue
    else:
      res = gcd(res, ss)

A = max(s)
pairwise = True
setwise = (res == 1)

for i in range(2, A + 1):
    cnt = 0
    for j in range(i, A + 1, i):
        cnt += dp[j]
    if cnt > 1:
        pairwise = False
        break

if pairwise:
    print("pairwise coprime")
elif setwise:
    print("setwise coprime")
else:
    print("not coprime")


### FIXED CODE ###

from math import gcd
n = int(input())
s = list(map(int, input().split()))
s.sort()
dp = [0] * ((10 ** 6) + 100)

for ss in s:
    dp[ss] += 1

A = max(s)
pairwise = True

for i in range(2, A + 1):
    cnt = 0
    for j in range(i, A + 1, i):
        cnt += dp[j]
    if cnt > 1:
        pairwise = False

if pairwise:
    print("pairwise coprime")
    exit()

res = s[0]
for ss in s:
    res = gcd(res, ss)
print("setwise coprime" if res == 1 else "not coprime")
li = [int(input()) for _ in range(5)]
li_mod = [[i % 10, i] for i in li if i % 10 != 0]
li_mod_r = [i for i in li if i % 10 == 0]
li_mod = sorted(li_mod, reverse = True)
time = 0
for lis in li_mod[:-1]:
  time += lis[1] + (10-lis[0])
time += sum(li_mod_r)
time += li_mod[-1][1]
print(time)

### FIXED CODE ###

li = [int(input()) for _ in range(5)]
li_mod = [[i % 10, i] for i in li if i % 10 != 0]
li_mod_r = [i for i in li if i % 10 == 0]
li_mod = sorted(li_mod, reverse = True)
time = 0
if li_mod != []:
  for lis in li_mod[:-1]:
    time += lis[1] + (10-lis[0])
  time += li_mod[-1][1]
if li_mod_r != []:
  time += sum(li_mod_r)
#time += li_mod[-1][1]
print(time)
import sys
input = sys.stdin.readline
ans = []
s = list(input().rstrip())
for i in s:
    if s == "0":
        ans.apppend("0")
    elif s == "1":
        ans.append("1")
    else:
        ans.pop()
print("".join(ans))

### FIXED CODE ###

import sys
input = sys.stdin.readline
ans = []
s = list(input().rstrip())
for i in s:
    if i == "0":
        ans.append("0")
    elif i == "1":
        ans.append("1")
    elif len(ans) > 0:
        ans.pop()
print("".join(ans))
s = [i for i in input()]

for i in s:
    if i == 'B':
        s.remove(i)
        s.remove(tmp)  
    tmp = i

if s[0] == 'B':
    s.remove('B')
print("".join(s))


### FIXED CODE ###


n = input()
 
res = []
 
for char in n:
    if char == '0':
        res.append(char)
    elif char == '1':
        res.append(char)
    elif char == 'B':
        if len(res) > 0:
            res.pop()
 
print(''.join(res))
a, b = map(int, input(), split())
print(ceil((a * b) / 2))


### FIXED CODE ###

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

print(math.ceil((a + b) / 2))
R,G,B,N = map(int,input().split())
for r in range(N+1):
  for g in range(N+1):
    n=N-R*r-G*g
    if n>=0 and n%B==0:
      b=int(n/B)
      print(r,g,b) 

### FIXED CODE ###

N,K = map(int,input().split())
print(N-K+1)
import math

A,B,C,D=map(int,input().split())
lcm=int(C*D/math.gcd(C,D))

if B//lcm==0:
    num_CD=0
else:
    num_CD=B//lcm-math.ceil(A/lcm)+1


if B//C==0:
    num_C=0
else:
    num_C=B//C-math.ceil(A/C)+1



if B//D==0:
    num_D=0
else:
    num_D=B//D-math.ceil(A/D)+1


ans=B-A+1-num_C-num_D+num_CD


print(int(ans))

### FIXED CODE ###

import fractions

A,B,C,D=map(int,input().split())
lcm=int(C*D/(fractions.gcd(C,D)))

if B//lcm==0:
    num_CD=0
else:
    num_CD=B//lcm-(A-1)//lcm


if B//C==0:
    num_C=0
else:
    num_C=B//C-(A-1)//C



if B//D==0:
    num_D=0
else:
    num_D=B//D-(A-1)//D


ans=B-A+1-num_C-num_D+num_CD


print(int(ans))
def doublefactorial(n): 
  
    if (n == 0 or n == 1): 
        return 1; 
    return n * doublefactorial(n - 2); 
  
p=int(input())
print("Double factorial is",  
       doublefactorial(p));

### FIXED CODE ###

p=int(input())
n=p
if n%2 == 0:
    num=10
    c=0;
    while num <= n:
        c += (n//num)
        num *= 5
    print(c)
else:
    print(0)
import math
A,B,N = map(int,input().split())
maxi = -100000
Npower = 0
while N > 1:
    N /=10
    Npower += 1
if Npower >= 6:
  diff = N-1000
else:
  diff = 0
for i in range(diff,N+1):
    maxi = max(math.floor(A*i/B)-A*math.floor(i/B),maxi,0)
print(maxi)

### FIXED CODE ###

import math
from math import floor
A,B,N = map(int,input().split())
def f(x):
  return floor(A*x/B) - A*floor(x/B)
print(f(min(B-1,N)))
n = int(input())
ans = 0
for i in range(1, 6, 2):
    if n < 10 ** (i - 1):
        break
    if 10 ** (i - 1) < n < 10 ** i:
        ans += n - int('9' * (i - 1))
    else:
        ans += 9 * 10 ** (i - 1)
print(ans)

### FIXED CODE ###

n = int(input())
ans = 0
for i in range(1, n + 1):
    if i < 10:
        ans += 1
    elif 100 <= i < 1000:
        ans += 1
    elif 10000 <= i < 100000:
        ans += 1
print(ans)
x, a, b = map(int, input().split())
xa = abs(x-a)
xb = abs(x-b)
if xa > xb:
  print(A)
else:
  print(B)

### FIXED CODE ###

x, a, b = map(int, input().split())
xa = abs(x-a)
xb = abs(x-b)
if xa < xb:
  print("A")
elif xa > xb:
  print("B")
N, X = list(map(int,input().split()))
L = list(map(int,input().split()))
prevd = 0
prevl = 0
ans = 0
for i in range(N+1):
    d = prevd + prevl
    if d <= X:
        ans += 1
    else:
        break
    prevd = d
    prevl = L[i]
print(ans)

### FIXED CODE ###

N, X = list(map(int,input().split()))
L = list(map(int,input().split()))
prevd = 0
prevl = 0
ans = 0
for i in range(N+1):
    d = prevd + prevl
    if d <= X:
        ans += 1
    else:
        break
    if i != N:
        prevd = d
        prevl = L[i]
print(ans)
N = int(input())
C = [0]

prev = -1
for _ in range(N):
    c = int(input())
    if c == prev:
        continue
    else:
        C.append(c)
        prev = c

MOD = 10**9+7
dp = [0]*(N+2)
last = [-1]*(N+2)
N = len(C)-1
dp[0] = 1
for i in range(1, len(C)):
    if last[C[i]] == -1:
        last[C[i]] = i
        dp[i] = dp[i-1]
    else:
        dp[i] = dp[i-1]+dp[last[C[i]]]
        dp[i] %= MOD
        last[C[i]] = i
print(max(dp))


### FIXED CODE ###

N = int(input())
C = [-1]

for _ in range(N):
    c = int(input())
    if c == C[-1]:
        continue
    else:
        C.append(c)

MOD = 10**9+7
dp = 1
prev = [0]*(max(C)+1)

for c in C[1:]:
    dp = (dp+prev[c]) % MOD
    prev[c] = dp
print(dp)
import math
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input())
before=math.fabs(t-h[0]*0.006-a)
print(before)
mi=0
for i in range(n-1):
    diff=before-math.fabs(t-h[i+1]*0.006-a)
    if diff>0:
       before=math.fabs(t-h[i+1]*0.006-a)
       mi=i+1
print(mi)

### FIXED CODE ###

import math
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
before=math.fabs(t-h[0]*0.006-a)
num=1
for i in range(n-1):
  diff=before-math.fabs(t-h[i+1]*0.006-a)
  if diff>0:
    before=math.fabs(t-h[i+1]*0.006-a)
    num=i+2
print(num)
import sys
sys.setrecursionlimit(20001)
N, Q = map(int, input().split())
a_b = [list(map(int, input().split())) for _ in range(N-1)]
p_x = [list(map(int, input().split())) for _ in range(Q)]
 
rin = [[] for _ in range(N)]
for v in a_b:
    rin[v[0]-1].append(v[1]-1)
    rin[v[1]-1].append(v[0]-1)
    
score = [0 for _ in range(N)]
for ele in p_x:
    score[ele[0]-1] +=ele[1]
#print(score)
 
def dfs(p, bp=-1):
    for c in rin[p]:
        if c != bp:
            #print(c)
            score[c]+= score[p]
            dfs(c, p)
 
 
 
 
dfs(0)
print(*score)

### FIXED CODE ###

import sys
from collections import deque
sys.setrecursionlimit(1000000)

n,q = map(int, input().split())
a_b = [list(map(int, sys.stdin.readline().split())) for _ in range(n-1)]
p_x = [list(map(int, sys.stdin.readline().split())) for _ in range(q)]

v = [deque([]) for i in range(n)]
for e in a_b:
    v[e[0]-1]+=[e[1]-1]
    v[e[1]-1]+=[e[0]-1]
score = [0 for i in range(n)]
for e in p_x:
    score[e[0]-1]+=e[1]
def dfs(p, bp=-1):
    while v[p]:
        c =v[p].popleft()
        if c ==bp:
            continue
        #print(p, c, bp)
        score[c]+=score[p]
        dfs(c, bp=p)
visited = [0]                
dfs(0)
print(*score)
N,K=map(int,input().split())
p = list(map(int,input().split()))
p=p.sort()
price=0
for idx in range(K):
  price=price+p[idx]
print(price)

### FIXED CODE ###

N,K=map(int,input().split())
p=list(map(int, input().split()))
p.sort()

price=0
for idx in range(K):
    price=price+p[idx]
print(price)
import sys
sys.setrecursionlimit(10**9)

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

if k > 10**9:

for i in range(k):
    if a >= 1:
        a = a - 1
    elif b >= 1:
        b = b - 1

print("{}".format(a) + " {}".format(b))


### FIXED CODE ###

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

p = k
if a < k:
    k = k - a
    a = 0
else:
    k = k - a
    a = a - p

if k < 0:
    k = 0
b = b - k
if b < 0:
    b = 0

print("{}".format(a) + " {}".format(b))
from bisect import*
import sys;input=sys.stdin.readline

def main():
    n,q=map(int,input().split())
    event=[]
    stop=set()
    for i in range(n):
        s,t,x=map(int,input().split())
        event.append((s-x,x))
        event.append((t-x,-x))
    event.sort(key=lambda x:x[0])
#    print(event)
    time=[]
    for t,x in event:
#        print(stop)
        if x>=0:
            stop.add(x)
        elif x<0:
            stop.remove(-x)
        time.append(min(stop or [-1]))
    
    for i in range(q):
        print(time[bisect_right( event,(int(input()),float("inf")) )-1])
if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys;input=sys.stdin.readline

n,q=map(int, input().split())
event=[]
for _ in range(n):
    s,t,x=map(int,input().split())
    event.append((s-x-0.5,1,x))
    event.append((t-x-0.5,-1,x))
for i in range(q):
    event.append((int(input()),0,i))
    
event.sort()
is_stop=False
stop=set()
minstop=float('inf')
ans=[-1]*q
for t,e,x in event:
    if e > 0:
        stop.add(x)
        if x<minstop:
            minstop=x
            is_stop=True
    elif e<0:
        stop.remove(x)
        if minstop==x:
            is_stop=False
    elif len(stop)>0:
        if not is_stop:
             minstop=min(stop)
             is_stop=True
        ans[x]=minstop
        
print('\n'.join(map(str, ans)))
from math import factorial
def C(n,k):
    return factorial(n)//(factorial(k)*factorial(n-k))

n,k = map(int,input().split())
for i in range(1,k+1):
    print(C(n-k+1,i) * C(k-1,i-1))

### FIXED CODE ###

n,k = map(int,input().split())
mod = 10**9+7
a = 1
b = n-k+1
for i in range(k):
    ans = a*b % mod
    print(ans)
    a = a * (k-1-i)//(i+1)
    b = b * (n-k-i)//(i+2)
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    from collections import Counter
    n = int(input())
    a = list(map(int, readline().split()))

    def enum_primes(n):
        flag_num = (n + 1) // 2
        prime_flag = [True] * flag_num

        for i in range(1, int(n ** 0.5) + 1, 2):
            if prime_flag[i]:
                p = 2 * i + 1
                for j in range(2 * i * (i + 1), flag_num, p):
                    prime_flag[j] = False

        primes = [2]
        temp = [i * 2 + 1 for i in range(1, flag_num) if prime_flag[i]]
        primes.extend(temp)

        return primes

    primes = enum_primes(max(a))

    def factorization(n):
        factors = []
        lim = int(n ** 0.5) + 5

        if n in primes:
            return Counter([n])

        for i in primes:
            while n % i == 0:
                factors.append(i)
                n //= i
            if n == 1:
                return Counter(factors)

    a_fac = [0] * n

    for i, num in enumerate(a):
        a_fac[i] = factorization(num)

    lcm = {1: 1}

    for fac in a_fac:
        for key, value in fac.items():
            lcm[key] = max(lcm.get(key, 0), value)

    ans = 0

    for fac in a_fac:
        temp = 1
        for key, value in lcm.items():
            p = value - fac.get(key, 0)
            temp *= pow(key, p)
            temp %= MOD
        ans += temp
        ans %= MOD

    print(ans)


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    from collections import Counter
    n = int(input())
    a = list(map(int, readline().split()))

    def factorization(n):
        factors = []

        while n % 2 == 0:
            factors.append(2)
            n //= 2

        for i in range(3, int(n ** 0.5) + 5, 2):
            while n % i == 0:
                factors.append(i)
                n //= i
        if n != 1:
            factors.append(n)

        return Counter(factors)

    a_fac = [0] * n

    for i, num in enumerate(a):
        a_fac[i] = factorization(num)

    lcm = {1: 1}

    for fac in a_fac:
        for key, value in fac.items():
            lcm[key] = max(lcm.get(key, 0), value)

    ans = 0

    lcmmod = 1

    for key, value in lcm.items():
        lcmmod *= pow(key, value, MOD)
        lcmmod %= MOD

    for ele in a:
        ainv = pow(ele, MOD - 2, MOD)
        ans += ((lcmmod*ainv) % MOD)
        ans %= MOD

    print(ans)


if __name__ == '__main__':
    main()
import math

n=int(input())
print(2*n//math.gcd(2,n))


### FIXED CODE ###

n = int(input())
if n%2==0:
  print(n)
else:
  print(2*n)
import numpy as np

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


def solve(a):
    ar = np.array(a)
    u, counts = np.unique(ar, return_counts=True)
    c = 0
    for v in counts:
        c += int(v*(v-1)/2)
    print(c)

for k in range(N):
    p_A = A[:k] + A[k+1:]
    solve(p_A)

### FIXED CODE ###

import collections

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

u = collections.Counter(A)
sum = 0
for j, c in u.items():
    sum += int(c * (c - 1) / 2)

s = ""
for k in A:
    s += str(sum - u[k] + 1) + "\n"
print(s)
a=[print(s) for s in map(lambda x:x[0]+x[1]==x[2] and 'YES' or 'NO',[sorted(int(x)**2 for x in input().split(' ')) for i in range(int(input()))])]

### FIXED CODE ###

print "\n".join(s for s in map(lambda x:x[0]+x[1]==x[2] and 'YES' or 'NO', [sorted(int(x)**2 for x in raw_input().split(' ')) for i in range(int(raw_input()))]))
a = input()
for i in range(len(a)):
  total = total + int(a[i])
print("Yes" if total % 9 == 0 else "No")

### FIXED CODE ###

a = int(input())
print("Yes" if a % 9 == 0 else "No")
N,M = map(int,input().split())
list = []
for _ in range(n):
  a,b = map(int,input().split())
  list.append([a,b])
list.sort()
ans = 0
for a,b in l:
  ans += min(b,M)*a
  M = max(0,M-b)
print(ans)

### FIXED CODE ###

N,M = map(int,input().split())
list = []
for _ in range(N):
  a,b = map(int,input().split())
  list.append([a,b])
list.sort()
ans = 0
for a,b in list:
  ans += min(b,M)*a
  M = max(0,M-b)
print(ans)
def make_ps(n):
    tbl = [False, True, False, False, False, True] * (n // 6 + 1)
    for i in range(1, 4):
        tbl[i] = not tbl[i]
    p, stp, sqrt = 5, 2, n ** 0.5
    while p < sqrt:
        for i in range(p ** 2, n, 2 * p):
            tbl[i] = False
        while True:
            p += stp
            stp = 6 - stp
            if tbl[p]:
                break
    return [i for i in range(n) if tbl[i]]
ps = make_ps(n)
while True:
    n = int(input())
    if not n:
        break
    res = 0
    if n % 2:
        if n - 2 in ps:
            res += 1
    else:
        res = 0
        for p in ps:
            if p > n / 2:
                break
            if n - p in ps:
                res += 1
    print(res)

### FIXED CODE ###

def make_tbl(n):
    tbl = [False, True, False, False, False, True] * (n // 6 + 1)
    for i in range(1, 4):
        tbl[i] = not tbl[i]
    p, stp, sqrt = 5, 2, n ** 0.5
    while p < sqrt:
        for i in range(p ** 2, n, 2 * p):
            tbl[i] = False
        while True:
            p += stp
            stp = 6 - stp
            if tbl[p]:
                break
    return tbl
tbl = make_tbl(50000)
ps = [i for i in range(50000) if tbl[i]]
while True:
    n = int(input())
    if not n:
        break
    res = 0
    if n % 2:
        if tbl[n - 2]:
            res += 1
    else:
        res = 0
        for p in ps:
            if 2 * p > n:
                break
            if tbl[n - p]:
                res += 1
    print(res)
import math
from functools import reduce

def gcd(*numbers):
  return reduce(math.gcd, numbers)

K = input('')
la = lb = lc = list(range(1, K+1))
sum = 0

for a in range (len(la)):
  for b in range(len(lb)):
    for c in range(len(lc)):
      sum += gcd(la[a],lb[b],lc[c])

print(sum)


### FIXED CODE ###

from math import gcd

K = int(input())
#K = 200
sum = 0

for a in range (1, K+1):
  for b in range(1, K+1):
    for c in range(1, K+1):
      sum += gcd(gcd(a, b), c)

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

a_sum = [0]
b_sum = [0]
for i in range(n):
    a_sum.append(a_sum[i] + a[i])
for i in range(m):
    b_sum.append(b_sum[j] + b[j])
    
ans, j = 0, m
for i in range(n + 1):
    if a[i] > k:
        break
    while b[i] > k - a[i]:
        j -= 1
    ans = max(ans, i + j)
print(ans)

### FIXED CODE ###

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

a_sum = [0]
b_sum = [0]
for i in range(n):
    a_sum.append(a_sum[i] + a[i])
for i in range(m):
    b_sum.append(b_sum[i] + b[i])
    
ans, j = 0, m
for i in range(n + 1):
    if a_sum[i] > k:
        break
    while b_sum[j] > k - a_sum[i]:
        j -= 1
    ans = max(ans, i + j)
print(ans)
import sys
import numpy as np
stdin = sys.stdin
from functools import lru_cache
 
ns = lambda: stdin.readline().rstrip()
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
s = lambda h: [list(map(int, stdin.readline().split())) for i in range(h)]

n, q = na()
a, b = [0]*n, [0]*n
G = [[] for i in range(n)]
for i in range(n-1):
        a, b = na()
        G[a-1].append(b-1)

seen = [0] * n

def dfs(v):
        seen[v] = True
        for next_v in G[v]:
                if seen[next_v]:
                        continue
                dfs(next_v)
ans = np.zeros(n)
for i in range(q):
        p, x = na()
        seen = np.zeros(n)
        dfs(p-1)
        seen[p-1] = True
        ans += x * seen
ans = ans.astype(np.int32)

print(*ans)

### FIXED CODE ###

import sys
stdin = sys.stdin
 
ns = lambda: stdin.readline().rstrip()
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
s = lambda h: [list(map(int, stdin.readline().split())) for i in range(h)]

n, q = na()
a, b = [0]*n, [0]*n
G = [[] for i in range(n)]
for i in range(n-1):
        a, b = na()
        G[a-1].append(b-1)
        G[b-1].append(a-1)

counter = [0] * n
for i in range(q):
        p, x = na()
        counter[p-1] += x

visit = [False] * n
visit[0] = True
stack = [0]

while stack:
        parent = stack.pop()
        for child in G[parent]:
                if visit[child]:
                        None
                else:
                        visit[child] = True
                        counter[child] += counter[parent]
                        stack.append(child)

print(*counter)
l = list(map(int, input().split(' ')))
d = {}  # key=match, val=num
d[2] = [1]
d[3] = [7]
d[4] = [4]
d[5] = [5, 3, 2]
d[6] = [9, 6]
d[7] = [8]
enable = [False] * 10
for a in l:
  enable[a] = True
memo = {}
# マッチをk(=2..7)本使う場合の一番大きい値を総当たり
def f(nokori, current):
  k = (nokori, current)
  if k in memo:
    return memo[k]
  if nokori <= 0:
    return current if nokori == 0 else -1
  temps = []
  for key, nums in list(d.items())[::-1]:
    for num in nums:
      if enable[num]:
        temps.append(f(nokori-key, current*10+num))
        break
  memo[k] = max(temps)
  return memo[k]
 
# 余裕があるうちは一番マッチの本数が少ないモノをヤケクソで詰めまくる
hoge = False
for key, nums in list(d.items()):
    for num in nums:
      if enable[num]:
        hoge = True
        break
    if hoge:
      break
cs = []
while n > 50:
  n -= key
  cs.append(str(num))

# ヤケクソで詰めたやつと総当たりで調べたマックスを並び替えて辞書順で大きくする
ans = str(f(n, 0))
print(''.join(sorted(list(ans) + cs)[::-1]))

### FIXED CODE ###

n, m = list(map(int, input().split(' ')))
l = list(map(int, input().split(' ')))
d = {}
# 1 = 2 = 0.5
d[2] = [1]
# 7 = 3 = 2.3 
d[3] = [7]
# 4 = 4 = 1
d[4] = [4]
# 5 = 5 = 1
# 3 = 5 = .6
# 2 = 5 = .4
d[5] = [5, 3, 2]
# 9 = 6 = 1.5
# 6 = 6 = 1
d[6] = [9, 6]
# 8 = 7 = 1.1...
d[7] = [8]
enable = [False] * 10
for a in l:
  enable[a] = True
memo = {}
def f(nokori, current):
#  print(nokori, current)
  k = (nokori, current)  # 順不同
  if k in memo:
    return memo[k]
  if nokori == 0:
    return current
  if nokori < 0:
    return -1
  temps = []
  for key, nums in list(d.items())[::-1]:
    # print(key, nums, type(nums))
    for num in nums:
      if enable[num]:
        if nokori-key != 0 and current % 10 != 0 and current % 10 < num:
          continue
        temps.append(f(nokori-key, current*10+num))
        break
  memo[k] = max(temps)
  return memo[k]

# pre
hoge = False
for key, nums in list(d.items()):
    # print(key, nums, type(nums))
    for num in nums:
      if enable[num]:
        hoge = True
        break
    if hoge:
      break
cs = []
while n > 50:  #
  n -= key
  cs.append(str(num))
num_ans = str(f(n, 0))
print(''.join(sorted(list(num_ans) + cs)[::-1]))
maxn = 2000 * 3 + 3
maxnh = maxn // 2

def check(s, t, d):
    for i in range(max(0, d), min(len(s), len(t) + d)):
        if s[i] != '?' and t[i] != '?' and s[i] != t[i - d]:
            return False
    return True

def ca(s, t):
    res = [True] * maxn
    for i in range(-len(t), len(s) + 1):
        res[i + maxnh] = check(s, t, i)
    return res

a, b, c = (input() for _ in range(3))
ans = sum(map(len, (a, b, c)))
ab, bc, ac = ca(a, b), ca(b, c), ca(a, c)
for i in range(maxn):
    if not ab[i]:
        continue
    for j in range(maxn):
        if not bc[j]:
            continue
        if not (0 <= i + j - maxnh < maxn) or not ac[i + j - maxnh]:
            continue
        ans = min(ans, max(len(a), len(b) + i - maxnh, len(c) + i + j - maxnh * 2) - min(0, i - maxnh, i + j - maxnh * 2))
print(ans)

### FIXED CODE ###

maxn = 2000 * 4 + 3
maxnh = maxn // 2
 
def check(s, t, d):
    for i in range(max(0, d), min(len(s), len(t) + d)):
        if s[i] != '?' and t[i - d] != '?' and s[i] != t[i - d]:
            return False
    return True
 
def ca(s, t):
    res = [True] * maxn
    for i in range(-len(t), len(s) + 1):
        res[i + maxnh] = check(s, t, i)
    return res
 
a, b, c = (input() for _ in range(3))
ans = sum(map(len, (a, b, c)))
ab, bc, ac = ca(a, b), ca(b, c), ca(a, c)
 
for i in range(maxn):
    if not ab[i]:
        continue
    for j in range(maxn):
        if not bc[j]:
            continue
        if (0 <= i + j - maxnh < maxn) and not ac[i + j - maxnh]:
            continue
        ans = min(ans, max(len(a), len(b) + i - maxnh, len(c) + i + j - maxnh * 2) - min(0, i - maxnh, i + j - maxnh * 2))
 
print(ans)
import math
a,b=input().split()
b=int(float(b)*100)
s=(int(a)*b)
print(srr(s[:-2]) if s>99 else 0)

### FIXED CODE ###

import math
a,b=input().split()
c=int(a)
d1=100*c*int(b[0])
d2=10*c*int(b[2])
d3=1*c*int(b[3])
ds=d1+d2+d3
if ds<100:
  print(0)
else:
  print(str(ds)[:-2])
N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))

W = [v-c for v, c in zip(V, C) if (v-c) > 0]
print(sum(W)

### FIXED CODE ###

N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))

W = [v-c for v, c in zip(V, C) if (v-c) > 0]
print(sum(W))
import itertools
import math
k=int(input())
s=0
for a,b,c in itertools.combinations_with_replacement(range(1,n+1), 3):
    g=math.gcd(math.gcd(a,b),c)
    s+=g
print(s)

### FIXED CODE ###

k=int(input())
s=0
import math
for a in range(1,k+1):
    for b in range(1,k+1):
        for c in range(1,k+1):
            s+=math.gcd(math.gcd(a,b),c)
print(s)
import math
from functools import reduce

N = int(input())
L = [ int(input()) for i in range(N)]

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

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

print(lcm_list(L))

### FIXED CODE ###

N = int(input())
L = [ int(input()) for i in range(N)]

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

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

x = L[0]
for i in range(len(L)-1):
    y = lcm(x, L[i+1])
    x = y
    
print(x)