Harryxun/stf_run huggingface dataset:
while True:
	player_nun = int(input())
	player_nun = 4
	if player_nun == 0:
		break
	
	#?????????????????????
	whole_data = []
	for i in range(0, player_nun):
		dat = input().split()
		p_data = []
		p_data.append(dat[0])
		for x in dat[1:]:
			p_data.append(int(x))
		whole_data.append(p_data)
	
	print(whole_data)
	#???????????????????????????????????????
	xel = {}
	for i in whole_data:
		for x in i[2:]:
			if x in xel:
				xel[x] += 1
			else:
				xel[x] = 1
	
	#??????????????????????????¢?????????
	score = {}
	for y in xel.keys():
		score[y] = 5 - xel[y]	
	#????????¢??¨????????????????????????????????????
	result = []
	for i in whole_data:
		player_score = []
		player_score.append(i[0])
		player_score.append(0)
		for x in i[2:]:
			player_score[1] += score[x]
		result.append(player_score)
	
	#?????????????????????????¬?????????????????±???????	
	min_score = min(x[1] for x in result)
	winners = []
	for x in result:
		if x[1] == min_score:
			winners.append(x[0])
	print(str(min_score) + " " + sorted(winners)[0])

### FIXED CODE ###

while True:
	player_nun = int(input())
	if player_nun == 0:
		break
	
	#?????????????????????
	whole_data = []
	for i in range(0, player_nun):
		dat = input().split()
		p_data = []
		p_data.append(dat[0])
		for x in dat[1:]:
			p_data.append(int(x))
		whole_data.append(p_data)
	
	#???????????????????????????????????????
	xel = {}
	for i in whole_data:
		for x in i[2:]:
			if x in xel:
				xel[x] += 1
			else:
				xel[x] = 1
	
	#??????????????????????????¢?????????
	score = {}
	for y in xel.keys():
		score[y] = player_nun + 1 - xel[y]	
	#????????¢??¨????????????????????????????????????
	result = []
	for i in whole_data:
		player_score = []
		player_score.append(i[0])
		player_score.append(0)
		for x in i[2:]:
			player_score[1] += score[x]
		result.append(player_score)
	
	#?????????????????????????¬?????????????????±???????	
	min_score = min(x[1] for x in result)
	winners = []
	for x in result:
		if x[1] == min_score:
			winners.append(x[0])
	print(str(min_score) + " " + sorted(winners)[0])
	
	#??£??????????????????????????????
m1, d1, m2, d2 = map(int, input().split())
if m1 == m2:
  print('0')
else:
  print('1')

### FIXED CODE ###

m1, d1 = map(int, input().split())
m2, d2 = map(int, input().split())
if m1 == m2:
    print('0')
else:
    print('1')
mod = 10**9 + 7


def solve(now, from_, K, ab):
    if from_ == -1:
        can_num = K - 1
    else:
        can_num = K - 2
    if K < len(ab[now]):
        return 0
    case_num = 1
    for i in ab[now]:
        if i != from_:
            case_num *= can_num
            can_num -= 1
            case_num %= mod
    for i in ab[now]:
        if i != from_:
            case_num *= solve(i, now, K, ab)
            case_num %= mod
    return case_num


def main():
    N, K = map(int, input().split())
    if N == 1:
        print(K)
        exit(0)
    ab = [[] for _ in range(N)]
    for _ in range(N - 1):
        a, b = map(int, input().split())
        ab[a - 1].append(b - 1)
        ab[b - 1].append(a - 1)
    ans = K * solve(0, -1, K, ab)
    print(ans % mod)


if __name__ == "__main__":
    main()

### FIXED CODE ###

import sys

sys.setrecursionlimit(10 ** 6)
mod = 10**9 + 7


def solve(now, from_, K, ab):
    if from_ == -1:
        can_num = K - 1
    else:
        can_num = K - 2
    if K < len(ab[now]):
        return 0
    case_num = 1
    for i in ab[now]:
        if i != from_:
            case_num *= can_num
            can_num -= 1
            case_num %= mod
    for i in ab[now]:
        if i != from_:
            case_num *= solve(i, now, K, ab)
            case_num %= mod
    return case_num


def main():
    N, K = map(int, input().split())
    if N == 1:
        print(K)
        exit(0)
    ab = [[] for _ in range(N)]
    for _ in range(N - 1):
        a, b = map(int, input().split())
        ab[a - 1].append(b - 1)
        ab[b - 1].append(a - 1)
    ans = K * solve(0, -1, K, ab)
    print(ans % mod)


if __name__ == "__main__":
    main()
def choose2(n):
    return n * (n - 1) // 2

a = int(input())
A = list(map(int, input().split()))  
d = {}
for k in A:
  if k in d:
    d[k] += 1
  else:
    d[k] = 1
 
res = 0
for k in d.values():
  res += choose2(k, 2)

for k in A:
  temp = res
  m = d[k]
  temp -= choose2(m, 2, mod)

  d[k] -= 1
  temp += choose2(d[k], 2, mod)
  print(temp)
  d[k] += 1


### FIXED CODE ###

from operator import mul
from functools import reduce

def ncr(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

a = int(input())
A = list(map(int, input().split()))  
d = {}
for k in A:
  if k in d:
    d[k] += 1
  else:
    d[k] = 1
 
res = 0
for k in d:
    if d[k] >= 2:
      res += ncr(d[k], 2)

for k in A:
  temp = res
  m = d[k]
  d[k] -= 1
  if m >= 2:
    temp -= ncr(m, 2)

  if d[k] >= 2:
    temp += ncr(d[k], 2)
  print(temp)
  d[k] += 1
import sys
input = sys.stdin.readline


alphabets = "abcdefghijklmnopqrstuvwxyz"

c = input()
i = alphabets.index(c)

answer = alphabets[i + 1]
print(answer)


### FIXED CODE ###

import sys
input = sys.stdin.readline


alphabets = "abcdefghijklmnopqrstuvwxyz"

c = input().strip()
i = alphabets.index(c)

answer = alphabets[i + 1]
print(answer)
main():
    S = input()
    K = int(input())
    output = solve(S, K)
    return output

def solve(S, K):
    for s in S:
        if s != "1":
            return s
    return "1"

if __name__ == "__main__":
    main()

### FIXED CODE ###

def main():
    S = input()
    K = int(input())
    output = solve(S, K)
    print(output)
    return

def solve(S, K):
    if K <= len(S) and S[:K] == "1"*K:
        # 文字列の1番目からK番目までがすべて1だった場合、
        # それ以降の文字列に1以外の数字があっても1が答え
        return "1"
    for s in S:
        if not s == "1":
            return s  # Sの"1"ではない、最初の数字が答え
if __name__ == "__main__":
    main()
a = []
while(1):
    n = input()
    if (n == 0):
        break
    a.append(n)

### FIXED CODE ###

i=1
while(1):
    n=input()
    if(int(n)==0):
        break
    else:
        print('Case '+str(i)+': '+n)
        i+=1
import numpy as np
N = int(input())
h = list(map(int, input().split()))
dp = [0] * N

def rec(i):
  global dp
  if i == 0:
    return 0
  if dp[i] != default:
    return dp[i]
  res = 99999
  res = min(res, rec(i-1) + np.abs(h[i] - h[i-1]))
  if i > 1:
    res = min(res, rec(i-2) + np.abs(h[i] - h[i-2]))
  dp[i] = res
  return dp[i]
print(rec(N-1))

### FIXED CODE ###

import numpy as np
N = int(input())
h = list(map(int, input().split()))
dp = [9999] * N
dp[0] = 0
for i in range(1,N):
  if i<2:
    dp[i] = dp[i-1] + np.abs(h[i] - h[i-1])
  else:
    min1 = dp[i-2] + np.abs(h[i] - h[i-2])
    min2 = dp[i-1] + np.abs(h[i] - h[i-1])
    dp[i] = min(min1, min2)
print(dp[N-1])
x = int(input())

b = -1
while True:
    b+=1
    amin = round((x + b**5)**0.2, 10)
    apls = round((x - b**5)**0.2,10)

    if isinstance(amin, float) and amin.is_integer():
        print(int(amin),b)
        break
    elif isinstance(apls,float) and apls.is_integer():
        print(int(apls),-1*b)
        break

### FIXED CODE ###

x = int(input())

b = -1
while True:
    b+=1
    amin = (x + b**5)**0.2
    apls = (x - b**5)**0.2

    if isinstance(amin, float):
        amin = round(amin,10)
        if amin.is_integer():
            print(int(amin),b)
            break
    
    if isinstance(apls,float):
        apls = round(apls,10)
        if apls.is_integer():
            print(int(apls),-1*b)
            break
n, m = map(int, input().split())
l = []
l = [0] * n
for _ in range(m):
    a, b = map(int, input().split())  # 1-index
    l[a] += 1
    l[a] -= 1
    l[a-1] += 1
    l[b-1] += 1

for _ in range(n):
    pass

for i in l:
    print(i)
    

### FIXED CODE ###

#!/usr/bin/env python

n, m = map(int, input().split())
l = []
l = [0] * n
for _ in range(m):
    a, b = map(int, input().split())  # 1-index
    l[a-1] += 1
    l[b-1] += 1

for i in l:
    print(i)
s=input()
u = set()
for let in s:
  u.add(let)
count=0
for let in s:
  if s[0] == let:
    count += 1
if count ==2 and u.size()==2:
  print("Yes")
else:
  print("No")


### FIXED CODE ###

s=input()
u = set()
for let in s:
  u.add(let)
count=0
for let in s:
  if s[0] == let:
    count += 1
if count ==2 and len(u)==2:
  print("Yes")
else:
  print("No")
values = [a*c, a*d, b*c, b*d]
print(max(values))

### FIXED CODE ###

inputs = input().split(" ")
a = int(inputs[0])
b = int(inputs[1])
c = int(inputs[2])
d = int(inputs[3])

values = [a*c, a*d, b*c, b*d]
print(max(values))
n = int(input())

for i in range(n+1):
    if i * 1.08 == n:
        print("Yes")
        exit()
pritn(":(")

### FIXED CODE ###

n = int(input())

for i in range(n+1):
    if int(i * 1.08) == n:
        print(i)
        exit()
print(":(")
n,m = map(int, input().split()) 

i = 1
ans = 0
while i * i <= m:
  if m % i == 0:
    if i >= n:
      if i >= n:
        ans = max(ans, m // i)
      else m // i >= n:
        ans = max(ans(ans, i))
  
  
print(ans)

### FIXED CODE ###

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

ans = 1

for i in range(1, int(m ** 0.5)+1):
  if m % i == 0:
    if i >= n:
      ans = max(ans, m // i)
    elif m // i >= n:
      ans = max(ans, i)
      
      
print(ans)
suuretu = [int(x) for x in input().split()]
n = len(suuretu)
answer = 0

for i in suuretu:
    calculate(i)

def calculate(int):
    while int%2 == 0:
        int = int / 2
        answer += 1

print (answer)

### FIXED CODE ###

import math
n = int(input())
a = list(map(int,input().split()))
maxlog = int(math.log2(max(a)))
answer = 0
for _ in range(maxlog):
  a = [aa/2 for aa in a if aa%2==0]
  answer+= len(a)
  if not a:
    break
print(answer)
import math

PI = math.pi

r = input()

area = float(2 * PI + r)
circumference = float(PI * r * r)
print("{} {}".format(area, circumference))

### FIXED CODE ###

import math

PI = math.pi

r = float(input())

area = float(PI * r * r)
circumference = float(2 * PI * r)
print("{} {}".format(area, circumference))
s=input()
n=len(input())
list=[]
for i in range(n-2):
  list.append(int(list[i:i+3]))
ans=[]
for l in list:
  ans.append(abs(l-753))
print(min(ans))

### FIXED CODE ###

s=input()
n=len(s)
list=[]
for i in range(n-2):
  list.append(''.join(s[i:i+3]))
ans=[]
for l in list:
  ans.append(abs(int(l)-753))
print(min(ans))
n = int(input())
s = list(input())
r = s.count("R")
if s-r < r:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

n = int(input())
s = list(input())
r = s.count("R")
if n-r < r:
  print("Yes")
else:
  print("No")
N=int(input())
S=N//15
R=S-1
A=60+15*8*R
T=(60+A)*S//2
M=N-15*S
P=[1,2,4,7,8,11,13,14]
P1=[]
for u in P:
    P1.append(u+15*R)

B=0
for i in range(M):
    B=B+P1[i]

print(B+T)

### FIXED CODE ###

N=int(input())
S=N//15
P=[1,2,4,7,8,11,13,14]
P2=[3,5,6,9,10,12]
Q=0
D=0
if S==0:
    for i in range(1,N+1):
        if i in P2:
            continue
        else:
            D=D+i
else:
    T=S-1
    D=(60+60+15*T*8)*S//2
    N1=N-15*S
    for i in range(1,N1+1):
        if i in P2:
            continue
        else:
            D=D+i+15*S

print(D)
x, y = map(int, input().split())
a = x*y/2
if (x%2 != 0) and (y%2 != 0):
    a += 1
print(int(a))

### FIXED CODE ###

k = int(input())
s =  "1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1,  51"
l = s.split(",")
print(int(l[k-1]))
, R = map(int, input().split())

if N > 10:
    print(R)
else:
    print(R+100*(10-N))

### FIXED CODE ###

N, R = map(int, input().split())

if N >= 10:
    print(R)
else:
    print(R+100*(10-N))
import sys
a=sys.stdin.readline()
res = [int(i) for i in a.split() if i.isdigit()] 
N,K = [res[i] for i in (0,1)]
S=sys.stdin.readline(3)
K-=1
if N<0 or N>50:
  print("Error")
else:
  x=S[:K]
  y=S[K].lower()
  z=S[K+1:]
  print(x+y+z)

### FIXED CODE ###

import sys
a=sys.stdin.readline()
res = [int(i) for i in a.split() if i.isdigit()] 
N,K = [res[i] for i in (0,1)]
S=sys.stdin.readline(N)
K-=1
if N<0 or N>50:
  print("Error")
else:
  x=S[:K]
  y=S[K].lower()
  z=S[K+1:]
  print(x+y+z)
x, y = list(map(int, input().split()))
arr = list(map(int, input().split()))


def quick_sort(arr):
    left = []
    right = []
    if len(arr) <= 1:
        return arr
    if(1 <= x, y <= 1000 and 1 <= max(arr) <= 1000 and 1 <= min(arr) <= 1000):
        # データの状態に左右されないためにrandom.choice()を用いることもある。
        # ref = random.choice(arr)
        ref = arr[0]
        ref_count = 0

        for ele in arr:
            if ele < ref:
                left.append(ele)
            elif ele > ref:
                right.append(ele)
            else:
                ref_count += 1
        left = quick_sort(left)
        right = quick_sort(right)
        return left + [ref] * ref_count + right


sorted_list = quick_sort(arr)

result = sorted_list[0] + sorted_list[1] + sorted_list[2]

print(result)

### FIXED CODE ###

x, y = list(map(int, input().split()))
arr = list(map(int, input().split()))


def quick_sort(arr):
    left = []
    right = []
    if len(arr) <= 1:
        return arr
    if(1 <= x, y <= 1000 and 1 <= max(arr) <= 1000 and 1 <= min(arr) <= 1000):
        ref = arr[0]
        ref_count = 0

        for ele in arr:
            if ele < ref:
                left.append(ele)
            elif ele > ref:
                right.append(ele)
            else:
                ref_count += 1
        left = quick_sort(left)
        right = quick_sort(right)
        return left + [ref] * ref_count + right


sorted_list = quick_sort(arr)

result = 0

for i in range(0, y):
    result += sorted_list[i]


print(result)
n = int(input())
x = input().split(' ')
l = [int(i) for i in x]

c = 0
i = 0
def s():
    while i+2 < len(l):
        if l[i] == l[i+1]:
            if l[i+1] == l[i+2]:
                c += 1
                i += 2
            else:
                c += 1
                i += 2
        else:
            i += 1
    
    print(c)
    return 0

s()

### FIXED CODE ###

n = int(input())
x = input().split(' ')
l = [int(i) for i in x]

c = 0

i = 0
while i+1 < n:
    if l[i] == l[i+1]:
        c += 1
        i += 2
    else:
        i += 1
print(c)
import bisect

N = int(input())

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

A.sort()

ans = 0
for a in range(N-2):
    for b in range(a+1, N-1):
        ans += bisect.bisect_left(A, A[a]+A[b])-j-1

print(ans)

### FIXED CODE ###

import bisect

N = int(input())

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

A.sort()

ans = 0
for a in range(N-2):
    for b in range(a+1, N-1):
        ans += bisect.bisect_left(A, A[a]+A[b])-b-1

print(ans)
a = int(input())
b = int(input())

ans = [1, 2, 3]
ans.remove(a)
ans.remove(b)

print(ans[0])

### FIXED CODE ###

n = int(input())
S, T = [str(a) for a in input().split()]

ans = ''
for s, t in zip(S, T):
    ans += s
    ans += t

print(ans)
N, W = map(int, input().split())

dp = [0] + [-1] * W
for i in range(1, N + 1):
    w, v = map(int, input().split())
    for sum_w in range(W - w, -1, -1):
        if dp[sum_w] >= 0:
            dp[sum_w + w] = max(dp[sum_w + w], dp[sum_w] + v)
    # print(dp)
print(max(dp))


### FIXED CODE ###

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

# dp[i] := 足場iに来るのにかかる最小のコスト
dp = [0 for _ in range(N)]
dp[0] = 0
dp[1] = abs(H[1] - H[0])
for i in range(2, N):
    c1 = dp[i - 2] + abs(H[i] - H[i - 2])
    c2 = dp[i - 1] + abs(H[i] - H[i - 1])
    dp[i] = min(c1, c2)
ans = dp[-1]
print(ans)
n = int(input()
if n%2 == 0 :
    print(n)
else :
    print(2*n)

### FIXED CODE ###

n = int(input())
if n%2 == 0 :
    print(n)
else :
    print(2*n)
n = int(input())
a = sorted([int(i) for i in input().split()])
cnt_d = [0] * (max(a) + 1)
cnt_nd = 0
for ai in a:
    if cnt_d[ai] >= 1:
        continue
    else:
        cnt_d[ai] += 1
        cnt_nd += 1
    multi = 2
    while ai*multi <= max_a:
        cnt_d[ai*multi] += 1
        multi += 1
print(cnt_nd)

### FIXED CODE ###

n = int(input())
a = sorted([int(i) for i in input().split()])
max_a = max(a)
cnt_d = [0] * (max_a + 1)

for ai in a:
    for multi in range(ai, max_a + 1, ai):
        cnt_d[multi] += 1

cnt_nd = 0
for ai in a:
    if cnt_d[ai] == 1:
        cnt_nd += 1
print(cnt_nd)
fS = input()
n = len(S)

def dfs(i, f):
  if i == n - 1:
    return sum(list(map(int, f.split('+'))))
  
  return dfs(i+1, f+S[i+1]) + dfs(i+1, f+'+'+S[i+1]) 

print(dfs(0, S[0]))

### FIXED CODE ###

S = input()
n = len(S)

def dfs(i, f):
  if i == n - 1:
    return sum(list(map(int, f.split('+'))))

  return dfs(i+1, f+S[i+1]) + dfs(i+1, f+'+'+S[i+1])

print(dfs(0, S[0]))
s=str(input())
atoz=[]
for i in range(len(s)):
	if(s[i]=="A"):
		a=i
		break
#print(a)


for i in range(a,len(s)):
	atoz.append(s[i])

s_l=list(atoz)
#print(s_l)

r_s=[]
s_l_kep=s_l
for i in (reversed(s_l)):
	#print(i)
	if(i!="Z"):
		s_l.pop()
#		print(s_l)
	else:
		break
#	r_s.append(i)
#print(s_l)
str_s_l=''.join(s_l)
#print(str_s_l)
print(len(str_s_l))

### FIXED CODE ###

x = int(input())
if x < 1200:
    print("ABC")
else:
    print("ARC")
X = int(input())

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

flag = False
for x in range(A, B+1):
  if x % K == 0:
    flag = True


if flag:
  print("OK")
else: 
  print("NG")

### FIXED CODE ###

K = int(input())

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

flag = False
for x in range(A, B+1):
  if x % K == 0:
    flag = True


if flag:
  print("OK")
else: 
  print("NG")
a,b = map(int,input().split())

average = (a+b)/2

print(math.ceil(average)

### FIXED CODE ###

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

print((a+b+1)//2)
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    a,b=map(int, input().split())
    l=list(range(a,b+1))
    seki=1
    for i in l:
        seki=seki*i
    if seki>0:
        print('Positive')
    elif seki==0:
        print('Zero')
    else:
        print('Negative')
resolve()

### FIXED CODE ###

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

def resolve():
    a,b=map(int, input().split())
    if a>0:
        print('Positive')
    elif a==0 or b==0:
        print('Zero')
    elif a<0 and b>0:
        print('Zero')
    elif b<0 and (b-a)%2==0:
        print('Negative')
    else:
        print('Positive')
resolve()
N = int(input())
T, A = list(map(int, input().split()))
H = np.array(list(map(int, input().split())))

num = np.abs(A - (T - H * 0.006))
print(np.argmin(num) + 1)


### FIXED CODE ###

import numpy as np

N = int(input())
T, A = list(map(int, input().split()))
H = np.array(list(map(int, input().split())))

num = np.abs(A - (T - H * 0.006))
print(np.argmin(num) + 1)
import math
from functools import reduce

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

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

P = 10**9 + 7
N = 10000
inv_t = [0]+[1]
for i in range(2,N):
    inv_t += [inv_t[P % i] * (P - int(P / i)) % P]

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

kyodai=lcm_list(A)
ans=0

for i in range(n):
    ans+=kyodai*inv_t[A[i]]
    ans=ans%P

print(ans)

### FIXED CODE ###

def gcd(a,b):
    for xx in range(1000001):
        a,b=b,a%b
        if b==0:
            break
    return a

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

P = 10**9 + 7
N = 1000001
inv_t = [0]+[1]
for i in range(2,N):
    inv_t += [inv_t[P % i] * (P - int(P / i)) % P]

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

#kyodai=lcm_list(A)
kyodai=A[0]
for i in range(1,n):
    kyodai=lcm_base(kyodai,A[i])

ans=0

for i in range(n):
    ans+=inv_t[A[i]]
    ans=ans%P
ans=ans*kyodai
ans=ans%P

print(ans)
n = int(input())
a = []
for i in range(n):
  a.append(int(input()))
nowmin = a[0] + 1
nowmax = max(a[1:])
ans = a[1]-a[0]
for i in range(n-1):
  if a[i] < nowmin:
    k = nowmax - a[i]
    if k > ans:
      ans =  k
      nowmin = a[i]
  elif a[i] == nowmax]
    nowmax = max(a[i+1])
    
print(ans)



### FIXED CODE ###

n = int(input())
a = []
for i in range(n):
  a.append(int(input()))
nowmin = a[0]
nowmax = max(a[1:])
ans = nowmax - nowmin
for i in range(n-1):
  if a[i] == nowmax:
    nowmax = max(a[i+1:])
  if a[i] < nowmin:
    k = nowmax - a[i]
    if k > ans:
      ans =  k
      nowmin = a[i]


print(ans)
n, x = map(int, input().split())
m = [int(input()) for _ in range(n)]

for i in n:
  x -= i * m[i]

print(x % min(m))

### FIXED CODE ###

n, x = map(int, input().split())
m = [int(input()) for _ in range(n)]

x -= sum(m)

print(n + x // min(m))
n,z,w=map(int,input().split())
card=list(map(int,input.split()))

if n==1:
  print(abs(card[0]-w))
else:
  print(max(abs(n[-2]-n[-1]),abs(n[-1]-w)))

### FIXED CODE ###

n,z,w=map(int,input().split())
card=list(map(int,input().split()))

if n==1:
  print(abs(card[0]-w))
else:
  print(max(abs(card[-2]-card[-1]),abs(card[-1]-w)))
#!/usr/bin/python3
# -*- coding: utf-8 -*-
def euclid(a, b):
    if b == 0:
        return a
    else:
        return euclid(b, a%b)
def list_euclid(int_list):
    ans = int_list[0]
    for i in range(1,len(int_list)):
        ans = euclid(ans, int_list[i])
        if ans == 1:
            return ans
    return ans
n = int(input())
a = list(map(int, input().split()))
a.sort()
max = 0
b_int = 0
if n < 5:
  for i in range(0,n):
    if b_int == a[0]:
      p = a.pop(0)
      a.append(p)
    else:
      p = a.pop(0)
      b_int = p
      x = list_euclid(a)
      if max < x:
        max = x
      a.append(p)
else:
  for i in range(0,n):
    if b_int == a[0]:
      p = a.pop(0)
      # a.append(p)
    else:
      p = a.pop(0)
      b_int = p
      k = len(a) // 2
      x = 0
      y = list_euclid(a[0:k])
      if y == 1:
        x = 1
      else:
        z = list_euclid(a[k:n-1])
        x = euclid(y, z)
      if max < x:
        max = x
      a.append(p)
print(max)

### FIXED CODE ###

#!/usr/bin/python3
# -*- coding: utf-8 -*-
import sys
def gcd(a, b): #最大公約数
  while b:
    a, b = b, a % b
  return int(a)
    
n = int(input())
a = list(map(int, input().split()))
if n==2:
  print(max(a))
  sys.exit(0)
elif n==3:
  lis = [gcd(a[0], a[1]), gcd(a[1], a[2]), gcd(a[2], a[0])]
  print(max(lis))
  sys.exit(0)
tmp_unused = gcd(a[0], a[1])
tmp_used = max(a[0], a[1])
#print("used=", tmp_used, "unused=", tmp_unused)
for i in range(2,n):
  #print(a[i])
  tmp_used = max(tmp_unused, gcd(tmp_used, a[i]))
  tmp_unused = gcd(tmp_unused, a[i])
  
  #print("used=", tmp_used, "unused=", tmp_unused)
print(tmp_used)
if N <= 10**3:
    for i in range(1, N+1):
        ans = 0
        for x in range(1, 13):
            for y in range(1, 13):
                for z in range(1, 13):
                    if (x+y+z)**2-x*y-y*z-z*x == i:
                        ans += 1
        print(ans)
    exit()
else:
    table = [0] * N
    for i in range(1, 10**3):
        ans = 0
        for x in range(1, 14):
            for y in range(1, 14):
                for z in range(1, 14):
                    if (x+y+z)**2-x*y-y*z-z*x == i:
                        ans += 1
        table[i-1] += ans
    print(*table, sep="\n")
    for j in range(10**3, N+1):
        print(0)

### FIXED CODE ###

N = int(input())

def count(a, b, c):
    return (a+b+c)**2-a*b-b*c-c*a

table = [0] * (N+1)
for x in range(1, 101):
    for y in range(1, 101):
        for z in range(1, 101):
            tmp = count(x, y, z)
            if tmp <= N:
                table[tmp] += 1
print(*table[1:], sep="\n")
N, K = map(int, input().split())
S = input()

ans = N - 1
initial = 0
for i in range(N-1):
    if S[i] == S[i+1]: initial += 1
ans = min(ans, initial + 2 * K)
print(ans)v

### FIXED CODE ###

N, K = map(int, input().split())
S = input()

ans = N - 1
initial = 0
for i in range(N-1):
    if S[i] == S[i+1]: initial += 1
ans = min(ans, initial + 2 * K)
print(ans)
n,w = map(long, input().split())
ans = (n * w) // 2 + 1
 
if n % 2 == 0 or w % 2 == 0:
    ans = (n * w) // 2
print(ans)

### FIXED CODE ###

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


if n == 1 or w == 1: 
    ans = 1
elif n % 2 == 0 or w % 2 == 0:
    ans = int((n * w) / 2.)

else:
    ans = int((n * w) / 2.) + 1

print(ans)
# -*- coding: utf-8 -*-
import math

if __name__ == '__main__':
    N = int(input())
    T = []
    for i in range(N):
        T.append(int(input()))

    a = T[0]
    for i in range(1,len(T)-1):
        A = math.gcd(int(a), int(T[i]))
        a = a * T[i] / A

    print(int(a))


### FIXED CODE ###

import fractions
N = int(input())
T = list(int(input()) for _ in range(N))
ans = T[0]
for i in range(1, N):
    ans = ans * T[i] // fractions.gcd(ans, T[i])
print(ans)