Harryxun/stf_run huggingface dataset:
import fractions
N, M = map(int, input().split())
S = input()
T = input()
if S[0] != T[0]:
    print(-1)
else:
    lcm = N*M // fractions.gcd(N, M)
    count = 1
    tmp = lcm // N
    tmp2 = lcm // M
    flag = False
    for _ in range(min(N, M)):
        tmp_s = [""] * (lcm * count)
        for i in range(N):
            tmp_s[((lcm*count) // N) * i] = S[i]
        for i in range(M):
            if tmp_s[((lcm*count) // M) * i] != "" and tmp_s[((lcm*count) // M) * i] != T[i]:
                count += 1
                flag = True
                break
        if flag:
            flag = False
            continue
        print(count * lcm)
        exit(0)
    print(-1)


### FIXED CODE ###

import collections
import fractions
N, M = map(int, input().split())
S = input()
T = input()
lcm = (N*M) // fractions.gcd(N, M)
if S[0] != T[0]:
    print(-1)
elif N == M and S != T:
    print(-1)
else:
    tmp = lcm // N
    tmp2 = lcm // M
    tmp_s = collections.defaultdict(str)
    for i in range(N):
        tmp_s[tmp*i] = S[i]

    for i in range(M):
        if tmp2*i in tmp_s:
            if T[i] != tmp_s[tmp2*i]:
                print(-1)
                exit(0)
    print(lcm)
N = int(input())
h = [0] + [int(i) for i in input().split()]
result = 0
for i in range(1, len(h)):
  if h[i] > h[i-1]:
    result += h[i] - h[i-1]
print(result)

### FIXED CODE ###

A,B,C=(int(i) for i in input().split())
print(int(A*B/2))
x = int(input())
count = 0
 
for i in range(2,10):
  if x % i == 0 and (x // i) <= 9:
    print("Yes")
    exit()
  else:
    count += 1
 
if count == 8:
  print("No")

### FIXED CODE ###

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

if x < 10 and y < 10:
  print(x * y)
else:
  print(-1)
a.b = map(int.input().split())
if a/2%b === 0 :
    print (a/2/b)
else :
print(a/2//b+1)


### FIXED CODE ###

a,b = map(int,input().split())
c = b*2+1
if a%c ==0:
    print(int(a//c))
else:
    print(int(a//c)+1)
A,B = map(int,input().split())
if A > 2B :
  print(A - 2B)
else :
  print(0)

### FIXED CODE ###

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

if A > 2*B :
    print(A - 2*B)
else :
    print(0)
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    N, A, *X = map(int, read().split())

    M = sum(X)
    dp = [[0] * (M + 1) for j in range(N + 1)]
    dp[0][0] = 1

    for i in range(N):
        for j in range(N, 0, -1):
            for k in range(X[i], M + 1):
                dp[j][k] += dp[j - 1][k - X[i]]

    ans = 0
    for j in range(1, min(50, M // A) + 1):
        ans += dp[j][A * j]

    print(ans)
    return


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    N, A, *X = map(int, read().split())

    dp = [[0] * (N * 50 + 1) for j in range(N + 1)]
    dp[0][0] = 1

    for i in range(N):
        for j in range(N, -1, -1):
            for k in range(N * 50 + 1):
                if k - X[i] >= 0 and j > 0:
                    dp[j][k] += dp[j - 1][k - X[i]]

    ans = 0
    for j in range(1, N + 1):
        ans += dp[j][A * j]

    print(ans)
    return


if __name__ == '__main__':
    main()
N = int(input())
a = list(map(int,input().split()))
for i in range(N):
    if i % 2 ==0:
        Alice+=a[i]
    else:
        Bob+=a[i]
if Alice>Bob:
    print(Alice-Bob)
else:
    print(Bob-Alice)

### FIXED CODE ###

N = int(input())
a = list(map(int,input().split()))
Alice=0
Bob=0
a.sort(reverse=True)
for i in range(N):
    if i % 2 == 0:
        Alice+=a[i]
    else:
        Bob+=a[i]
if Alice>Bob:
    print(Alice-Bob)
else:
    print(Bob-Alice)
n = int(input())
a = input().split()
if n % 2 == 0 :
    le = [0] * n // 2
    lo = [0] * n // 2
    counte = 0
    counto = 0
    for i in range(n) :
        if i % 2 == 0 :
            lo[counto] = a[i]
            counto+=1
        else :
            le[counte] = a[i]
            counte +=1
    le.reverse()
    l = le + lo
    S = ' '.join(l)
    print(S)
else :
    l = [a[0]]
    for i in range(1,n) :
        if i % 2 == 1 :
            l.append(a[i])
        else :
            l.insert(0,a[i])
    S = ' '.join(l)
    print(S)

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
ki=[]
gu=[]
for i in range(n):
  if i%2:
    ki.append(a[i])
  else:
    gu.append(a[i])
#print(ki,gu)
if n%2==0:
  ki.reverse()
  ki.extend(gu)
  print(*ki)
else:
  gu.reverse()
  gu.extend(ki)
  print(*gu)
import collections

N = int(input())
v = list(map(int,input().rstrip().split()))
list_odd = v[0::2]
list_even = v[1::2]

odd_count = collections.Counter(list_odd)
even_count = collections.Counter(list_even)


max_flq_odd = [kv for kv in odd_count.items() if kv[1] == max(odd_count.values())]
max_flq_even = [kv for kv in even_count.items() if kv[1] == max(even_count.values())]

if odd_count == even_count and len(odd_count) == 1:
    #数字が一種類しかない
    print(N//2)
elif max_flq_odd == max_flq_even and len(max_flq_odd) == 1:
    #最大値が同じで一種類しかない
    odd_wo_max = [kv for kv in odd_count if kv[1] != max(odd_count.values())]
    secondmax_odd = [kv for kv in odd_wo_max.items() if kv[1] == max(odd_wo_max.values())]
    even_wo_max = [kv for kv in odd_count if kv[1] != max(odd_count.values())]
    secondmax_even = [kv for kv in even_wo_max.items() if kv[1] == max(even_wo_max.values())]
    secondmax = max(secondmax_odd,secondmax_even)
    print(N-max_flq_odd-secondmax)
else:
    #最大値が違うか、最大値をとるキーが複数あり代替がきく
    print(N-max_flq_odd[0][1]-max_flq_even[0][1])

### FIXED CODE ###

import collections

N = int(input())
v = list(map(int,input().rstrip().split()))
list_odd = v[0::2]
list_even = v[1::2]

odd_count = collections.Counter(list_odd).most_common()
even_count = collections.Counter(list_even).most_common()

if len(odd_count) == 1 and len(even_count) == 1:
    if odd_count[0][0] == even_count[0][0]:
        print(N//2)
    else:
        print(0)
elif odd_count[0][0] != even_count[0][0]:
    print(N-odd_count[0][1]-even_count[0][1])
elif len(odd_count) == 1:
    print(N//2-even_count[1][1])
elif len(even_count) == 1:
    print(N//2-odd_count[1][1])
else:
    print(min(N-odd_count[0][1]-even_count[1][1], N-even_count[0][1]-odd_count[1][1]))
N = int(input())
if N < 50000
print("No")

### FIXED CODE ###

N = int(input())
hoge = input().split()
H = []
for i in range(N):
  H.append(int(hoge[i]))

piyo = True
dame = False
if N == 1:
  print("Yes")
else:
  for i in range(0,N-1):
    huga = H[i+1] - H[i]
    # print(huga)
    if huga < -1:
      dame = True
      break
    elif huga == -1:
      if piyo == True:
        H[i] = H[i] - 1
      piyo = True
    elif huga > 0:
      H[i+1] = H[i+1] - 1
      piyo = False
  # print(H)
  for i in range(0,N-1):
    huga = H[i+1] - H[i]
    # print(huga)
    if huga < 0:
      dame = True
      break
  if dame == True:
    print("No")
  else:
    print("Yes")
from queue import PriorityQueue
N = int(input())
A = map(int, input().split())
q = PriorityQueue
for a in A:
  q.put(a)
x = q.get()
while not q.empty():
  y=q.get()
  if y == 0:
    break
  q.put(x % y)
  x = y
print(x)

### FIXED CODE ###

from queue import PriorityQueue
N = int(input())
A = map(int, input().split())
q = PriorityQueue()
for a in A:
    q.put(-a)
x = -q.get()
while not q.empty():
    y = -q.get()
    if y == 0:
        break
    q.put(-(x % y))
    x = y
print(x)
import sys
input = sys.stdin.readline
sys.setrecursionlimit(100000000)
MOD = 10 ** 9 + 7
INF = 10 ** 10

MAXN = 100005
G = [[] for _ in range(MAXN)]
dp = [[] for _ in range(MAXN)]
deg = [0] * MAXN
parents = [-1] * MAXN
result = [0] * MAXN

def dfs1(v,mod,p = -1):
    ans = 1
    for i in range(deg[v]):
        e = G[v][i]
        if e == p:
            parents[e] = i
            continue
        dp[v][i][1] = dfs1(e,mod,v)
        ans *= dp[v][i][0] + dp[v][i][1]
        ans %= mod
    return ans%mod

def dfs2(v,mod,res_p = 1,p = -1):
    if p != -1:
        dp[v][parents[v]][1] = res_p
    cuml = [1] * (deg[v] + 1)
    cumr = [1] * (deg[v] + 1)
    for i in range(deg[v]):
        cuml[i + 1] = cuml[i] * (dp[v][i][0] + dp[v][i][1]) % mod
    for i in range(deg[v] - 1,-1,-1):
        cumr[i] = cumr[i + 1] * (dp[v][i][0] + dp[v][i][1]) % mod
    result[v] = cumr[0]
    for i in range(deg[v]):
        e = G[v][i]
        if e == p:
            continue
        dfs2(e,mod,cuml[i] * cumr[i + 1] % mod,v)

def main():
    n,m = map(int,input().split())
    for _ in range(n - 1):
        x,y = map(int,input().split())
        x -= 1
        y -= 1
        G[x].append(y)
        G[y].append(x)
    
    for i in range(n):
        deg[i] = len(G[i])
        dp[i] = [[1] * 2 for _ in range(deg[i])]
    
    dfs1(0,m)
    dfs2(0,m)
    for i in range(n):
        print(result[i])      

if __name__=='__main__':
    main()


### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(100000000)
MOD = 10 ** 9 + 7
INF = 10 ** 10

MAXN = 100005
G = [[] for _ in range(MAXN)]
dp = [[] for _ in range(MAXN)]
deg = [0] * MAXN
parents = [-1] * MAXN
result = [0] * MAXN

def dfs1(v,mod,p = -1):
    ans = 1
    for i in range(deg[v]):
        e = G[v][i]
        if e == p:
            parents[v] = i
            continue
        dp[v][i] = dfs1(e,mod,v)
        ans *= dp[v][i] + 1
        ans %= mod
    return ans%mod

def dfs2(v,mod,res_p = 1,p = -1):
    if p != -1:
        dp[v][parents[v]] = res_p
    cuml = [1] * (deg[v] + 1)
    cumr = [1] * (deg[v] + 1)
    for i in range(deg[v]):
        cuml[i + 1] = cuml[i] * (1 + dp[v][i]) % mod
    for i in range(deg[v] - 1,-1,-1):
        cumr[i] = cumr[i + 1] * (1 + dp[v][i]) % mod
    result[v] = cumr[0]
    for i in range(deg[v]):
        e = G[v][i]
        if e == p:
            continue
        dfs2(e,mod,cuml[i] * cumr[i + 1] % mod,v)

def main():
    n,m = map(int,input().split())
    for _ in range(n - 1):
        x,y = map(int,input().split())
        x -= 1
        y -= 1
        G[x].append(y)
        G[y].append(x)
    
    for i in range(n):
        deg[i] = len(G[i])
        dp[i] = [1] * deg[i]
    
    dfs1(0,m)
    dfs2(0,m)
    for i in range(n):
        print(result[i])      

if __name__=='__main__':
    main()
O = list(input())
E = list(input())
ans = list()
 
for i in range(len(O)):
    ans.append(O[i])
    if i > len(E):
        break
    else:
        ans.append(E[i])
result = "".join(ans)
print(result)

### FIXED CODE ###

O = list(input())
E = list(input())
ans = list()
LEN = len(O)+len(E)
for i in range(LEN):
    if i%2==0:
        ans.append(O[0])
        del O[0]
    else:
        ans.append(E[0])
        del E[0]
result = "".join(ans)
print(result)
a,b,c = map(int, raw_input().split(" "))
if a > b :
    if a > c :
        if b > c :
            print(%d %d %d)% a b c
        elif c > b :
            print(%d %d %d)% a c b
    else c > a :
        print(%d %d %d)% c a b
elif b > a :
    if b > c :
        if a > c
            print(%d %d %d)% b a c
        elif c > a :
            print(%d %d %d)% b c a
    else c > b
        print(%d %d %d)% c b a

### FIXED CODE ###

al = list(map(int, input().split()))
al = sorted(al)
print(al[0],al[1],al[2])
# coding:utf-8
import readline
import datetime

H1 = int(input())
M1 = int(input())
H2 = int(input())
M2 = int(input())
K = int(input())

while 0 <= H1 < 23 or 0 <= M1 < 60 or 0 <= H2 < 23 or 0 <= M2 < 60:
    if M2 > M1:
        a = (H2 - H1) * 60 + M2 - M1
        print(a - K)
    else:
        M2 < M1
        b = (H2 - H1) * 60 + M1 - M2
        print(b - K)

### FIXED CODE ###

import sys
readline = sys.stdin.buffer.readline

h1, m1, h2, m2, k = map(int, readline().split())
print(60 * (h2 - h1) + m2 - m1 - k)
from sys import stdin
h, w = [int(x) for x in stdin.readline().rstrip().split()]
matrix = [stdin.readline().rstrip() for _ in range(h)]
for i in range(h):
    matrix[i] = [matrix[i][x:x+1] for x in range(len(matrix[i]))]
    matrix[i] = [0 if x == '.' else x for x in matrix[i]]
for i in range(h):
    for j in range(w):
        if matrix[i][j] == '#':
            for n in range(-1, 2):
                for m in range(-1, 2):
                    i_n = i + n
                    j_m = j + m
                    if matrix[i_n][j_m] != '#' and i_n >= 0 and j_m >= 0:
                        matrix[i_n][j_m] += 1
for i in range(h):
  for j in range(w):
  	print('{}'.format(matrix[i][j]), end = '')
  print('')

### FIXED CODE ###

from sys import stdin
h, w = [int(x) for x in stdin.readline().rstrip().split()]
matrix = [stdin.readline().rstrip() for _ in range(h)]
for i in range(h):
    matrix[i] = [matrix[i][x:x+1] for x in range(len(matrix[i]))]
    matrix[i] = [0 if x == '.' else x for x in matrix[i]]
for i in range(h):
    for j in range(w):
        if matrix[i][j] == '#':
            for n in range(-1, 2):
                for m in range(-1, 2):
                    i_n = i + n
                    j_m = j + m
                    if h > i_n >= 0 and w > j_m >= 0 :
                    	if matrix[i_n][j_m] != '#':
                        	matrix[i_n][j_m] += 1
for i in range(h):
  for j in range(w):
  	print('{}'.format(matrix[i][j]), end = '')
  print('')
X, Y, Z = int(input())
X, Z = Z, X
print(X, Y, Z)

### FIXED CODE ###

X, Y, Z = map(int, input().split())
print(Z, X, Y)
n = int(input())
s = input().rstrip.split()
for i in (reverse(s)):
    print(s)


### FIXED CODE ###

n = int(input())
s = input().split()
s.reverse()
print(' '.join(s))
# -*- coding: utf-8 -*-
# 整数の入力
N = int(input())
A = [int(a) for a in input().split()]
Q = int(input())
process = []
proc_append = process.append
for i in range(Q):
	proc_append(tuple(input().split()))
	process[i] = tuple(map(int,process[i]))

A.sort()

for b,c in process:
	if b in set(A):
		for i in range(N):
			if b==A[i]:
				begin = i
				break
		for i in range(begin,N):
			if b!=A[i]:
				end = i-1
				break
			if i==N-1:
				end = i
		for i in range(begin,end+1):
			A[i] = c
	print(sum(A))

### FIXED CODE ###

c = input()
oc = ord(c)

if 65<=oc<=90:
  print('A')
else:
  print('a')
while True:
    n=input()
    if n==0:break
    A=map(int,raw_input().split())
    S=set(A)
    for c in S:
        if A.count(c)>n/2:
            print c
            break
    else:
        print "NO COLOR"

### FIXED CODE ###

while True:
    n=input()
    if n==0:break
    A=map(int,raw_input().split())
    A.sort()
    cnt=0
    pre=A[0]
    for c in A:
        if c==pre:
            cnt+=1
            if cnt>n/2:
                print c
                break
        else:
            cnt=1
            pre=c
    else:
        print "NO COLOR"
a,b = input().split()
a1 = int(a)
bs = list(b)
b1 = int(bs[0])
b2 = 0
if len(b)==3:
    b2 = int(bs[2])*10
else:
    b2 = int(bs[2]+bs[3])
b1 = b1*100+b2
ans = list(str(a1*b1))
del ans[-1]
del ans[-1]
print(''.join(ans))

### FIXED CODE ###

a,b = input().split()
a1 = int(a)
bs = list(b)
b1 = int(bs[0])
b2 = 0
if len(b)==3:
    b2 = int(bs[2])*10
else:
    b2 = int(bs[2]+bs[3])
b1 = b1*100+b2
ans = list(str(a1*b1))
del ans[-1]
if ans:
    del ans[-1]
if ans:
    print(''.join(ans))
else:
    print(0)
a,b=mp(int,input().split())
if a+b>24:
 print(a+b-24)
else:
 print(a+b)

### FIXED CODE ###

a,b=map(int,input().split())
if a+b>23:
 print(a+b-24)
else:
 print(a+b)
import numpy as np
a,b = input().split()
np.trunc(a+b/2)

### FIXED CODE ###

import numpy as np
a,b = input().split()
print(int(np.ceil((int(a)+int(b))/2)))
n,k=map(int,input().split())
p=[int(i)-1for i in input().split()]
c=list(map(int,input().split()))
ans=-10**9
for i in range(n):
    start=i
    cycle=[0]
    for _ in range(n):
        i=p[i]
        cycle+=[cycle[-1]+c[i]]
        if i==start:break
    S,L=cycle[-1],len(cycle)-1
    if S<0:ans=max(ans,max(cycle[1:k]))
    else:ans=max(ans,k//L*S+max(cycle[:k%L+1]))
print(ans)

### FIXED CODE ###

a=[0]
for i in input():
    if i=="R":a+=[a[-1]+1]
    else:a+=[0]
print(max(a))
import sys
sys.setrecursionlimit(4100000)
import math
import itertools
INF = float('inf')
from heapq import heapify, heappop, heappush

def main():
    a,b = map(int, input().split())

    if b < a:
        prnit('GREATER')
    elif a == b:
        print('EQUAL')
    else:
        print('LESS')


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
sys.setrecursionlimit(4100000)
import math
import itertools
INF = float('inf')
from heapq import heapify, heappop, heappush

def main():
    a = int(input())
    b = int(input())

    if b < a:
        print('GREATER')
    elif a == b:
        print('EQUAL')
    else:
        print('LESS')


if __name__ == '__main__':
    main()
N = int(input())
cnt = 0
for i in range(1,N+1):
    if len(str(i)) % 2 != 0:
        cnt += 1
print (cnt)


### FIXED CODE ###

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

if c - ( a - b) >= 0  :
    print( c - ( a - b))
else:
    print(0)
H,W,h,w=[map(int, input().split()) for _ in range(2)]
print((H-h)*(W-w))

### FIXED CODE ###

H, W = list(map(int, input().split()))
h, w = list(map(int, input().split()))
print((H - h)*(W - w))
N, M = map(int, input().split())
ab = [map(int, input().split()) for _ in range(N)]

ans = []
for i in range(1,max(ab)+1):
    ans.append(ans.count(i))

for x in ans:
    print(x)

### FIXED CODE ###

N, M = map(int, input().split())
c = [0] * N

for _ in range(M):
    a, b = map(int, input().split())
    c[a - 1] += 1
    c[b - 1] += 1

print(*c, sep='\n')
import math

A, B, C, D=map(int, input().split())
x=math.gcd(C, D)
p=B//C-(A-1)//C
q=B//D-(A-1)//D
r=B//x-(A-1)//x
print(B-(A-1)-(p+q-r))

### FIXED CODE ###

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

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

temp=input().split()
A=int(temp[0])
B=int(temp[1])
C=int(temp[2])
D=int(temp[3])

x=B//C-(A-1)//C
y=B//D-(A-1)//D
s=lcm(C, D)
z=B//s-(A-1)//s

print(int(B-A+1-x-y+z))
day = input().rstrip()

days = {'SUN':0, 'MON':1, 'TUE':2, 'WED':3, 'THU':4, 'FRI': 5,'SAT',6}

print (7 - days[day])

### FIXED CODE ###

day = input()

days = {'SUN':0, 'MON':1, 'TUE':2, 'WED':3, 'THU':4, 'FRI': 5,'SAT':6}

print(7 - days[day])
import math
length,target = (int(n) for n in input().split(" "))
ball = [int(n) for n in input().split(" ")]
gcd = ball[0]
for i in range(1,length):
    gcd = math.gcd(gcd,ball[i])
if target % gcd == 0 and target <= max(ball)

### FIXED CODE ###

import fractions 
length,target = (int(n) for n in raw_input().split(" "))
ball = [int(n) for n in raw_input().split(" ")]
gcd = ball[0]
for i in range(1,length):
    gcd = fractions.gcd(gcd,ball[i])
if target % gcd == 0 and target <= max(ball):
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")
import math
W, H, x, y = map(int, input().split())
half_s = W*H/2
tmp = (x-y)**2**0.5
print(half_s,math.floor(tmp-1))

### FIXED CODE ###

W, H, x, y = map(float, input().split())
half_s = W*H/2
tmp = 0
if x == W/2 and y == H/2:
    tmp = 1
print(half_s,tmp)
a,b,x=map(int,input().split())
if(a<=x or a+b==x);
   print("Yes")
else:
  print("No")
         

          

### FIXED CODE ###

a,b,x=map(int,input().split())
if  a>x:
    print("NO")
else:
    if x<=a+b:
        print("YES")
    else:
        print("NO")
import fractions
from functools import reduce

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

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

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

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

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


n, m = map(int, input().split())
a = list(map(int, input().split()))
flag = True
ans = 0

for i in range(n):
    a[i] /= 2
tmp = int(gcd_list(a))
#print(tmp)
for i in range(n):
    a[i] //= tmp
    a[i] = int(a[i])
    if a[i] % 2 == 0:
        flag = False

if flag:
    tmp = lcm_list(a)
    ans = (m+tmp) // (2*tmp) 
else:
    ans = 0

print(ans)



### FIXED CODE ###

#%%
import fractions
def gcd_base(x, y):
    return fractions.gcd(x, y)

def gcd_list(l):
    tmp = l[0]
    for i in range(1, len(l)):
        tmp = gcd_base(tmp, l[i])
    return tmp

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

def lcm_list(l):
    tmp = l[0]
    for i in range(1, len(l)):
        tmp = lcm_base(tmp, l[i])
        if tmp > 10**9:
            tmp = -1
            break
    return tmp

n, m = map(int, input().split())
a = list(map(lambda x: int(x)//2 , input().split()))
f1 = True

lcm = lcm_list(a)
if lcm == -1:
    ans = 0
else:
    for i in range(n):
        if (lcm // a[i]) % 2 == 0:
            ans = 0 
            f1 = False
            break
    if f1:
        ans = (m + lcm) // (2 * lcm)
print(ans)
from collections import deque

H,W = map(int, input().split())
s = [input() for _ in range(H)]

cnt = 0
for i in range(H):
    cnt += s[i].count('.')

dx = [1,0,-1,0]
dy = [0,1,0,-1]

visited = [[float('inf')] * W for i in range(H)]

def bfs():
    queue = deque([[0,0]])
    visited[0][0] = 1

    while queue:
        y,x = queue.popleft()

        if y == H - 1 and x == W - 1:
            return visited[y][x]
        
        for i in range(4):
            nx = x + dy[i]
            ny = y + dx[i]

            if 0 <= nx < W and 0 <= ny < H and s[ny][nx] != '#' and visited[ny][nx] == float('inf'):
                queue.append([ny,nx])
                visited[ny][nx] = visited[y][x] + 1

print(cnt - bfs())

### FIXED CODE ###

from collections import deque

H,W = map(int, input().split())
s = [input() for _ in range(H)]

cnt = 0
for i in range(H):
    cnt += s[i].count('.')

dx = [1,0,-1,0]
dy = [0,1,0,-1]

visited = [[float('inf')] * W for i in range(H)]

def bfs():
    queue = deque([[0,0]])
    visited[0][0] = 1

    while queue:
        y,x = queue.popleft()

        if y == H - 1 and x == W - 1:
            return visited[y][x]
        
        for i in range(4):
            nx = x + dy[i]
            ny = y + dx[i]

            if 0 <= nx < W and 0 <= ny < H and s[ny][nx] != '#' and visited[ny][nx] == float('inf'):
                queue.append([ny,nx])
                visited[ny][nx] = visited[y][x] + 1
    
    return -1

num = bfs()

if num == -1:
    print(num)
else:
    print(cnt - num)
def solve(string):
    n, t, *ct = map(int, string.split())
    c = [_c for _c, _t in zip(ct[::2], ct[1::2]) if _t <= t]
    return str(min(c)) if len(c) else "TLE"


if __name__ == '__main__':
    n, t = map(int, input().split())
    print(solve("{} {}\n".format(n, t) + "\n".join([input() for _ in n])))


### FIXED CODE ###

n, t = map(int, input().split(" "))
ct = [list(map(int, input().split(" "))) for _ in range(n)]
valid = [_ct for _ct in ct if _ct[-1] <= t]
if len(valid) > 0:
    print(sorted(valid, key=lambda x: x[0])[0][0])
else:
    print("TLE")
N = int(input())
S = list(input())

reS = S[::-1]

wSum = [0 for i in range(N)]
eSum = [0 for i in range(N)]

for i in range(N):
    if i == 0:
        if S[i] == 'W':
            wSum[i] = 1
        if reS[i] == 'E':
            eSum[i] = 1
    else:
        if S[i] == 'W':
            wSum[i] = wSum[i-1] + 1
        else:
            wSum[i] = wSum[i-1]
        if reS[i] == 'E':
            eSum[i] = eSum[i-1] + 1
        else:
            eSum[i] = eSum[i-1]

eSum = eSum[::-1]

cost = eSum[1]

for i in range(1,N):
    if i == N - 1:
        if cost > wSum[N-2]:
            cost = wSum[N-2]
    else:
        if cost > wSum[i-1] + eSum[i+1]:
            cost = wSum[i-1] + eSum[i+1]
print(cost)


### FIXED CODE ###

a, b = map(int, input().split())
calcs = [a + b, a - b, a * b]
print(max(calcs))
s = input()
if s[0]!="A":
  print("WA")
  exit()
else:
  s = s.pop(0)
  
if "C" in s[2:len(s)-1]:
  s = s.replace("C","",1)
  
if s.islower()==True:
  print("AC")
else:
  print("WA")

### FIXED CODE ###

s = list(input())
flg = "WA"
if s[0]=="A":
  if "C" in s[2:len(s)-1]:
    s.remove("A")
    s.remove("C")
    s = ''.join(s)
    if s.islower()==True:
      flg = "AC"
print(flg)
l = map(int,raw_input().split())
s = l[0] * l[1]
shu = l[0] * 2 + l[1] * 2
fmt = "{s2} {shu2}"
s = fmt.format(s2 = s,shu2 = shu)
print(s)

### FIXED CODE ###

x = int(input())
print(x ** 3)