Harryxun/stf_run huggingface dataset:
s=sorted(list(input()))
if s[0]==s[-1]:
  print(0)
else:
  a=s.index('1')
  print(2*min(a,len(s)-a)

### FIXED CODE ###

s=sorted(list(input()))
if s[0]==s[-1]:
  print(0)
else:
  a=s.index('1')
  print(2*min(a,len(s)-a))
line = input().split

X = line[0]
Y = line[1]
Z = line[2]

print( Z + " " + X + " " + Y )


### FIXED CODE ###

X,Y,Z = map(int,input().split())

print(str(Z) + " " + str(X) + " " + str(Y))
turn = int(input())

lista = []
while True:
    inpy = tuple(map(int, input().split()))
    if inpy:
        lista.append(inpy)
    else:
        break

counter = 0
for challenge in range(len(lista)):
    inp = lista[challenge]
   
    if sum(inp[1:]) <= inp[0] and sum(inp[1:]) >= -inp[0]:
        if inp[0] % 2 == 0 and sum(inp[1:]) % 2 ==0:
            counter += 1
            # print('Yes')
        elif inp[0] % 2 != 0 and sum(inp[1:]) % 2 != 0:
            counter += 1
            # print('Yes')
        else:
            pass
            # print('No')
    else:
        pass
        # print('No')

if counter == len(lista):
    print('Yes')
else:
    print('No')

### FIXED CODE ###

n = int(input())
t_ = 0
xy_ = [0,0]
for _ in range(n):
    t, *xy = map(int, input().split())
    ta = t - t_
    xya = [abs(xy[0]-xy_[0]), abs(xy[1]-xy_[1])]
    if sum(xya) > ta or (ta - sum(xya))%2 != 0:
        print("No")
        break
    t_ = t
    xy_ = xy
else:
    print("Yes")
a,b=map(input().split())
if(a =='H' and b=='H') or (a =='D' and b=='D'):
    print('H')
else:
    print('D')

### FIXED CODE ###

a,b=input().split()
print("H"if(a==b) else"D")
a = int(input())
x = list(map(int, input().split()))
x.sort()
t =[2]
x = x[::-1]
if a == 1:
  if x[0] == 0:print(1)
  else:print(0)
else:
  if a %2 == 0:
    print(t[3])
    for i in range(1,a,2):
      if not i == x[-1] and i ==x[-2]:
        x.pop()
        x.pop()
        print(0)
        break
    else:print(2**(a//2))
  else:
    if x.pop() != 0:
      print(0)
      exit()
    for i in range(0,a,2):
      if not i == x[-1] and i ==x[-2]:
        x.pop()
        x.pop()
        print(0)
        break
    else:print(2**(a//2))

### FIXED CODE ###

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

A.sort()
B = [abs(a-b) for a,b in zip(range(N-1,-1,-1),range(N))]
B.sort()

if A==B:
    print(pow(2,N//2,10**9+7))
else:
    print(0)
def dfs(u):
    global dfs_color, d, f, t
    color[u] = GRAY
    d[u] += t
    t += 1
    for v in range(n):
        if (M[u][v] == 0):
            continue
        else:
            if (color[v] == WHITE):
               dfs(v)
    color[u] = BLACK
    f[u] = t
    t += 1

n = int(input())
M = [[ for i in range(n)] for j in range(n)]
for i in range(n):
    tmp = list(map(int, input().split()))
    for j in range(tmp[1]):
        M[tmp[0]-1][tmp[j+2]-1] = 1

WHITE = 0
GRAY = 1
BLACK = 2
color = [WHITE for i in range(n)]
d, f = [0 for i in range(n)]
t = 1

for u in range(n):
    if (color[u] == WHITE):
        dfs(u)
for u in range(n):
    print(str(u+1), str(d[u]), str(f[u]), sep = " ")

### FIXED CODE ###

def dfs(u):
    global dfs_color, d, f, t
    color[u] = GRAY
    d[u] += t
    t += 1
    for v in range(n):
        if (M[u][v] == 0):
            continue
        else:
            if (color[v] == WHITE):
               dfs(v)
    color[u] = BLACK
    f[u] = t
    t += 1

n = int(input())
M = [[False for i in range(n)] for j in range(n)]
for i in range(n):
    tmp = list(map(int, input().split()))
    for j in range(tmp[1]):
        M[tmp[0]-1][tmp[j+2]-1] = True

WHITE = 0
GRAY = 1
BLACK = 2
color = [WHITE for i in range(n)]
d = [0 for i in range(n)]
f = [0 for i in range(n)]
t = 1

for u in range(n):
    if (color[u] == WHITE):
        dfs(u)
for u in range(n):
    print(str(u+1), str(d[u]), str(f[u]), sep = " ")
a = str(input())
b = str(input())
count = 0
for i in renge(3):
	if a[i] == b[i]:
    	count += 1
print(count)


### FIXED CODE ###

a = str(input())
b = str(input())
count = 0
for i in range(3):
	if a[i] == b[i]:
		count += 1
        
print(count)
from collections import Counter
S = input()
MOD = 10 ** 9 + 7
ans = 0
front = Counter({})
back = Counter(S)
pow3 = [1]
for i in range(back['?']):
  pow3.append(pow3[-1] * 3)

for i in range(len(S)):
  c = S[i]
  back[c] -= 1
  # Bの位置を固定
  if c == 'B' or c == '?':
    # ?を使わない
    ans += front['A'] * back['C'] * (pow3[front['?'] + back['?']])
    # Aだけ?をつかう
    ans += front['?'] * back['C'] * (pow3[front['?'] + back['?'] - 1])
    # Cだけ?をつかう
    ans += front['A'] * back['?'] * (pow3[front['?'] + back['?'] - 1])
    # 両方?をつかう
    ans += front['?'] * back['?'] * (pow3[front['?'] + back['?'] - 2])
    ans %= MOD
  front[c] += 1

print(int(ans))

### FIXED CODE ###

from collections import Counter
S = input()
MOD = 10 ** 9 + 7
ans = 0
front = [0, 0, 0, 0]
back = [0, 0, 0, 0]
m = { 'A': 0, 'B': 1, 'C': 2, '?': 3 }
for c in S:
  back[m[c]] += 1

pow3 = [1]
for i in range(max(3, back[3])):
  pow3.append((pow3[-1] * 3) % MOD)

for i in range(len(S)):
  c = S[i]
  back[m[c]] -= 1
  # Bの位置を固定
  if c == 'B' or c == '?':
    fbsum = front[3] + back[3]
    # ?を使わない
    ans += front[0] * back[2] * (pow3[fbsum])
    # Aだけ?をつかう
    ans += front[3] * back[2] * (pow3[fbsum - 1])
    # Cだけ?をつかう
    ans += front[0] * back[3] * (pow3[fbsum - 1])
    # 両方?をつかう
    ans += front[3] * back[3] * (pow3[fbsum - 2])
    ans %= MOD
  front[m[c]] += 1

print(int(ans))
from collections import Counter
n = int(input())
a_input = list(map(int,input().split()))

a_count = Counter(a_input)

score_dic={}
exclude_dic={}

for k,v in enumerate(a_count.items()):
    score_dic[k]=v*(v-1)//2
    exclude_dic[k]=(v-1)*(v-2)//2

score_sum = sum(score_dic.values())

for i in range(n):
    print(score_sum-score_dic[a_input[i]]+exclude_dic[a_input[i]])

### FIXED CODE ###

from collections import Counter
n = int(input())
a_input = list(map(int,input().split()))

a_count = Counter(a_input)

score_dic={}
exclude_dic={}

for k,v in a_count.items():
    score_dic[k]=v*(v-1)//2
    exclude_dic[k]=(v-1)*(v-2)//2

score_sum = sum(score_dic.values())

for i in range(n):
    print(score_sum-score_dic[a_input[i]]+exclude_dic[a_input[i]])
import sys

sys.setrecursionlimit(10 ** 7)

def debug(x, table):
    for name, val in table.items():
        if x is val:
            print('DEBUG:{} -> {}'.format(name, val), file=sys.stderr)
            return None

def paint_col(adj, cols, i, col):
    cols[i] = col

    for child in adj[i]:
        if cols[child] == 0:
            paint_col(adj, cols, child, col)

def solve():
    n, m = map(int, input().split())
    adj = [[] for i in range(n)]

    for i in range(m):
        s, t = map(int, sys.stdin.readline().split())
        adj[s].append(t)
        adj[t].append(s)

    cols = [0] * n
    col = 1

    for i in range(n):
        if cols[i] == 0:
            paint_col(adj, cols, i, col)
            col += 1

    # debug(cols, locals())

    q = int(input())

    for i in range(q):
        s, t = map(int, sys.stdin.readline().split())

        if cols[s] == cols[t]:
            print('yes')
        else:
            print('no')

    pass

if __name__ == '__main__':
    solve()

### FIXED CODE ###

import sys

def debug(x, table):
    for name, val in table.items():
        if x is val:
            print('DEBUG:{} -> {}'.format(name, val), file=sys.stderr)
            return None

def paint_col(adj, cols, i, col):
    nxt = [i]

    while nxt:
        u = nxt[-1]
        try:
            v = next(adj[u])
            if cols[v] == 0:
                cols[v] = col
                nxt.append(v)
        except StopIteration:
            nxt.pop()
            cols[u] = col

def solve():
    n, m = map(int, sys.stdin.readline().split())
    adj = [[] for i in range(n)]

    for i in range(m):
        s, t = map(int, sys.stdin.readline().split())
        adj[s].append(t)
        adj[t].append(s)

    cols = [0] * n
    col = 1
    adj = list(map(iter, adj))

    for i in range(n):
        if cols[i] == 0:
            paint_col(adj, cols, i, col)
            col += 1

    # debug(cols, locals())

    q = int(sys.stdin.readline())

    for i in range(q):
        s, t = map(int, sys.stdin.readline().split())

        if cols[s] == cols[t]:
            ans = 'yes'
        else:
            ans = 'no'

        print(ans)

if __name__ == '__main__':
    solve()
N = int(input())

s = []
t = []
for _ in range(N):
    s.append(input())

for _ in range(N):
    t.append(input())

sets = set(s)

ans = []
for word in sets:
    tmp = 0
    tmp += s.count(word)
    tmp -= t.count(word)
    ans.append(tmp)

print(max(ans))


### FIXED CODE ###

N = int(input())
s = []
for _ in range(N):
    s.append(input())

M = int(input())
t = []
for _ in range(M):
    t.append(input())

sets = set(s)

ans = [0]
for word in sets:
    tmp = 0
    tmp += s.count(word)
    tmp -= t.count(word)
    ans.append(tmp)

print(max(ans))
s = list(input())
t = list(input())

n_s = len(s)
n_t = len(t)
last_num = -1

base = [i for i,x in enumerate(s) if x == str(t[0]) or "?"]

if n_s >= n_t:
  for i in base:
    if n_s - i >= n_t:
      sign = 0
      for j in range(i,i+n_t):
        if not ((s[j] == t[j-i]) or (s[j] == "?")):
          sign = 1
        
      if sign == 0:
        last_num = i

  if last_num != -1:
    for i in range(last_num,last_num + n_t):
      if s[i] == "?":
        s[i] = t[i-last_num]
    
    if s[0] == "?":
      ans = "a"
      
    for j in range(1,n_s):
      if s[j] == "?":
        s[j] = "a"
      ans = ans + s[j]
    
  elif last_num == -1:
    ans = "UNRESTORABLE"

else:
  ans = "UNRESTORABLE"

print(ans)

### FIXED CODE ###

s = list(input())
t = list(input())

n_s = len(s)
n_t = len(t)
last_num = -1

base = [i for i,x in enumerate(s) if x == str(t[0]) or "?"]

if n_s >= n_t:
  for i in base:
    if n_s - i >= n_t:
      sign = 0
      for j in range(i,i+n_t):
        if not ((s[j] == t[j-i]) or (s[j] == "?")):
          sign = 1
        
      if sign == 0:
        last_num = i

  if last_num != -1:
    for i in range(last_num,last_num + n_t):
      if s[i] == "?":
        s[i] = t[i-last_num]
    
    if s[0] == "?":
      ans = "a"
    else:
      ans = str(s[0])
                  
    for j in range(1,n_s):
      if s[j] == "?":
        s[j] = "a"
      ans = ans + s[j]
    
  elif last_num == -1:
    ans = "UNRESTORABLE"

else:
  ans = "UNRESTORABLE"

print(ans)
def enum_prime(m):
    L = [True for _ in range(m + 1)]
    L[0] = L[1] = False

    for i in range(2, m + 1):
        if L[i]:
            for j in range(i + i, m + 1, i):
                L[j] = False
            if m < i * i:
                break
    return L

FLAGS = enum_prime(50000)
PRIMES = [i for i, isprime in enumerate(FLAGS) if isprime]

while True:
    n = int(input())
    n2 = n // 2
    cnt = 0
    if n % 2 == 0:
        for p in PRIMES:
            if p > n2:
                break
            if FLAGS[n - p]:
                cnt += 1
    elif FLAGS[n - 2]:
        cnt = 1
    print(cnt)

### FIXED CODE ###

import sys

N = 50000
t = [1]*(N)
p = [2]
d = {2:1}
for i in range(3, N, 2):
    if t[i]:
        p.append(i)
        d[i] = 1
        for j in range(3*i, N, 2*i): t[j] = 0

while True:
    n = int(sys.stdin.readline())
    if n == 0: break

    count = 0
    if n % 2:
        if n - 2 in p: count += 1
    else:
        for p1 in p:
            if 2*p1 > n: break
            if n - p1 in d:
                count += 1
    print(count)
N,K=map(int,input().split())

Sanuke=list(range(K))

def calc_double(n):
      return n -1

for i in range(N):
  di=int(input())
  A=list(map(int,input().split()))
  A=map(calc_double, A)
  for j in A:
    Sanuke[j]+=1

higaisha=0

for i in Sanuke:
  if i ==0:
    higaisha += 1

print(higaisha)

### FIXED CODE ###

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

ans=[0]*n

for i in range(k):
  d=int(input())
  a=[int(k) - 1 for k in input().split()]
  for j in a:
    ans[j]+=1

ansint=0


for i in range(n):
  if ans[i]==0:
    ansint+=1


print(ansint)
n = int(input())
a, b = map(int, input().split())
if n == 1:
    print('Hello World')
else:
    print(a + b)

### FIXED CODE ###

n = int(input())
if n == 1:
    print('Hello World')
else:
    a = int(input())
    b = int(input())
    print(a + b)
a = int(input())
s = int(input())

print(s if a >= 3200 else 'red' )

### FIXED CODE ###

a = int(input())
s = input()

print(s if a >= 3200 else 'red' )
x=input()
y=int(x)
print(x**3)


### FIXED CODE ###

x=input()
y=int(x)
print(y**3)
a=input()
if len(a)%2==0:
    if (len(a)==2)&(len(list(set(a)))==1):
        print("1 2")
    else:
        for i in range(len(a)-3):
            b=sorted([a[i],a[i+1],a[i+2],a[i+3]])
            c="".join(b)
            d=list(set(a[i:i+4]))
            if (len(d)==2)&(c!="{}".format(d[0]+d[0]+d[1]+d[1]))&(c!="{}".format(d[1]+d[1]+d[0]+d[0])):
                print("{}".format(i+1)+" "+"{}".format(i+4))
                break
        else:
            print("-1 -1")
else:
    for j in range(len(a)-2):
        e=list(set(a[i:i+3]))
        if (len(e)==2) or (len(e)==1):
            print("{}".format(i+1)+" "+"{}".format(i+3))
            break
    else:
        print("-1 -1")

### FIXED CODE ###

a=input()
if len(a)==1:
    print("-1 -1")
elif (len(a)==2)&(len(list(set(a)))==1):
    print("1 2")
else:
    for i in range(len(a)-2):
        e=list(set(a[i:i+3]))
        if (len(e)==2) or (len(e)==1):
            print("{}".format(i+1)+" "+"{}".format(i+3))
            break
    else:
        print("-1 -1")
from heapq import heappush, heappop
X, Y, Z, K, *L = map(int, open(0).read().split())
A = L[:X]
B = L[X:X+Y]
C = L[X+Y:]
ab = []
for i in range(X):
  for j in range(Y):
    ab += [A[i]+B[j]]
ab.sort(reverse=True)
ls = []
for i in range(Z):
  heappush(ls,(-ab[0]-C[i],j,0))
for i in range(K):
  m, j, cnt = heappop(ls)
  print(-m)
  if cnt<X*Y:
    heappush(ls,(-ab[cnt+1]-C[j],j,cnt+1))

### FIXED CODE ###

inf = input().split()
X = int(inf[0])
Y = int(inf[1])
Z = int(inf[2])
K = int(inf[3])

A = [int(i) for i in input().split()]
B = [int(i) for i in input().split()]
C = [int(i) for i in input().split()]
ab = []
for a in A:
  for b in B:
    ab +=[a+b]
ab.sort(reverse=True)
C.sort(reverse=True)
state = [[ab[0]+C[i],0,i] for i in range(len(C))]
count  = 0
while count<K:
  s = max(state)
  print(s[0])
  count +=1
  x = s[1]
  i = s[2]
  if x<X*Y-1:
    state[i][0] = C[i]+ab[x+1]
    state[i][1] = x+1
  else:
    state[i][0] = -1
N,M = list(map(int,input().split()))
ans = [0 for i in range(N)]

for i in range(M):
    L,R = list(map(int,input().split()))
    for j in range(L-1,R,1):
        ans[j]+=1

maxn = 0
for i in range(M):
    if ans[i] > maxn:
        maxn = ans[i]
        
print(maxn)

### FIXED CODE ###

N,M = list(map(int,input().split()))
L = 1
R = N+1
ans = N*2

for i in range(M):
    tL,tR = list(map(int,input().split()))
    if tR < L or R < tL:
        ans = 0
        break
    if tL > L:
        L = tL
    if tR < R:
        R = tR

print(min(ans,R-L+1))
n,s=map(int,input().split())
mod=998244353
A=list(map(int,input().split()))
dp=[[]*(s+1) for i in range(n+1)]
dp[0][0]=[1]
for i in range(n+1):
  dp[i][0]=[1]
for i in range(1,n+1):
  for j in range(1,s+1):
    dp[i][j].append(dp[i-1][j])
    if j+A[i]<=s:
      dp[i][j+A[i]].append(dp[i][j]+1)
ans=0
for i in range(len(dp[n][s])):
  ans=ans+dp[n][s][i]*pow(2,n-i,mod)
print(ans%mod)

### FIXED CODE ###

n,s=map(int,input().split())
A=list(map(int,input().split()))
mod=998244353
a=499122177
b=pow(2,n-1,mod)
dp=[[0]*(s+1) for i in range(n+1)]
for i in range(n+1):
  dp[0][0]=pow(2,n,mod)
for i in range(1,n+1):
  dp[i]=dp[i-1][0:s+1]
  for j in range(s+1):
    if j+A[i-1]>s:
      break
    dp[i][j+A[i-1]]=(dp[i-1][j+A[i-1]]+dp[i-1][j]*a)%mod
print(dp[-1][-1])
password = set(input().split())
if len(password) != 4:
  print("Bad")
  break
print("Good")


### FIXED CODE ###

password = list(input())
if password[0] == password[1] or password[1] == password[2] or password[2] == password[3]:
  print("Bad")
else:
  print("Good")
N = int(input())
UVW = [list(map(int, input().split())) for _ in range(N - 1)]

UVW.sort(key = lambda x: (x[0], x[1]))
color = [2 for _ in range(N)]
color[0] = 0

def coloring(l):
  for i in range(len(l)):
    uvw = UVW[i]
    if uvw[2] % 2 == 0:
      if color[uvw[0] - 1] != 2:
        color[uvw[1] - 1] = color[uvw[0] - 1]
      elif color[uvw[1] - 1] != 2:
        color[uvw[0] - 1] = color[uvw[1] - 1]
    else:
      if color[uvw[0] - 1] != 2:
        color[uvw[1] - 1] = color[uvw[0] - 1] ^ 1
      elif color[uvw[1] - 1] != 2:
        color[uvw[0] - 1] = color[uvw[1] - 1] ^ 1

coloring(UVW)
tmp = []
cnt = 0
for i in range(N):
  if color[i] == 2:
    cnt += 1
    for uvw in UVW:
      if uvw[0] == i + 1 or uvw[1] == i + 1:
        tmp.append(uvw)
if cnt > 0:
  color[tmp[0][0] - 1] = 0
  coloring(tmp)

for c in color:
  print(c)

### FIXED CODE ###

N = int(input())
to = [[] for _ in range(N)]
cost = [[] for _ in range(N)]

for _ in range(N - 1):
  a, b, w = map(int, input().split())
  a -= 1
  b -= 1
  to[a].append(b)
  to[b].append(a)
  cost[a].append(w)
  cost[b].append(w)

ans = [-1 for _ in range(N)]
queue = []
queue.append(0)
while len(queue) > 0:
  v = queue.pop(0)
  for i in range(len(to[v])):
    u = to[v][i]
    w = cost[v][i]
    if ans[u] != -1:
      continue
    ans[u] = (ans[v] + w) % 2
    queue.append(u)

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

N, A, B, C = MAP()

s = [input() for _ in range(N)]



### FIXED CODE ###

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

N = INT()

for i in range(1, 50001):
	if i*108//100 == N:
		print(i)
		break
else:
	print(":(")
import sys
S=input()
k=int(input())
ans=0
flag=0
if S[0]==S[-1]:
    now=S[0]
    left=1
    for i in range(len(S)-1):
        if S[i+1]==now:
            left+=1
        else:
            break
    if left==len(S):
        print(left*k//2)
        sys.exit()
    now=S[-1]
    right=1
    for i in range(len(S)-1):
        if S[-i-2]==now:
            right+=1
        else:
            break
    
now=""
for i in range(left,len(S)-right):
    if flag==1:
        flag=0
        continue
    if now==S[i]:
        ans+=1
        flag=1
    now=S[i]
ans*=k

if S[0]==S[-1]:
    ans+=(left+right)//2*(k-1)
    ans+=left//2+right//2
print(ans)

### FIXED CODE ###

import sys
S=input()
k=int(input())
ans=0
flag=0
left=0
right=0
if S[0]==S[-1]:
    left=1
    for i in range(len(S)-1):
        if S[i+1]==S[0]:
            left+=1
        else:
            break
    if left==len(S):
        print(left*k//2)
        sys.exit()
    right=1
    for i in range(len(S)-1):
        if S[-i-2]==S[0]:
            right+=1
        else:
            break
    
now=""
for i in range(left,len(S)-right):
    if flag==1:
        flag=0
        now=S[i]
        continue
    if now==S[i]:
        ans+=1
        flag=1
    now=S[i]
ans*=k

if S[0]==S[-1]:
    ans+=(left+right)//2*(k-1)
    ans+=left//2+right//2

print(ans)
def gcd(a,b):
    if b==0:
        return a
    else:
        return gcd(b,a%b)
        
def lcm(a,b):
    res = int(a/gcd(a,b)*b)
    return res
    

n = int(input())
t = []
for i in range(n):
    t.append(int(input()))

ans=1
for i in range(n):
    ans = lcm(ans,t[i])
    
print(ans)


### FIXED CODE ###

n = int(raw_input())

def gcd(a,b):
    if a > b:
        a,b = b,a
    # a <= b
    while a > 0:
        a,b = b%a, a
    return b

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

x = 1
for i in range(n):
    ti = int(raw_input())
    x = lcm(x, ti)

print x
def main():
    N, A = map(int, input().split())
    X = tuple(map(int, input().split()))

    x = [i - A for i in X]
    nx = max(x) * N
    dp = [[0] * (2 * nx + 1) for _ in [0] * (N + 1)]
    for i in range(N + 1):
        for j in range(2 * nx + 1):
            if not i:
                if j == nx:
                    dp[i][j] = 1
            elif j - x[i-1] < 0 or j - x[i-1] > 2 * nx:
                dp[i][j] = dp[i-1][j]
            elif 0 <= j - x[i-1] <= 2 * nx:
                dp[i][j] = dp[i-1][j] + dp[i-1][j - x[i-1]]
    print(dp[N][nx] - 1)

main()


### FIXED CODE ###

def main():
    N, A = map(int, input().split())
    X = tuple(map(int, input().split()))

    x = [i - A for i in X]
    nx = max(X) * N
    dp = [[0] * (2 * nx + 1) for _ in [0] * (N + 1)]
    for i in range(N + 1):
        for j in range(2 * nx + 1):
            if not i:
                if j == nx:
                    dp[i][j] = 1
            elif j - x[i-1] < 0 or j - x[i-1] > 2 * nx:
                dp[i][j] = dp[i-1][j]
            elif 0 <= j - x[i-1] <= 2 * nx:
                dp[i][j] = dp[i-1][j] + dp[i-1][j - x[i-1]]
    print(dp[N][nx] - 1)

main()
n, m = map(int, input().split())
A = sorted(list(map(int, input().split())))

bc = []
for i in range(2):
    b, c = map(int, input().split())
    bc.append([b,c])

from operator import itemgetter
bc.sort(key=itemgetter(1))
k = 0
c = bc[0][1]
b = bc[0][1]
bn = 0
while A[k] < c:
    A[k]=c
    k+=1
    if k >= len(A):
        break
    b-=1
    if b  == 0:
        bn += 1
        if bn > len(bc):
            break
        b = bc[bn]
print(sum(A))

### FIXED CODE ###

n, m = map(int, input().split())
A = sorted(list(map(int, input().split())))

bc = []
for i in range(m):
    b, c = map(int, input().split())
    bc.append([b,c])

from operator import itemgetter
bc.sort(key=itemgetter(1), reverse = True)
k = 0
c = bc[0][1]
b = bc[0][0]
bn = 0
while A[k] < c:
    A[k]=c
    k+=1
    if k == len(A):
        break
    b-=1
    if b  == 0:
        bn += 1
        if bn == len(bc):
            break
        b = bc[bn][0]
        c = bc[bn][1]
print(sum(A))
import bisect

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


a.sort()
b.sort()
c.sort()


bi = bisect.bisect_right

result = 0
for i in range(n):
    a_bi_in_b = bi(b, a[i])
    b_bi_in_c = bi(c, b[a_bi_in_b])
    result += (n - a_bi_in_b) * (n - b_bi_in_c)
        
        
print(result)

### FIXED CODE ###

import bisect

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


a.sort()
b.sort()
c.sort()


result = 0
for i in range(n):
    b_bisect_in_a = bisect.bisect_left(a, b[i])
    b_bisect_in_c = bisect.bisect_right(c, b[i])
    result += b_bisect_in_a * (n - b_bisect_in_c)
        
        
print(result)
import math

r = int(input())
x = math.pi

print(x*r**2 + " "+  2*x**r)


### FIXED CODE ###

import math
x = math.pi

r = float(input())
print("{} {}".format(x*r*r,2*x*r))