Harryxun/stf_run huggingface dataset:
M = 10**9+7
n = int(input())
s = input()
t = input()
ans = 3 if s[0] == t[0] else 6
for i in range(1, n):
  if s[i-1] == s[i]:
    continue
  if s[i-1] == t[i-1]:
    ans = ans * 2 % M
  else if s[i] != t[i]:
    ans = ans * 3 % M
print(ans)

### FIXED CODE ###

M = 10**9+7
n = int(input())
s = input()
t = input()
ans = 3 if s[0] == t[0] else 6
for i in range(1, n):
  if s[i-1] == s[i]:
    continue
  if s[i-1] == t[i-1]:
    ans = ans * 2 % M
  elif s[i] != t[i]:
    ans = ans * 3 % M
print(ans)
import numpy as np
N,M = map(int,input().split())
R = [[] for _ in range(N)]
ans = np.zeros(N,dtype=int)
ans[0] = 1
queue = [1]
for _ in range(M):
    i,j = map(int,input().split())
    R[i-1].append(j)
    R[j-1].append(i)
    
def bfs(que):
    if que==[]:
        return
    i = que[0]
    for j in R[i-1]:
        if ans[j-1]!=0:
            continue
        else:
            ans[j-1]=i
            que.append(j)
    que.pop(0)
    bfs(que)
    
bfs(queue)
if len(ans[ans==0])>0:
    print('No')
else:
    print('Yes')
    for i in range(1,N):
        print(ans[i])

### FIXED CODE ###

import numpy as np
import sys
sys.setrecursionlimit(10**7)
N,M = map(int,input().split())
R = [[] for _ in range(N)]
ans = np.zeros(N,dtype=int)
ans[0] = 1
queue = [1]
for _ in range(M):
    i,j = map(int,input().split())
    R[i-1].append(j)
    R[j-1].append(i)
    
def bfs(que):
    if que==[]:
        return
    i = que[0]
    for j in R[i-1]:
        if ans[j-1]==0:
            ans[j-1]=i
            que.append(j)
    que.pop(0)
    bfs(que)
    
bfs(queue)
print('Yes')
for i in range(1,N):
    print(ans[i])
N,L=map(int, input().split())
str_lists = []
for i in ange(N):
  str_lists.append(input())
print(''.join(sorted(str_lists)))

### FIXED CODE ###

N,L=map(int, input().split())
str_lists = []
for i in range(N):
  str_lists.append(input())

print(''.join(sorted(str_lists)))
print((H-h)*(W-w))

### FIXED CODE ###

H,W=input().split()
h,w=input().split()

x=int(H)-int(h)
y=int(W)-int(w)
print(x*y)
n = int(input())
xy = [list(map(int, input().split())) for _ in range(n)]

ans = 0
for i in range(n):
  for j in range(n):
    if i == j: continue
    ans += ((xy[i][0] - xy[j][0])**2 + (xy[i][1] - xy[j][1])**2)**0.5
    t += 1
print(ans/n)

### FIXED CODE ###

n = int(input())
x = [0]*n
y = [0]*n
for i in range(n):
  x1,y1 = map(int, input().split())
  x[i] = x1
  y[i] = y1

a = 0
b = 0
for i in range(n):
  t = list(range(n))
  t.remove(i)
  for j in t:
    a += ((x[i]-x[j])**2 + (y[i]-y[j])**2)**0.5
    b += 1
    
print(a*(n-1)/b)
N, K = map(int, input().split())
V = list(map(int, input().split()))

def calc(l, r, d):
    hold = []
    for i in range(l):
        hold.append(V[i])
    for i in range(N-1, N-1-r, -1):
        hold.append(V[i])
    hold.sort()
    return sum(hold[d:])

ret = 0
for l in range(K+1):
    for r in range(K+1-l):
        d = max(K - l - r, 0)
        ret = max(ret, calc(l, r, d))
print(ret)

### FIXED CODE ###

N, K = map(int, input().split())
V = list(map(int, input().split()))
U = V[::-1]
ret = 0

m = min(N, K)
for l in range(m+1):
    for r in range(m+1-l):
        hold = V[:l] + U[:r]
        hold.sort()
        for d in range(K+1-l-r):
            ret = max(ret, sum(hold[d:]))

print(ret)
t=list(input())

for i in range(1,4):
  s=t
  if s[0]==s[i]:
    z=s[0]
    s.pop(i)
    s.pop(0)
    if z=!s[0] and s[0]==s[1]:
      print("Yes")
      
print("No")
    

### FIXED CODE ###

s=list(input())

s.sort()
if s[0]==s[1] and s[2]==s[3] and s[1]!=s[2]:
  print("Yes")
else:
  print("No")
import math


def check(A, d, K):
    modcnt = [0] * d
    cnt = 0
    for a in A:
        modcnt[a % d] += 1
    mx = d-1
    for i in range(d):
        while modcnt[i] > 0:
            modcnt[i] -= 1
            cnt += i
            pls = i
            while pls > 0:
                while modcnt[mx] == 0 and mx > 1:
                    mx -= 1
                if mx + pls >= d:
                    modcnt[mx] -= 1
                    pls -= d - mx
                else:
                    modcnt[mx] -= 1
                    modcnt[mx+pls] += 1
                    mx = mx+pls
                    pls = 0
    return cnt <= K


def main():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))
    total = sum(A)
    divs = [1, total]
    rt = int(math.sqrt(total))
    for i in range(2, rt+1):
        if total % i == 0:
            divs.append(i)
            if i**2 != total:
                divs.append(total//i)
    ans = 0
    for d in divs:
        if check(A, d, K):
            ans = max(ans, d)
    print(ans)


if __name__ == "__main__":
    main()


### FIXED CODE ###

import math
from collections import deque


def check(A, d, K):
    diff = []
    for a in A:
        if a % d != 0:
            diff.append(a % d)
    totalinc = 0
    diff.sort()
    q = deque(diff)
    cnt = 0
    while len(q):
        x = q.popleft()
        cnt += x
        totalinc += x
        while len(q) and q[-1] + totalinc >= d:
            y = q.pop()
            totalinc -= d-y
    cnt += totalinc
    return cnt <= K


def main():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))
    total = sum(A)
    divs = [1, total]
    rt = int(math.sqrt(total))
    for i in range(2, rt+1):
        if total % i == 0:
            divs.append(i)
            if i**2 != total:
                divs.append(total//i)
    ans = 0
    for d in divs:
        if check(A, d, K):
            ans = max(ans, d)
    print(ans)


if __name__ == "__main__":
    main()
n = int(input())
t,a = map(int,input().split())
h = list(int(input()) for i in range(n))

mi = 1234567890
for i in range(n):
    ti = t - h[i] * 0.006
    if abs(mi - a) > abs(ti - a):
        mi = ti
        ans = i + 1
        
print(ans)

### FIXED CODE ###

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

minimum = 1234567890
for i in range(n):
    ti = t - h[i] * 0.006
    if abs(minimum - a) > abs(ti - a):
        minimum = ti
        ans = i + 1
        
print(ans)
#!/usr/bin/env python3

import math


P_NUM = 1000000007


def ncr(n, r):
    return math.factorial(n) // math.factorial(n-r) // math.factorial(r)


def solv(n, k):
    for i in range(1, k+1):
        blue_ptn = ncr(k-1, i-1)
        red_ptn = ncr(n-k+1, i)
        print(blue_ptn * red_ptn % P_NUM)


if __name__ == '__main__':

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

    solv(n, k)


### FIXED CODE ###

#!/usr/bin/env python3

import math


P_NUM = 1000000007


def ncr(n, r):
    return math.factorial(n) // math.factorial(n-r) // math.factorial(r)


def solv(n, k):
    blue = k
    red = n - k
    for i in range(1, k+1):
        # print('blue=', blue, ' i=', i)
        blue_ptn = ncr(blue-1, i-1)
        # print('blue_ptn=', blue_ptn)
        # print('red=', red, ' i=', i)
        if red+1 < i:
            red_ptn = 0
        else:
            red_ptn = ncr(red+1, i)
        # print('red_ptn=', red_ptn)
        print(blue_ptn * red_ptn % P_NUM)


if __name__ == '__main__':

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

    solv(n, k)
from functools import reduce

def gcd(a, b):

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

def gcd_list(numbers):
    return reduce(gcd, numbers)

N, X = map(int, input().split(" "))
Xi = [int(a) for a in input().split()]

def minusX(a):
    return abs(a-X)

Xi = map(minusX, Xi)

d = gcd_list(Xi)
print (d)

### FIXED CODE ###

a, b = map(int, input().split(" "))
if a % 2 == 1 and b % 2 == 1:
    print ("Yes")
else:
    print ("No")
import sys
input = sys.stdin.readline

x,n=map(int,input().split())
p=list(map(int,input().split()))

num=[i for i in range(1,101)]
for i in p:
    num[i-1]=0

num.append(-1)
num.sort()
while True:
    if num[1]!=0:
        break
    num.pop(1)
# print(num)

min=1000
for i in num:
    if min>abs(x-i):
        min=abs(x-i)
        ans=i
print(ans)

### FIXED CODE ###

import sys
input = sys.stdin.readline

x,n=map(int,input().split())
p=list(map(int,input().split()))

# num=[i for i in range(1,101)]
# for i in p:
#     num[i-1]=-1

# num.append(0)
# num.append(101)
# num.sort()
# while True:
#     if num[0]!=-1:
#         break
#     num.pop(0)
# print(num)

# min=1000
# for i in num:
#     if min>abs(x-i):
#         min=abs(x-i)
#         ans=i
# print(ans)

i=0
while True:
    if not x-i in p :
        print(x-i)
        break
    elif not x+i in p:
        print(x+i)
        break
    i+=1

# num=[]
# for i in range(101):
#     num.append(x-i)
#     num.append(x+i)
n,k = map(int,input().split())
l = list(map(int,input()))

l.sort()

print(l[-1]+l[len(l)-2]+l[len(l)-3])

### FIXED CODE ###

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

l.sort(reverse=True)

sum = 0

for i in range(k):
    sum += l[i]

print(sum)
import sys
from scipy.sparse import csr_matrix
from scipy.sparse.csgraph import shortest_path
from itertools import permutations

input = sys.stdin.readline
ans = -1

n, m, r = map(int, input().split())
r  = list(map(int, input().split()))
A, B, C = [], [], []
for i in range(m):
    a, b, c = map(int, input().split())
    a, b = a - 1, b - 1
    A.extend([a, b])
    B.extend([b, a])
    C.extend([c, c])

wf = shortest_path(csr_matrix((C, (A, B)), shape = (n, n)))

for pi in permutations(r):
    cand = 0
    for r1, r2 in zip(pi, pi[1:]):
        cand += int(wf[r1-1][r2-1])
    if ans < 0 or ans > cand:
        ans = cand

print(ans)


### FIXED CODE ###

import sys
from scipy.sparse import csr_matrix
from scipy.sparse.csgraph import floyd_warshall
from itertools import permutations

input = sys.stdin.readline
ans = -1

n, m, r = map(int, input().split())
r  = list(map(int, input().split()))
A, B, C = [], [], []
for i in range(m):
    a, b, c = map(int, input().split())
    A.append(a-1)
    B.append(b-1)
    C.append(c)

wf = floyd_warshall(csr_matrix((C, (A, B)), shape = (n, n)), directed=False)

for pi in permutations(r):
    cand = 0
    for r1, r2 in zip(pi, pi[1:]):
        cand += int(wf[r1-1][r2-1])
    if ans < 0 or ans > cand:
        ans = cand

print(ans)
N = int(input())
p = [int(input()) for i in range(N)]
q=[]
cnt=0
for i in range(N):
  q.append(i+1)
for i in range(N):
  if p[i]==q[i]:
    cnt=cnt
  else:
    cnt=cnt+1
if cnt==2:
  print('YES')
else:
  print('NO')

### FIXED CODE ###

N = int(input())
p = list(map(int, input().split()))
q=[]
cnt=0
for i in range(N):
  q.append(i+1)
for i in range(N):
  if p[i]==q[i]:
    cnt=cnt
  else:
    cnt=cnt+1
if cnt==2 or cnt==0:
  print('YES')
else:
  print('NO')
k=int(input())
a,b=map(int,input.split())
list=range(a,b+1)
for val in list:
  if val%k==0:
    print('OK')
    break
  else:
    print('NG')
    continue
    
  

### FIXED CODE ###

k=int(input())
p=0
a,b=map(int,input().split())
list=list(range(a,b+1))
for val in list:
  if val%k==0:
    print('OK')
    p+=1
    break
  else:
    continue

if p==0:
  print('NG')
W,a,b = [int(i) for i input().split()]
if a <= b and b <= a + W:
  print(0)
else:
  print(min(b+W-a,b-a-W))

### FIXED CODE ###

W,a,b = [int(i) for i in input().split()]
if a <= b and b <= a + W:
  print(0)
else:
  print(abs(a-b)-W)
import fractions

def lcm(l):
    if len(l) == 1:
        return l[0]

    t = l[0]
    for i in range(1, len(l)):
        t = (t * l[i]) // fractions.gcd(t, l[i])
    return t

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

# process/output
a = lcm(A)

if a/2 > M: 
    print(0)

else:
    print(int(M/a-0.5)+1)


### FIXED CODE ###

from functools import reduce
from fractions import gcd

def lcm(l):
    if len(l) == 1:
        return l[0]

    t = l[0]
    for i in range(1, len(l)):
        t = (t * l[i]) // gcd(t, l[i])
    return t

# input
N, M = map(int, input().split())
A = list(map(lambda x: x//2, map(int, set(input().split()))))

# process
ans = 0
lc = lcm(A)

if lc <= M:
    f = True
    for a in A:
        if lc//a%2 == 0:
            f = False
            break

    if f:
        ans = int(M/lc-1)//2+1

# output
print(ans)
import math
A, B = map(float,input().split(" "))
print(math.floor(A * int(B * 100) / 100)


### FIXED CODE ###

import math
A, B = map(str,input().split(" "))
B_ = int(B.split(".")[0])*100 + int(B.split(".")[1])

print(int(A) * B_ // 100)
from sympy import isprime
n = int(input())
lst_c = []
for c in range(1,n): #c != n
    lst_c.append(n-c)

for i in range(len(lst_c)):
    if isprime(lst_c[i]):
        lst_c[i] = 1

#print(lst_c)

cnt = 0
cnt2 = 0
for i in range(len(lst_c)):
    if lst_c[i] != 1:
        for j in range(1,int(lst_c[i]**0.5)+1):
            if lst_c[i]%j ==0:
                cnt += 1
                if lst_c[i]/j == j:
                    cnt2 +=1
                    #print("yes")
        lst_c[i] = cnt
        cnt = 0
        #cnt2 = 0


print(sum(lst_c)*2-cnt2-1)
#print(lst_c)

### FIXED CODE ###

def func(x):
    ans = 0
    for a in range(1, n):
        for b in range(1, n):
            c = n - a * b
            if c <= 0:
                break
            ans += 1
    return ans

n = int(input())
print(func(n))
x = input()

if x >= 30:
  print('Yes')
elif x < 30:
  print('No')

### FIXED CODE ###

x = int(input())

if x >= 30:
  print('Yes')
elif x < 30:
  print('No')
# 壊れている床を無視すればフィボナッチ数になってる

from collections import defaultdict

def Fib(n, dd, broken):
    if n in broken:
        return 0

    if dd[n] != 0:
        return dd[n]

    if n <= 1:
        return 1

    x = Fib(n-1, dd, broken) + Fib(n-2, dd, broken)
    dd[n] = x
    return x

dd = defaultdict(int)

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

ans = Fib(n, dd, A)
print(ans % 1000000007)

### FIXED CODE ###


# 壊れている床を無視すればフィボナッチ数になってる
from collections import defaultdict

def Fib(n, broken):
    dd = defaultdict(int)

    dd[0] = 1

    for i in range(n):
        for j in range(i+1, min(n, i+2)+1):
            if broken[j] == 0:
                dd[j] += dd[i]
                dd[j] %= 1000000007

    return dd[n]


n, m = map(int, input().split())
A = [int(input()) for _ in range(m)]
broken = defaultdict(int)
for c in A:
    broken[c] = 1

ans = Fib(n, broken)
print(ans % 1000000007)
from math import factorial

def combinations_count(n, r):
    ''' 組み合わせ '''
    return factorial(n) // (factorial(n - r) * factorial(r))

#print(combinations_count(5, 2))
def modpow(a, n, MOD):
  res = 1
  while (n > 0):
    if (n & 1):
      res = res * a % MOD
    a = a * a % MOD
    n >>= 1
  return res
 

K = int(input())
S = str(input())
mod = 10 ** 9 + 7
N = len(S)
L = N + K

ans = 0
p = N + K - 1
now = combinations_count(p, N - 1) % mod

for i in range(K + 1):
  a = pow(25, K - i, mod)
  b = pow(26, i, mod)
  c = a * b % mod
  ans += now * c % mod
  ans = ans % mod
  p -= 1
  now = int(now * (p - N + 1) / (p + 1)) % mod
print(ans)
  
  
  
  
  




### FIXED CODE ###

from math import factorial

def combinations_count(n, r):
    ''' 組み合わせ '''
    return factorial(n) // (factorial(n - r) * factorial(r))

#print(combinations_count(5, 2))
def modpow(a, n, MOD):
  res = 1
  while (n > 0):
    if (n & 1):
      res = res * a % MOD
    a = a * a % MOD
    n >>= 1
  return res

def cmb(n, r, p):
    if (r < 0) or (n < r):
        return 0
    r = min(r, n - r)
    return fact[n] * factinv[r] * factinv[n-r] % p

p = 10 ** 9 + 7
mod = 10 ** 9 + 7
N = 2 * 10 ** 6 + 1  # N は必要分だけ用意する
fact = [1, 1]  # fact[n] = (n! mod p)
factinv = [1, 1]  # factinv[n] = ((n!)^(-1) mod p)
inv = [0, 1]  # factinv 計算用
 
for i in range(2, N + 1):
    fact.append((fact[-1] * i) % p)
    inv.append((-inv[p % i] * (p // i)) % p)
    factinv.append((factinv[-1] * inv[-1]) % p)

K = int(input())
S = str(input())
N = len(S)

ans = 0
p = N + K - 1
#now = combinations_count(p, N - 1) % mod

for i in range(K + 1):
  p = N + K - i - 1
  now = cmb(p, N - 1, mod)
  a = pow(25, K - i, mod)
  b = pow(26, i, mod)
  c = a * b % mod
  ans += now * c % mod
  ans = ans % mod
print(ans)
N,M = map(int,input().split())
A = [input() for _ in range(N)]
B = [input() for _ in range(M)]

cnt = 0
if A < B:
    print('No')
else:
    for i in range(N):
        for j in range(M):
            if B[j] in A[i]:
                cnt+=1
                flag = True
            else:
                cnt = 0
                flag = False
        if cnt == M:
            break
if flag:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

N,M = map(int,input().split())
A = [input() for _ in range(N)]
B = [input() for _ in range(M)]

def comp(x,y):
    for i in range(M):
        for j in range(M):
            if A[x+i][y+j] != B[i][j]:
                return False
    return True
flag = False
for i in range(N-M+1):
    for j in range(N-M+1):
        if comp(i,j):
            flag = True
            break
if flag:
    print('Yes')
else:
    print('No')
def main():
    n = int(input())
    while True:
        try:
            li = [int(i) for i in input().split()]
            li = sorted(li)
            for x in li:
                tmp = x.split(" ")
                for i in range(len(tmp)):
                    tmp[i] = int(tmp[i])
                tmp = sorted(tmp)
                a,b,c = tmp[0],tmp[1],tmp[2]
                if (a**2 + b**2) == c**2:
                    print("YES")
                else:
                    print("NO")
        except EOFError:
            break
    return None

if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
    n = int(input())
    while True:
        try:
            num_list = [int(i) for i in input().split()]
            num_list = sorted(num_list)
            a,b,c = num_list[0],num_list[1],num_list[2]
            if (a**2 + b**2) == c**2:
                print("YES")
            else:
                print("NO")
        except EOFError:
            break
    return None

if __name__ == '__main__':
    main()
from itertools import permutations

N, M, R = map(int, raw_input().split())
r = [i - 1 for i in map(int, raw_input().split())]

G = [[float('inf')] * N for _ in range(N)]

for i in range(N):
    G[i][i] = 0

for i in range(M):
    A, B, C = map(int, raw_input().split())
    G[A-1][B-1] =  G[B-1][A-1] = C

# Warshall–Floyd Algorithm
for k in range(N):
    for i in range(N):
        for j in range(N):
            G[i][j] = min(G[i][j], G[i][k] + G[k][j]); 

ans = float('inf')

for i in permutations(r):
    t = 0
    for j in range(R-1):
        t += G[i[j]][i[j+1]]

    ans = min(ans, t)

print ans


### FIXED CODE ###

# coding: utf-8

from itertools import permutations
import Queue

N, M, R = map(int, raw_input().split())
r = [i - 1 for i in map(int, raw_input().split())]

G = [[] for _ in xrange(N)]

for i in range(M):
    A, B, C = map(int, raw_input().split())
    A -= 1; B -= 1;
    G[A].append((B, C))
    G[B].append((A, C))

# dijkstra Algorithm
def dijkstra(s):
    d = [float("inf") for _ in xrange(N)]
    que = Queue.PriorityQueue()
    d[s] = 0
    que.put([0, s])

    while not que.empty():
        p = que.get()
        v = p[1]
        if d[v] < p[0]:
            continue
        for i, j in G[v]:
            if d[i] > d[v] + j:
                d[i] = d[v] + j
                que.put([d[i], i])
    return d

table = {}

for i in r:
    table[i] = dijkstra(i)

ans = float('inf')

for i in permutations(r):
    ans = min(ans, sum([table[i[j]][i[j+1]] for j in xrange(R-1)]))

print ans
N = int(input())
A = [int(i) for i in input().split()]
dp = [0] * 10 ** 7
ans = 0
for i in range(N):
    x = i + 1 - A[i]
    if x >= 0:
        ans += dp[x]
    if x < 10 ** 7:
        dp[i + 1 + A[i]] += 1

print(ans)


### FIXED CODE ###

N = int(input())
A = [int(i) for i in input().split()]
dp = [0] * 10 ** 7
ans = 0
for i in range(N):
    x = i + 1 - A[i]
    if x >= 0:
        ans += dp[x]
    y = i + 1 + A[i]
    if y < 10 ** 7:
        dp[y] += 1

print(ans)
import sys
import numpy as np

MOD = 10 ** 9 + 7

n, *a = map(int, sys.stdin.read().split())
a = np.array(a, dtype=np.int64)

def main():
    b = a >> np.arange(60).reshape(-1, 1) & 1
    x = np.count_nonzero(b, axis=1)
    x = x * (n - x) % MOD
    # x *= 2 ** np.arange(60) % MOD
    for i in range(60):
        x[i] *= pow(2, i, MOD)
    x %= MOD
    ans = np.sum(x) % MOD
    return ans

if __name__ == '__main__':
    ans = main()
    print(ans)

### FIXED CODE ###

import sys
import numpy as np

MOD = 10 ** 9 + 7

N, *A = map(int, sys.stdin.read().split())
A = np.array(A, dtype=np.int64)

def main():
    answer = 0
    for n in range(60):
        B = (A >> n) & 1
        x = np.count_nonzero(B)
        y = N - x
        x *= y
        x *= pow(2, n, MOD)
        answer += x
    answer %= MOD
    return answer

if __name__ == '__main__':
    ans = main()
    print(ans)
def gcd(a,b):
    if a<b:
     d=a
     a=b
     b=d

    if b==0:
     b=1

    c=a%b

    if c==0:
     return b
    else:
     return 2

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



n=int(input())
t=[0]*n

for lop2 in range(n):
    t[lop2]=int(input())

ans=t[0]

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


### FIXED CODE ###

'''
def gcd(a,b):
    if a<b:
     c=a
     a=b
     b=c

    c=a%b

    if c==0:
     return b
    else:
     return gcd(b,c)
'''

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

def lcm(e,f):
    c=gcd(e,f)
    g=e*f
    return g//c



n=int(input())
t=[0]*n

for lop2 in range(n):
    t[lop2]=int(input())

ans=t[0]

for lop in range(1,n):
    ans=lcm(ans,t[lop])
print(int(ans))
import math
import numpy as np
N = int(input())
xy = [[0,0] for _ in range(N)]
for a in xy:
    a[0], a[1] = map(int, input().split())
x=a[0]
y=a[1]



da = np.zeros([N, N])

for i in range(N):
    for j in range(N):
        Da = math.sqrt((x[i] - x[j])**2 + (y[i] - y[j])**2)
        da[i][j] = Da
avg = np.sum(da) * math.factorial(N-1) / math.factorial(N)
print(avg)

### FIXED CODE ###

import math
N = int(input())
x = [0]*N
y = [0]*N
for i in range(N):
    x[i],y[i] = map(int,input().split())
at=[]
for i in range(N):
    for j in range(N):
        ea = math.sqrt((x[i] - x[j])**2 + (y[i] - y[j])**2)
        at.append(ea)
da = 0
for ag in at:
    da += ag
avg = da * math.factorial(N - 1) / math.factorial(N)
print(avg)
S = input().rstrip()
K = int(input())
c = 0
for item in S:
  if item == "1":
    c+=1
  else:
    break
n = S[c] if c < len(S) else None
a = n if n and c < K and else S[0]
print(a)

### FIXED CODE ###

S = input().rstrip()
K = int(input())
c = 0
for item in S:
  if not item == "1":
    break
  c+=1
n = S[c] if c < len(S) else None
a = n if n and c < K else S[0]
print(a)
N = int(input())
XU = [list(map(int, input().split())) for i in range(N)]
ans = 0
for i in range(N):
  if XU[i][1] == 'JPN':
    ans += XU[i][0]
  else:
    ans += XU[i][0] * 380000.0
print(ans)

### FIXED CODE ###

N = int(input())
ans = 0
for i in range(N):
  val, currency = input().split()
  if currency == 'JPY':
    ans += float(val)
  else:
    ans += float(val) * 380000.0
print(ans)
a = map(float, raw_input().split())

Pi = 3.141592658979

print("%f %f" % (a*a*Pi, 2*a*Pi))

### FIXED CODE ###

import math

a = float(input())

print("%f %f" % (a*a*math.pi, 2*a*math.pi))
while 1:
    try:
        n,m = map(int, raw_input().split())
        ans = 0
        for i in xrange(n,m+1):
            p = i
            while p>1:
                if p%2==0:
                    p/=2
                elif p%3==0:
                    p/=3
                elif p%5==0:
                    p/=5
                else: break
            if p==1: ans+=1
        print ans
    except EOFError:
        break

### FIXED CODE ###

while 1:
    ipt = raw_input()
    if ipt=="0": break
    m,n = map(int, ipt.split())
    ans = 0
    for i in xrange(m,n+1):
        p = i
        while p>1:
            if p%2==0:
                p/=2
            elif p%3==0:
                p/=3
            elif p%5==0:
                p/=5
            else: break
        if p==1: ans+=1
    print ans
l=int(input())
print((l/3)**3)

### FIXED CODE ###

# -*- coding: utf-8 -*-
N, M = map(int, input().split())
import math
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
if N != 0:
  if N != 1:
    N_sum = combinations_count(N, 2)
  else:
    N_sum = 0
else:
  N_sum = 0
if M != 0:
  if M != 1:
    M_sum = combinations_count(M, 2)
  else:
    M_sum = 0
else:
  M_sum = 0
print(N_sum + M_sum)