Harryxun/stf_run huggingface dataset:
x, y = input().split()
d = {'A':10, 'B':11, 'C':12, 'D':13, 'E':14, 'F':15}
if d[x] < d[y]:
  print('<')
if d[x] = d[y]:
  print('=')
else:
  print('>')


### FIXED CODE ###

x, y = input().split()
d = {'A':10, 'B':11, 'C':12, 'D':13, 'E':14, 'F':15}
if d[x] < d[y]:
  print('<')
elif d[x] == d[y]:
  print('=')
else:
  print('>')
from itertools import combinations

mod = 2019
l, r = L % mod, R % mod
if l > r:
    l, r = r, l

mini = l*r % mod
for i in range(l, r):
  for j in range(i+1, r+1):
    mini = min(mini, i*j % mod)
    if mini == 0:
        break
print(mini)

### FIXED CODE ###

L, R = map(int, input().split())
from itertools import combinations

mod = 2019

if R - L >= mod:
    print(0)
else:
    mini = mod - 1
    for i, j in combinations(range(L, R+1), 2):
        mini = min(mini, i*j % mod)
        if mini == 0:
            break
    print(mini)
s = int(input())

i = 0
a = []
a.append(s)
b = [0] * 1000

while True:
    if a[i] % 2 == 0:
        a.append(a[i] // 2)
    else:
        a.append(a[i] * 3 + 1)
    b[a[i]] += 1
    if b[a[i]] == 2:
        break
    i += 1

print(i + 1)

### FIXED CODE ###

s = int(input())

i = 0
a = []
a.append(s)
b = [0] * 10000

while True:
    if a[i] % 2 == 0:
        a.append(a[i] // 2)
    else:
        a.append(a[i] * 3 + 1)
    b[a[i]] += 1
    if b[a[i]] == 2:
        break
    i += 1

print(i + 1)
input = input()
if input='ABC':
  print('ARC')
else:
  print('ABC')

### FIXED CODE ###

x = str(input())
if x == 'ABC':
  print('ARC')
else:
  print('ABC')
import numpy as np
from scipy.sparse import csr_matrix
from scipy.sparse.csgraph import floyd_warshall

n,m,l=map(int,input().split())
ll=[]
for i in range(m):
    a,b,c=[int(j) for j in input().split()]
    if c<=l:
        ll.append((a,b,c))
q=int(input())
st=[]
for i in range(q):
    st.append([int(j)-1 for j in input().split()])
if ll==[]:
    print(-1)
    exit()
edge=np.array(ll,dtype=np.int64).T
graph=csr_matrix(((edge[2],edge[:2]-1)),(n,n))

#False->無向グラフ True->有効グラフ
ans=floyd_warshall(graph,directed=False)

graph2=np.full((n,n),np.inf)

np.fill_diagonal(graph2,0)

graph2[ans<=l]=1


ans2=floyd_warshall(graph2,directed=False)


for i,j in st:
    if int(ans2[i][j])==float("inf"):
        print(-1)
    else:
        print(int(ans2[i][j])-1)



### FIXED CODE ###

import numpy as np
from scipy.sparse.csgraph import floyd_warshall

n,m,l=map(int,input().split())
ans=[[0]*n for i in range(n)]
for i in range(m):
    a,b,c=[int(j) for j in input().split()]
    ans[a-1][b-1]=c
    ans[b-1][a-1]=c
q=int(input())
st=[]
for i in range(q):
    st.append([int(j)-1 for j in input().split()])

ans=floyd_warshall(ans)

for i in range(n):
    for j in range(n):
        if ans[i][j]<=l:
            ans[i][j]=1
        else:
            ans[i][j]=0

ans=floyd_warshall(ans)

for i,j in st:
    if ans[i][j]==float("inf"):
        print(-1)
    else:
        print(int(ans[i][j])-1)
dat=str(input().split())
print(dat.count('1')

### FIXED CODE ###

dat = input()
print(dat.count('1'),end="")
from collections import Counter
N = int(input())
S = [input() for _ in range(N)]
CS = Counter(S)
math = 0
ans = []
for i  in CS.values():
  v = max(v,i)
for i,j in CS.items():
  if v == j:
    ans.append(i)
ans.sort
print(ans[i] for i in range(len(ans)))



### FIXED CODE ###

from collections import Counter
N = int(input())
S = [input() for _ in range(N)]
CS = Counter(S)
v = 0
ans = []
for i  in CS.values():
  v = max(v,i)
for j,k in CS.items():
  if v == k:
    ans.append(j)
ans.sort()
print(*ans,sep="\n")
N = int(input())
A = []
for i in range(1,46):
  for j in range(1,46):
    for k in range(1,46):
      A.append(i**2+j**2+k**2+i*j+i*k+j*k)
A = sorted(A)
B = [0]*100000
for i in range(10000):
  if A[i] < 10000:
    B[A[i]] += 1
C = B[1:N+1]
[print(i) for i in C]

### FIXED CODE ###

L,R,d = map(int, input().split())
X = L//d
Y = R//d
if L%d == 0 and R%d == 0:
  if L>R:
    print(X-Y+1)
  else:
    print(Y-X+1)
else:
  if L >R:
    print(X-Y)
  else:
    print(Y-X)
from collections import deque
n = int(input())
l = deque()
count = set([])
for _ in range (n):
    cmd = input().split(' ')
    if cmd[0]=='insert':
        l.appendleft(int(cmd[1]))
        if not int(cmd[1]) in count:
            count.add(int(cmd[1]))
    if cmd[0]=='delete':
        if len(l) !=0 and int(cmd[1]) in count:
            l.remove(int(cmd[1]))
            count.remove(int(cmd[1]))
    if cmd[0]=='deleteFirst':
        count.remove(l.popleft())
    if cmd[0]=='deleteLast':
        count.remove(l.pop())
print(*l)


### FIXED CODE ###

from collections import deque
n = int(input())
l = deque()
for _ in range (n):
    cmd = input().split(' ')
    if cmd[0]=='insert':
        l.appendleft(cmd[1])  
    if cmd[0]=='delete':
        try:l.remove(cmd[1])
        except :pass
    if cmd[0]=='deleteFirst':
        l.popleft()
    if cmd[0]=='deleteLast':
        l.pop()
print(*l)
s = input()
count = 0
if 'RRR' in s:
  print(3)
elif 'RR' in s:
  print(2)
elif 'SSR' in s or 'SRS' in s or 'RSS' in sor 'RSR' in s:
  print(1)
else:
  print(0)

### FIXED CODE ###

s = input()
count = 0
if 'RRR' in s:
  print(3)
elif 'RR' in s:
  print(2)
elif 'SSR' in s or 'SRS' in s or 'RSS' in s or 'RSR' in s:
  print(1)
else:
  print(0)
a,b,c,d=map(int,input().split())
print(min([a,b]) + min([c,d]))

### FIXED CODE ###

a=int(input())
b=int(input())
c=int(input())
d=int(input())
print(min([a,b]) + min([c,d]))
def solve(string):
    ins = string.split("\n")
    h, w = map(int, ins[0].split(" "))
    a = [list(map(lambda x: int(x) % 2, _i.split(" "))) for _i in ins[1:]]
    move = []
    for j in range(h):
        for i in range(w):
            a[j][i] -= 1
            if i < w - 1:
                a[j][i + 1] += 1
                move.append("{} {} {} {}".format(j + 1, i + 1, j + 1, i + 2))
            elif j < h - 1:
                a[j + 1][i] += 1
                move.append("{} {} {} {}".format(j + 1, i + 1, j + 2, i + 1))
    return "{}\n{}".format(len(move), "\n".join(move))


if __name__ == '__main__':
    line = input()
    tmp = [line]
    for _ in range(int(line[0])):
        tmp.append(input())
    print(solve('\n'.join(tmp)))


### FIXED CODE ###

h,w = map(int,input().split())
a = []
for i in range(h):
    tmp = list(map(lambda x:int(x)%2,input().split()))
    a.append(tmp)
result = []
 
for i in range(h):
    for j in range(w-1):
        if a[i][j] == 1:
            #a[i][j] == 0
            a[i][j+1] = 1 ^ a[i][j+1]
            result.append((i+1,j+1,i+1,j+2)) 
for i in range(h-1):
    if a[i][w-1] == 1:
        a[i+1][w-1] = 1 ^ a[i+1][w-1]
        result.append((i+1,w,i+2,w))
print(len(result))
for row in result:
    print("{} {} {} {}".format(row[0],row[1],row[2],row[3]))
a,b,c,d=[int(i)for i in input().split()]
print(max(a*b,c*d)

### FIXED CODE ###

a,b,c,d=[int(i)for i in input().split()]
print(max(a*b,c*d))
import math

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

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

print(lcm(a,b))

### FIXED CODE ###

import fractions

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

def lcm(x,y):
    z = int(x*y/fractions.gcd(x,y))
    return z
    
print(lcm(a,b))
dfsfd

### FIXED CODE ###

a, b = input().split()

print(b+a)
i = [int(input()) for i in range(5)]
i2 = [i2 for i2 in i if i2%10 != 0]
min=i2[len(i2)-1]
count = 0
for x in i:
    if 0 < x % 10 < min % 10:
        min = x
        count += 1
i.remove(min)

for x in i:
    if x % 10 != 0:
        index = i.index(x)
        x += 10 - x % 10
        i[index] = x

i.append(min)

print(sum(i))


### FIXED CODE ###

i = [int(input()) for i in range(5)]
i2 = [i2 for i2 in i if i2%10 != 0]

if not i2:
    min = i[len(i)-1]

else:
    min = i2[len(i2)-1]

count = 0
for x in i:
    if 0 < x % 10 < min % 10:
        min = x
        count += 1
i.remove(min)

for x in i:
    if x % 10 != 0:
        index = i.index(x)
        x += 10 - x % 10
        i[index] = x

i.append(min)

print(sum(i))
def solve(nu,mu,du):
    E = []
    vs = [False]*nu
    vs[0] = True

    while True:
        if all(vs):
            break
        min_dist,ind = float("inf"),float("inf")
        for i in xrange(len(du)):
            p_from = du[i][0]
            p_to = du[i][1]
            if vs[p_from] and vs[p_to]:
                du.pop(i)
                continue
            if ( vs[p_from] and not vs[p_to] ) or ( not vs[p_from] and vs[p_to]):
                if min_dist > du[i][2]:
                    min_dist,ind,pf,pt = du[i][2],i,p_from,p_to
        E.append(min_dist)
        vs[pf] = vs[pt] = True
        du.pop(ind)
    print sum(E)/100 - len(E)

while True:
    n = input()
    if n == 0:
        exit()
    m = input()
    data = []
    for i in xrange(m):
        data.append( map(int,raw_input().split(",")) )
    solve(n,m,data)

### FIXED CODE ###

def solve(nu,mu,du):
    E = []
    vs = [False]*nu
    vs[0] = True

    while True:
        min_dist,ind = float("inf"),float("inf")
        for i in xrange(len(du)):
            if ( ( vs[du[i][0]] and not vs[du[i][1]] ) or ( not vs[du[i][0]] and vs[du[i][1]]) ) and min_dist > du[i][2]:
                min_dist,ind,pf,pt = du[i][2],i,du[i][0],du[i][1]
        E.append(min_dist)
        vs[pf] = vs[pt] = True
        du.pop(ind)
        if all(vs):
            break

        for i in xrange(len(du)):
            try:
                if vs[du[i][0]] and vs[du[i][1]]:
                    du.pop(i)
            except:
                pass

    print sum(E)/100 - len(E)

while True:
    n = input()
    if n == 0:
        exit()
    m = input()
    data = []
    for i in xrange(m):
        data.append( map(int,raw_input().split(",")) )
    solve(n,m,data)
N = int(input())

if N % 2 != 0:
    print('0')
else:
    count = 0
    i = 1
    while True:
        dif = (N // 2) // (5 ** i)
        count += dif
        if dif == 0:
            break

        i += 1

print(count)


### FIXED CODE ###

N = int(input())

if N % 2 != 0:
    print('0')
else:
    count = 0
    i = 1

    while True:
        dif = (N // 2) // (5 ** i)
        count += dif
        if dif == 0:
            break

        i += 1

    print(count)
s=input().strip()
x,y=map(int,input().split())
sl=[len(i) for i in s.split('T')]
x0,y0=sl[0],0

answers={}
def search(xx,yy,k,isUD):
    if (xx,yy,k) in answers:
        return answers[(xx,yy,k)]
    if k == len(sl):
        ans=(xx,yy)==(x,y)
    else:
        lng=sl[k]
        # D or L
        llr=(lng if not isUD else 0)
        lud=(lng if isUD else 0)
        d_l = search(xx-llr,yy-lud,k+1, not isUD)
        u_r = search(xx+llr,yy+lud,k+1, not isUD)
        ans = d_l or u_r
    answers[(xx,yy,k)]=ans
    return ans
print('Yes' if search(x0,y0,1,True) else 'No')

### FIXED CODE ###

import sys
sys.setrecursionlimit(100000)
s=input().strip()
x,y=map(int,input().split())
sl=[len(i) for i in s.split('T')]
x0,y0=sl[0],0
s_x = sl[::2]
s_y = sl[1::2]
s_y=[0]+s_y
dpx=[set() for i in s_x]
dpy=[set() for i in s_y]
dpx[0].add(s_x[0])
dpy[0].add(0)
for i,l in enumerate(s_x):
    if i==0:continue
    ll=dpx[i]
    for xx in dpx[i-1]:
        ll.add(xx-l)
        ll.add(xx+l)
for i,l in enumerate(s_y):
    if i==0:continue
    ll=dpy[i]
    for yy in dpy[i-1]:
        ll.add(yy-l)
        ll.add(yy+l)
print('Yes' if x in dpx[-1] and y in dpy[-1] else 'No')
S = str(input)
alpha = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']

al = []

n = len(S)
n2 = 0

for i in range(n):
	if S[n2] in alpha:
		al.append(S[n2])
	n2 += 1

m = len(al)
n2 = 0

for j in range(m):
	numi = alpha.index(al[n2])
	del alpha[numi]
	n2 += 1

if len(alpha) == 0:
	print('None')
else:
	print(alpha[0])

### FIXED CODE ###

S = str(input())
alpha = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']

n = 0

for i in range(26):

	if alpha[n] not in S:
		print(alpha[n])
		break
	if n == 25:
		print("None")
		break
		
	n += 1
def read_int():
    return int(input())

def read_ints():
    return map(int, input().split())

def read_lines(N):
    return [input() for i in range(N)]

def main():
    N, K = read_ints()
    towns = [int(input()) - 1 for i in range(N)]
    portals = {i: towns[i] for i in towns}

    loop = []
    next_town = 0
    while next_town not in loop:
        loop.append(next_town)
        next_town = portals[next_town]
    loop.append(next_town)

    i = loop.index(next_town)
    all_loop = loop
    pre_loop, loop = loop[:i], loop[i:]

    if K < len(pre_loop):
        print(pre_loop[K] + 1)
    elif len(pre_loop) <= K < len(all_loop):
        print(loop[K - len(pre_loop)] + 1)
    else:
        print(loop[(K - len(pre_loop)) % len(loop)] + 1)
        



if __name__ == '__main__':
    main()

### FIXED CODE ###

def read_int():
    return int(input())

def read_ints():
    return map(int, input().split())

def read_lines(N):
    return [input() for i in range(N)]

def main():
    N, K = read_ints()
    towns = [int(t) -1  for t in input().split() ]
    #print(N, K , towns)

    loop = []
    loop_set = set()
    next_town = towns[0]
    while next_town not in loop_set:
        #print(f"next_t={next_town}")
        loop.append(next_town)
        loop_set.add(next_town)
        next_town = towns[next_town]

    i = loop.index(next_town)
    all_loop = loop
    pre_loop = loop[:i]
    loop = loop[i:]
    pre_length = len(pre_loop)
    loop_length = len(loop)

    """
    for k in range(1, 10):
        if k - 1  < len(all_loop):
            print(f"k={k}", all_loop[k-1] + 1)
        else:
            i = ((k -1 - len(pre_loop)) % loop_length)
            print(i, pre_loop, loop)
            print(f"k={k}", loop[i]+1)
    """

    #print(pre_loop, loop)
    if K - 1  < len(all_loop):
        print(all_loop[K-1] + 1)
    else:
        i = ((K -1 - pre_length) % loop_length)
        #print(i, pre_loop, loop)
        print(loop[i]+1)

if __name__ == '__main__':
    main()
n = int(input())
s = input()
count = 0
for i in range(n):
  if s[i] == "A" and s[i+1] == "B" and s[i+2] =="C":
    count += 1
print(count)

### FIXED CODE ###

n = int(input())
s = input()
count = 0
for i in range(len(list(s))-2):
  if s[i] == "A" and s[i+1] == "B" and s[i+2] =="C":
    count += 1
print(count)
n = int(input())

print(a + a*a + a*a*a)

### FIXED CODE ###

a = int(input())

print(a + a*a + a*a*a)
N,K=map(int,input().split())
S=[0]*N
for _ in[0]*K:
 a,b=map(int,input().split())
 S[a-1]=b
dp=[0]*9
st,nd=S[:2]
if st:
 if nd:dp[~-st*3+~-nd]=1
 else:dp[~-st*3:st*3]=[1]*3
elif nd:dp[~-st::3]=[1]*3
else:dp=[1]*9
for i in range(2,N):
 cur=S[i];tmp=[0]*9
 if cur:
  cur-=1
  for k in range(3):tmp[k*3+cur]=sum(dp[k::3])-dp[cur*4]*(k==cur)
 else:
  for cur in range(3):
   for k in range(3):tmp[k*3+cur]=sum(dp[k::3])-dp[cur*4]*(k==cur)
 dp=tmp[:]
print(sum(dp)%10000)


### FIXED CODE ###

N,K=map(int,input().split())
S=[0]*N
for _ in[0]*K:a,b=map(int,input().split());S[a-1]=b
dp=[0]*9
st,nd=S[:2]
if st:
 if nd:dp[st*2+~-nd]=1
 else:dp[st*2:st*3]=[1]*3
elif nd:dp[~-nd::3]=[1]*3
else:dp=[1]*9
for i in range(2,N):
 cur=S[i]-1;tmp=[0]*9
 if cur+1:
  for k in range(3):tmp[k*3+cur]=sum(dp[k::3])-dp[cur*4]*(k==cur)
 else:
  for cur in range(3):
   for k in range(3):tmp[k*3+cur]=sum(dp[k::3])-dp[cur*4]*(k==cur)
 dp=tmp[:]
print(sum(dp)%10000)
k = [int(i) for i in input().split()]
x = [int(i) for i in input().split()]
y = [int(i) for i in input().split()]
z = [int(i) for i in input().split()]

x.sort(reverse=True)
y.sort(reverse=True)
z.sort(reverse=True)

for i in len(x)
  for j in len(y)
    for l in len(z)
      if x*y*z =< k[3]:
        SUM.append(x[i+1]+y[j+1]+z[l+1])
      else:
        break

SUM.sort(reverse=True)

for i in range(k[3])
  print(SUM[i])


### FIXED CODE ###

X,Y,Z,K=map(int,input().split())
A=[int(i) for i in input().split()]
B=[int(i) for i in input().split()]
C=[int(i) for i in input().split()]
A.sort(reverse=True)
B.sort(reverse=True)
C.sort(reverse=True)
SUM=[]
for i in range(X):
  for j in range(Y):
    for k in range(Z):
      if (i+1)*(j+1)*(k+1)<=K:
        SUM.append(A[i]+B[j]+C[k])
      else:
        break
SUM.sort(reverse=True)
for i in range(K):
  print(SUM[i])
A , B = map(int , input().split())

plug = 1
tap = 0

for i in range():
    if plug >= B:
        break
    else:
        prug += A - 1
        tap += 1

print(tap)

### FIXED CODE ###

S = input()
T = input()

result = 0
for i in range(0,3):
    if S[i] == T[i]:
        result += 1

print (result)
r, D, x0 = list(map(int, input().split()))
for i in range(10):
  x1 = r * x - D
  x = x1
  print(x1)

### FIXED CODE ###

r, D, x0 = list(map(int, input().split()))
for i in range(10):
  x1 = r * x0 - D
  x0 = x1
  print(x1)
n, p = map(int, input().split())

a = list(input())

for i in a:
    if i % 2 == 1:
        print(2 ** (n - 1))
        exit(0)

if p == 0:
    print(2 ** n)

else:
    print(0)


### FIXED CODE ###

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

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

#print(a)

for i in a:
    if i % 2 == 1:
        print(2 ** (n - 1))
        exit(0)

if p == 0:
    print(2 ** n)

else:
    print(0)
H, N = input().split()
lis = list(map(int, input().split()))
if sum(lis) >= H:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

H, N = map(int, input().split())
lis = list(map(int, input().split()))
if sum(lis) >= H:
  print("Yes")
else:
  print("No")
import math
n = int(input())
l = [0 for i in range(n)]
p = min(101,math.sqrt(n)+1)
for x in range(1, p):
    for y in range(1, p):
        for z in range(1, p):
            s = x**2 + y**2 + z**2 + x*y + y*z + z*x;
            if s <= n:
                l[s-1] += 1
for i in range(n):
    print(l[i])


### FIXED CODE ###

#import math
n = int(input())
l = [0 for i in range(n)]
for x in range(1, 101):
    for y in range(1, 101):
        for z in range(1, 101):
            s = x**2 + y**2 + z**2 + x*y + y*z + z*x;
            if s <= n:
                l[s-1] += 1
for i in range(n):
    print(l[i])
answer=0
count=0

for i in range(1,int(N**0.5)+1):
    if N%i==0:
        count+=1
if count==4:
    answer+=1

print(answer)

### FIXED CODE ###

N = int(input())

answer=0
count=0
 
for i in range(1,N+1,2):
    for j in range(1,int(i**0.5)+1):
        if i%j==0:
            count+=1
    if count==4:
        answer+=1
    count=0
 
print(answer)
a = input()
if a[2]=="0" or a[2]=="1" or a[2]=="6" or a[2]=="8":
  print("pon")
elif a[2]=="3":
  print("bon")
else:
  print("hon")

### FIXED CODE ###

a = int(input())
a %= 10

if a==0 or a==1 or a==6 or a==8:
  print("pon")
elif a==3:
  print("bon")
else:
  print("hon")
import math
def ggcd(a):
    if len(a)==0:
        return 0
    i=0
    return math.gcd(a[i],ggcd(a[i+1:]))
n,x=map(int,input().split())
a=list(map(int,input().split()))
b=[]
for i in range(n-1):
    b.append(abs(a[i]-a[i+1]))
c=ggcd(b)
d=abs(x-a[0])
print(math.gcd(c,d))

### FIXED CODE ###

n,x=map(int,input().split())
a=list(map(int,input().split()))
b=[]
if n==1 and x==a[0]:
    print(max(x,10**9-x))
    exit()
for i in range(n):
    b.append(abs(a[i]-x))
import math
c=0
for i in range(n):
    c=math.gcd(c,b[i])
    if c==1:
        break
print(c)
input_data = [int(i) for i in input().split(" ")]

ans = 0
for k1, v1 in enumerate(input_data):
    for k2, v2 in enumerate(input_data):
        for k3, v3 in enumerate(input_data):
            if k1 == k2 or k2 == k3 or k3 == k1:
                continue
            kou1 = int(f"{v1}{v2}")
            if ans < kou1 + v3:
                ans = kou1 + v3
print(ans)


### FIXED CODE ###

input_data = [int(i) for i in input().split(" ")]

ans = 0
for k1, v1 in enumerate(input_data):
    for k2, v2 in enumerate(input_data):
        for k3, v3 in enumerate(input_data):
            if k1 == k2 or k2 == k3 or k3 == k1:
                continue
            kou1 = int(str(v1) + str(v2))
            kou2 = v3
            if ans < kou1 + kou2:
                ans = kou1 + v3
print(ans)
N, A = map(int,input().split())
t=N^2-A
print(t)

### FIXED CODE ###

N = int(input())
A = int(input())
t=N**2-A
print(t)
#!/usr/bin/env python3
import math

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

ans = 1
for i in range(N):
    ans = ans * T[i] // math.gcd(ans, T[i])
print(ans)

### FIXED CODE ###

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

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

ans = 1
for t in T:
    ans = ans * t // gcd(ans,t)

print(ans)
S = input()
T = input()

U = set()
for s, t in sorted(zip(S, T)):
  U.add((s, t))

for x, y in zip(U[0:-1], U[1:]):
  if x == y:
    print("No")
    break
else:
  print("Yes")

  



### FIXED CODE ###

S = input()
T = input()
TS = list(zip(T, S))

TS_set = set()
for t,s in TS:
  TS_set.add((t,s))

S_set = set()
for x in TS_set:
  S_set.add(x[1])

T_set = set()
for x in TS_set:
  T_set.add(x[0])

print("Yes" if S == T or len(TS_set) == len(S_set) == len(T_set) else "No")
N = int(input())
X = input()
S = []
for a in range(N):
    S.append(X[a])
if N == 1:
    print(S)
else:
    
    for i in range(N-1):
        if S[i] != S[i+1] or S[i] == 'X':
            continue
        else:
            j = i+1
        while S[i] == S[j]:
            j += 1
            for l in range(i+1,j):
                S[l] = X
lista = [k for k in S if k != X]
print(''.join(lista))

### FIXED CODE ###

N = int(input())
X = input()
S = []
for a in range(N):
    S.append(X[a])

if N == 1:
    print(1)
else:
    for i in range(1,N):
        if S[i] != S[i-1]:
            continue
        else:
            S[i-1] = 'X'
    lista = [k for k in S if k != 'X']
    print(len(lista))
import math

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

if c%g == 0:
  print('YES')
else:
  print('NO')


### FIXED CODE ###

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

a,b,c = map(int,input().split())
g = gcd(a,b)
answer = 'YES' if c%g == 0 else 'NO'
print(answer)
n, q = map(int, input().split())
g=[[] for _ in range(n)]
for i in range(n-1):
    a, b = map(int, input().split())
    g[a-1].append(b-1)
    g[b - 1].append(a - 1)

costs = [0]*n
for i in range(q):
    p, x = map(int, input().split())
    costs[p-1]+=x
visited = [0]*n

def dfs(idx):
    visited[idx]=1
    for i in g[idx]:
        if visited[i]==1:
            continue
        costs[i]+=costs[idx]
        dfs(i)
    return

dfs(0)
print(*costs)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)

#def input():
#  return sys.stdin.readline()[:-1]

n,q=map(int,input().split())
cnt=[0]*(n)
g=[[] for _ in range(n)]
for _ in range(n-1): #木グラフの隣接リストを作成
  a,b=map(int,input().split())
  g[a-1].append(b-1)
  g[b-1].append(a-1)
for _ in range(q):
    a , b = map(int,input().split())
    a = a - 1
    cnt[a] += b

def dfs(now,prev=-1):
  for next in g[now]:
    if next==prev:
      continue
      
    cnt[next]+=cnt[now]
    dfs(next,now)
dfs(0)
print(*cnt)
import math

N = int(input())
li = [list(map(int,input().split())) for i in range(N)]
ans = []
for i in range(N):
    for j in range(N):
        d = (li[i][0] - li[j][0])**2 + (li[i][1]-li[j][1])**2
        d = math.sqrt(d)
        ans.append(d)
print(sum(ans)/N)



### FIXED CODE ###

r = int(input())
print(r**2//1)
import numpy as np

s = input()

dp = np.zeros((100100,13))

s = list(reversed(s))

dp[0][0]=1
ten = 1
mod = 1000000007

length = len(s)

for i in range(length):
	if s[i] == '?':
		for num in range(10):
			for j in range(13):
				dp[i+1][(j+num*ten)%13] += dp[i][j]
				dp[i+1][(j+num*ten)%13] %= mod
	else:
		num = int(s[i])
		for j in range(13):
			dp[i+1][(j+num*ten)%13] += dp[i][j]
			dp[i+1][(j+num*ten)%13] %= mod
	ten *= 10
	ten %= 13

print(int(dp[length][5]%mod))

### FIXED CODE ###

from sys import stdin
s = stdin.readline()[:-1]

length = len(s)

dp = [[0 for i in range(13)]for j in range(100100)]

s = list(reversed(s))

dp[0][0]=1
ten = 1
mod = 1000000007


for i in range(length):
	if s[i] == '?':
		for num in range(10):
			d = num*ten
			for j in range(13):
				k = (j+d)%13
				dp[i+1][k] += dp[i][j]
				dp[i+1][k] %= mod
	else:
		num = int(s[i])
		d = num*ten
		for j in range(13):
			k = (j+d)%13
			dp[i+1][k] += dp[i][j]
			dp[i+1][k] %= mod
	ten *= 10
	ten %= 13

print(int(dp[length][5]%mod))