Harryxun/stf_run huggingface dataset:
from operator import mul
from functools import reduce


def cmb(n, r):
	r = min(n - r, r)
	if r == 0:
		return 1
	numer = reduce(mul, range(n, n - r, -1))
	denom = reduce(mul, range(1, r + 1))
	return numer // denom % INF


N, K = map(int, input().split())
INF = 10 ** 9 + 7

for i in range(1, K + 1):
	print(cmb(K - 1, i - 1) * cmb(N - K + 1, i) % INF)


### FIXED CODE ###

from operator import mul
from functools import reduce


def cmb(n, r):
	r = min(n - r, r)
	if r == 0:
		return 1
	numer = reduce(mul, range(n, n - r, -1))
	denom = reduce(mul, range(1, r + 1))
	return numer // denom % INF


N, K = map(int, input().split())
INF = 10 ** 9 + 7

for i in range(1, K + 1):
	if N - K + 1 >= i:
		print(cmb(K - 1, i - 1) * cmb(N - K + 1, i) % INF)
	else:
		print(0)
N=int(input())
a=map(int,input().split())

ans=0
for i in range(0,N+1,2):
    print(a[i])
    if a[i]%2!=0:
        ans+=1
        
print(ans)

### FIXED CODE ###

N=int(input())
a=list(map(int,input().split()))
 
ans=0
for i in range(0,N,2):
    if a[i]%2!=0:
        ans+=1
        
print(ans)
if K%2 == 0:
    ans = A - B 
else:
    ans = B - A
print(ans)

### FIXED CODE ###

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

if K%2 == 0:
    ans = A - B 
else:
    ans = B - A
print(ans)
from sys import stdin
from math import gcd
input = stdin.readline
lmi = lambda: list(map(int, input().split()))
mi = lambda: map(int, input().split())
si = lambda: input().strip('\n')
ssi = lambda: input().strip('\n').split()

n = int(input())
arr = lmi()
for i in range(1, n):
    arr[i] = gcd(arr[i], arr[i-1])
print(arr[n-1])

### FIXED CODE ###

from sys import stdin
input = stdin.readline
lmi = lambda: list(map(int, input().split()))
mi = lambda: map(int, input().split())
si = lambda: input().strip('\n')
ssi = lambda: input().strip('\n').split()


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


n = int(input())
arr = lmi()
for i in range(1, n):
    arr[i] = gcd(arr[i], arr[i-1])
print(arr[n-1])
R = input()
answer = R * 2 / 3.14
print(answer)

### FIXED CODE ###

import math

def main():
  R = input()
  answer = float(R) * 2 * math.pi  
  print(answer)
  
if __name__ == '__main__':
  main()
n, k, x, y = map(int(input()) for i in range(4))
if k <= n:
  print(k*x)
else:
  print(k*x + (n-k)*y)

### FIXED CODE ###

n, k, x, y = (int(input()) for i in range(4))
if k >= n:
  print(n*x)
else:
  print(k*x + (n-k)*y)
H, W, M = (int(i) for i in input().split())

hw = [0] * (H * W)
hh = [0] * H
ww = [0] * W

for i in range(M):
    ht , wt = (int(i) for i in input().split())
    hw[(ht-1) * W + wt - 1] = 1
    hh[ht-1] += 1
    ww[wt-1] += 1

hhh = max(hh)
ih = [i for i, x in enumerate(hh) if x == hhh]

www = max(ww)
iw = [i for i, x in enumerate(ww) if x == www]

minus = 1
for iih in ih:
    for iiw in iw:
        if hw[iih * W + iiw] == 0:
            minus = 0


print(hhh + www - minus)




### FIXED CODE ###

H, W, M = (int(i) for i in input().split())

hw = set()
hh = [0] * H
ww = [0] * W

for i in range(M):
    ht , wt = (int(i) for i in input().split())
    hw.add((ht-1) * W + wt - 1)
    hh[ht-1] += 1
    ww[wt-1] += 1

hhh = max(hh)
ih = [i for i, x in enumerate(hh) if x == hhh]

www = max(ww)
iw = [i for i, x in enumerate(ww) if x == www]

minus = 1
for iih in ih:
    for iiw in iw:
        if iih * W + iiw not in hw:
            minus = 0
            break

print(hhh + www - minus)
while 1:
  x,y = map(int,input().split())
  if x==0 and y==0:
    break
  else:
    n=[x,y]
    n.sort()
    print n
 

### FIXED CODE ###

while 1:
  x,y = map(int,raw_input().split())
  if x==0 and y==0:
    break
  else:
    n=[x,y]
    n.sort()
    print n[0],n[1]
def gcd(a, b):
	if(a > b):
		a -= b
		return gcd(a, b)
	elif(a < b):
		b -= a
		return gcd(a, b)
	else:
		return a

import numpy as np
#import math
n, x = map(int, input().split())
buf = input().split()
X = np.abs(np.array([int(buf[i]) for i in range(n)]) - x)
#print(X)
if(X.shape[0] == 1):
	r = X[0]
else:
	r = gcd(X[0], X[1])
	for i in range(n-2):
		r = gcd(r, X[i+2])
print(r)

### FIXED CODE ###

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

import numpy as np
n, x = map(int, input().split())
a = np.abs(np.array(list(map(int, input().split())))-x)

if(a.shape[0] == 1):
	r = a[0]
else:
	r = gcd(a[0], a[1])
	for i in range(n-2):
		r = gcd(r, a[i+2])
print(r)
print(48-{})

### FIXED CODE ###

n =int(input())
print(48-n)
def main():
  N = int(input())
  A = [int(a) for a in input().split(" ")]
  minA = min(A)
  maxA = max(A)
  X = [A.count(i) for i in range(minA, maxA + 1)]
  if len(X) == 1:
    print(X[0])
    return 0
  if len(X) == 2:
    print(X[0] + X[1])
    
  Y = [X[j] + X[j+1] + X[j+2] for j in range(len(X) - 2)]
  print(max(Y))

main()

### FIXED CODE ###

import collections

def main():
  N = int(input())
  A = [int(a) for a in input().split(" ")]
  CA = collections.Counter(A)
  minA = min(A)
  maxA = max(A)
  X = [CA[i] for i in range(minA, maxA + 1)]
  if len(X) == 1:
    print(X[0])
    return 0
  if len(X) == 2:
    print(X[0] + X[1])
    return 0
    
  Y = [X[j] + X[j+1] + X[j+2] for j in range(len(X) - 2)]
  print(max(Y))

main()
s = int(input())
w = input()
S = ''
for i in range(0,len(w),s):
  S = S+w[i]
print(S)

### FIXED CODE ###

w = input()
s = int(input())
S = ''
for i in range(0,len(w),s):
  S = S+w[i]
print(S)
N = int(input())
B = list(map(int,input().split()))
A = []
for i in range(N):
  A.append(0)

for i in range(N):
  if i = 0:
    A[i] = B[i]
  else:
    A[i] = min(B[i], B[i - 1])
    
print(A)

### FIXED CODE ###

N = int(input())
B = list(map(int, input().split()))
ans = B[0]
for i in range(1, N-1):
    ans += min(B[i - 1], B[i])
ans += B[-1]
print(ans)
= 1000001

spf = [*range(N)]
i = 2
while i * i < N:
  if spf[i] == i:
    for j in range(i * i, N, i):
      if spf[j] == j:
        spf[j] = i
  i += 1
  
t = 'setwise', None, 'pairwise', 'not'
r = 0
input()
u = set()
i = None
for x in map(int, input().split()):
  s = set()
  while x > 1:
    p = spf[x]
    if p in u:
      r |= 1
    s.add(p)
    x //= p
  u |= s
  if i: i &= s
  else: i = s
if not i:
  r |= 2
print(t[r], 'coprime')


### FIXED CODE ###

N = 1000001
 
spf = [*range(N)]
i = 2
while i * i < N:
  if spf[i] == i:
    for j in range(i * i, N, i):
      if spf[j] == j:
        spf[j] = i
  i += 1
  
r = 'pairwise'
n = int(input())
a = [int(x) for x in input().split() if x > '1']
if len(a) > 1:
  u = set()
  i = None
  for x in a:
    s = set()
    while x > 1:
      p = spf[x]
      if p in u:
        r = 'setwise'
      s.add(p)
      x //= p
    u |= s
    if len(a) == n:
      if i is None: i = s
      else: i &= s
  if i:
    r = 'not'
print(r, 'coprime')
#c
n,m,x=map(int, input().split())
sp = [list(map(int, input().split())) for _ in range(m)]

import copy
result = []
def test(i,i_sum,cost):
    
    flag = 0
    if i <= n:
        for j in range(m):
            if i_sum[j] < x:
                flag = 1
                break

        if flag == 1:
                test(copy.deepcopy(i)+1, i_sum[:],cost)#参考書を使わない場合

                for j in range(1,m+1):#参考書を使う場合
                    i_sum[j-1] += sp[i-1][j]
                cost[0] +=  sp[i-1][0]
                test(copy.deepcopy(i)+1, i_sum[:],cost)
        else:
            result.append(cost[0])
test(0,[0]*n,[0])

if result != []:
    print(min(result))
else:
    print(-1)

### FIXED CODE ###

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

import copy
result = []
def test(i,i_sum,cost):
    
    flag = 0
    if i <= n:
        for j in range(m):
            if i_sum[j] < x:
                flag = 1
                break

        if flag == 1:
                test(copy.deepcopy(i)+1, i_sum[:],cost[:])#参考書を使わない場合

                for j in range(1,m+1):#参考書を使う場合
                    i_sum[j-1] += sp[i-1][j]
                cost[0] += sp[i-1][0]
                test(copy.deepcopy(i)+1, i_sum[:],cost[:])
        else:
            result.append(cost[0])
test(0,[0]*m,[0])

if result != []:
    print(min(result))
else:
    print(-1)
A,B,K=map(int,input().split())
num=list(range(A,B+1))
if len(num)+1-K>=0:
    ans_list=num[:K]+num[len(num)-K+1:]
else:
    ans_list=num[:K]
for i in range(len(ans_list)):
    print(ans_list[i])

### FIXED CODE ###

A,B,K=map(int,input().split())
if B-A+1-2*K>=0:
    for i in range(A,A+K):
        print(i)
    for i in range(B-K+1,B+1):
        print(i)
else:
    for i in range(A,B+1):
        print(i)
import queue,sys,copy
sys.setrecursionlimit(10**7)
INF = 10**10
N = int(input())
x = [0 for _ in range(N)]
y = [0 for _ in range(N)]
for i in range(N):
    x[i], y[i] = map(int,input().split())
ix = [i for i in range(N)]
sort_x_ix = sorted(ix, key=lambda i:x[i])
sort_x = [x[i] for i in sort_x_ix]
sort_y_ix = sorted(ix, key=lambda i:y[i])
sort_y = [y[i] for i in sort_y_ix]

g = [i for i in range(N+1)]
def root(x):
    if g[x] == x : return x
    g[x] = root(g[x])
    return g[x]
q = []
for i in range(N-1):
    q.append((sort_x[i+1]-sort_x[i],sort_x_ix[i],sort_x_ix[i+1]))
    q.append((sort_y[i+1]-sort_y[i],sort_y_ix[i],sort_y_ix[i+1]))

q.sort()
ans = 0
cnt = N

for d,s,t in q:
    if cnt <= 1: break
    if root(s) != root(t):
        ans += d
        cnt -= 1
        root(g[t]) = g[s]
print(ans)

### FIXED CODE ###

import sys,queue,math,copy,itertools,bisect,collections,heapq

def main():
    LI = lambda : [int(x) for x in sys.stdin.readline().split()]
    NI = lambda : int(sys.stdin.readline())

    N = NI()
    xy = [LI() for _ in range(N)]

    x = [(xy[i][0],i) for i in range(N)]
    y = [(xy[i][1],i) for i in range(N)]

    x.sort()
    y.sort()

    edge = []
    p,i = x[0]
    for q,j in x[1:]:
        edge.append((q-p,i,j))
        p,i = q,j

    p,i = y[0]
    for q,j in y[1:]:
        edge.append((q-p,i,j))
        p,i = q,j

    edge.sort()

    g = [i for i in range(N + 1)]
    g_num = [1 for i in range(N + 1)]

    def find(x):
        if g[x] == x: return x
        g[x] = find(g[x])
        return g[x]

    def union(x, y):
        if find(x) == find(y): return
        if g_num[g[x]] < g_num[g[y]]: x, y = y, x
        g_num[g[x]] += g_num[g[y]]
        g_num[g[y]] = 0
        g[g[y]] = g[x]

    ans = 0
    for v,i,j in edge:
        if find(i) != find(j):
            ans += v
            union(i,j)

    print(ans)



if __name__ == '__main__':
    main()
s = input()
t = input()
count = 0
for i in range(26):
    start[i] = -1
    goal[i] = -1
for i in range(0,len(s)):
    a = s[i]
    b = t[i]
    if start[a] != -1 or goal[b] != -1:
        if start[a] != b or goal[b] != a:
            count = 1
            break
    else:
        start[a] = b
        goal[b] = a
if count == 1:
    print("No")
else:
    print("Yes")

### FIXED CODE ###

s = input()
t = input()
start = [-1]*30
goal = [-1]*30
count = 0
for i in range(0,len(s)):
    a = ord(s[i])-ord("a")
    b = ord(t[i])-ord("a")
    if start[a] != -1 or goal[b] != -1:
        if start[a] != b or goal[b] != a:
            count = 1
            break
    else:
        start[a] = b
        goal[b] = a
if count == 1:
    print("No")
elif count == 0:
    print("Yes")
n, m = map(int, input().split())
q_re = set()
ac = 0
wa = 0
dic_wa = {}
for i in range(m):
    q, re = input().split()
    if(re == "WA" and q not in q_re): 
        if(q not in dic_wa): dic_wa[q] = 1
        else: dic_wa[q] += 1
    if(re == "AC" and q not in q_re): 
        ac += 1
        q_re.add(q)
        wa += dic_wa[q]
print(ac, wa)

### FIXED CODE ###

n, m = map(int, input().split())
q_re = set()
ac = 0
wa = 0
dic_wa = {}
for i in range(m):
    q, re = input().split()
    if(re == "WA" and q not in q_re): 
        if(q not in dic_wa): dic_wa[q] = 1
        else: dic_wa[q] += 1
    if(re == "AC" and q not in q_re): 
        ac += 1
        q_re.add(q)
        if(q in dic_wa): wa += dic_wa[q]
print(ac, wa)
h,w=map(int,input().split())
l=[list(input()) for i in range(h)]
for x in range(h):
 for y in range(w):
  if l[x][y]=='.':
   c=0
   if x>0 and y>0:
    if l[x-1][y-1]=='#':c+=1
   if x>0:
    if l[x-1][y]=='#':c+=1
   if x>0 and y+1<h:
    if l[x-1][y+1]=='#':c+=1
   if y>0:
    if l[x][y-1]=='#':c+=1
   if y+1<h:
    if l[x][y+1]=='#':c+=1
   if x+1<h and y>0:
    if l[x+1][y-1]=='#':c+=1
   if x+1<h:
    if l[x+1][y]=='#':c+=1
   if x+1<h and y+1<h:
    if l[x+1][y+1]=='#':c+=1
   l[x][y]=str(c)
for j in range(h):
  l[j]=''.join(l[j])
  print(l[j])

### FIXED CODE ###

h,w=map(int,input().split())
l=[list(input()) for i in range(h)]
for x in range(h):
 for y in range(w):
  if l[x][y]=='.':
   c=0
   if x>0 and y>0:
    if l[x-1][y-1]=='#':c+=1
   if x>0:
    if l[x-1][y]=='#':c+=1
   if x>0 and y+1<w:
    if l[x-1][y+1]=='#':c+=1
   if y>0:
    if l[x][y-1]=='#':c+=1
   if y+1<w:
    if l[x][y+1]=='#':c+=1
   if x+1<h and y>0:
    if l[x+1][y-1]=='#':c+=1
   if x+1<h:
    if l[x+1][y]=='#':c+=1
   if x+1<h and y+1<w:
    if l[x+1][y+1]=='#':c+=1
   l[x][y]=str(c)
for j in range(h):
  l[j]=''.join(l[j])
  print(l[j])
s = input()
foo = s.split('/')
if foo[1] <= 4 and foo[2] <= 30:
  print('Heisei')
else:
  print('TBD')

### FIXED CODE ###

s = input()
foo = s.split('/')
if int(foo[1]) <= 4 and int(foo[2]) <= 30:
  print('Heisei')
else:
  print('TBD')
from copy import copy
from time import time
import random
t0 = time()
import math
import sys
input = sys.stdin.readline
D = int(input())
c = list(map(int,input().split()))
s = [list(map(int,input().split())) for _ in range(D)]
last = [0]*26
ans = [0]*D
score = 0
for i in range(D):
    ps = [0]*26
    for j in range(26):
        pl = copy(last)
        pl[j] = i+1
        ps[j] += s[i][j]
        for k in range(26):
            ps[j] -= c[k]*(i+1-pl[k])
    idx = ps.index(max(ps))
    last[idx] = i+1
    ans[i] = idx+1
    score += max(ps)
now = time()
lim = 1.85
T = 300
cnt = 0
while now-t0<lim:
    cnt += 1
    na = copy(ans)
    x = random.randint(1,365)
    y = random.randint(1,365)
    na[x-1] = na[y-1]
    last = [0]*26
    ns = 0
    for i in range(D):
        last[na[i]-1] = i+1
        ns += s[i][na[i]-1]
        for j in range(26):
            ns -= c[j]*(i+1-last[j])
    now = time()
    if cnt%100 == 0:
        T = 300+(-298)*(now-t0)/lim
    p = math.exp((ns-score)/T)
    if ns > score or random.random() < p:
        ans = na
        score = ns
print(score)
for a in ans:
    print(a)

### FIXED CODE ###

import random
for i in range(365):
  print(random.randint(1,26))
n=int(input())
a=list(map(int,input().split()))
q=int(input())
sum=sum(a)
a2,a3=[],[]
import bisect as bs

for i in set(a):
    a2.append(i)
    a3.append(a.count(i))

#print(sum)
#print(a2,a3)

from functools import lru_cache
@lru_cache(maxsize=None)
def idx(x):
    return bs.bisect_left(a2,x)

for i in range(q):
    b,c=map(int,input().split())
    if b in a2:
        b_idx=idx(b)
        if a3[b_idx]!=0:
            if c in a2:
                c_idx=idx(c)
            else:
                a2.append(c)
                a3.append(0)
                c_idx=-1
            sum+=(c-b)*a3[b_idx]
            a3[c_idx]+=a3[b_idx]
            a3[b_idx]=0
#        del a2[b_idx]
#        del a3[b_idx]
#    print(a2,a3)
    print(sum)

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
q=int(input())
sum=sum(a)

count=[0]*(10**5+1)

for i in a:
    count[i]+=1

for i in range(q):
    b,c=map(int,input().split())
    if count[b]!=0:
        sum+=(c-b)*count[b]
        count[c]+=count[b]
        count[b]=0
    print(sum)
#coding:utf-8
from math import *
def fib(n):
    return round(( ((1 + sqrt(5))/2)**n - ((1 - sqrt(5))/2)**n ) / sqrt(5))
F = 1001
MD = 1000000007
ls = [0,1]
for f in range(F-2):
    s = sum(ls[-2:])
    ls.append(s)
def fib2(n):
    return ls[n]
old_a = 0
diff = []
N,M = map(int, input().split())
for m in range(M):
    a = int(input())
    if a-old_a==1 and old_a != 0:
        print (0)
        exit()
    diff.append(a-old_a)
    old_a = a
diff.append(N - old_a)
    
#print (diff)
ans = 1
for i,d in enumerate(diff):
    if i!=0 and i!=len(diff)-1:
        d-=1
    ans *= fib(d)
    #ans %= 1000000007
print (ans % MD)
#print (ans)



### FIXED CODE ###

N, M = map(int, input().split())
MOD = 10 ** 9 + 7
ng = set([int(input()) for _ in range(M)])
ans = [0, 1] 
for i in range(1, N+1):
  if i in ng:
    ans.append(0)
  else:
    ans.append((ans[-2] + ans[-1]) % MOD)
print(ans[-1] % MOD)
input = sys.stdin.readline
n,k = list(map(int, input().strip().split()))
step_array = list(map(int, input().strip().split()))
score_array = [0]
for i in range(0, n+1):
	for j in range(1, k+1):
		if i+j > n-1:
			break
		cost = abs(step_array[i] - step_array[i+j]) + score_array[i]
		if len(score_array) <= i+j:
			score_array.append(cost)
		elif(score_array[i+j]>cost):
			score_array[i+j] = cost
print(score_array[n-1])

### FIXED CODE ###

n,k = list(map(int, input().strip().split()))
step_array = list(map(int, input().strip().split()))
score_array = [0]
for i in range(0, n+1):
	for j in range(1, k+1):
		if i+j > n-1:
			break
		cost = abs(step_array[i] - step_array[i+j]) + score_array[i]
		if len(score_array) <= i+j:
			score_array.append(cost)
		elif(score_array[i+j]>cost):
			score_array[i+j] = cost
print(score_array[n-1])
a,b,k=map(int,input().split());r=range(a,b+1);print(*sorted({*(r[:k]+r[-k:])}))

### FIXED CODE ###

a,b,k=map(int,input().split());r=range(a,b+1);print(*sorted(set(r[:k])|set(r[-k:])),sep='\n')
A,B,T = map(int, input().split())
Ans = ((T+0.5)//A)*B
print(int(Ans)

### FIXED CODE ###

A,B,T = map(int, input().split())
Ans = ((T+0.5)//A)*B
print(int(Ans))
import sys
input()
for e in sys.stdin:
    a, b, c = sorted(int(e.split()))
    if a**2 + b**2 == c**2:
        print('YES')
    else:
        print('NO')


### FIXED CODE ###

import sys
input()
for e in sys.stdin:
    a, b, c = sorted(map(int, e.split()))
    if a**2 + b**2 == c**2:
        print('YES')
    else:
        print('NO')
num = list(map(int, input().split()))

X= num[0]
Y =num[1]
ans = "No"
for i in range(X+1):
  if 4*X - 2*i == Y:
    ans = "Yes"
    braek;
print(ans)

### FIXED CODE ###

num = list(map(int, input().split()))
X= num[0]
Y =num[1]

ans = "No"
for i in range(X+1):
  if 4*X - 2*i == Y:
    ans = "Yes"
    break;
print(ans)
import math
A, B, C, D = map(int, input().split())
kobaisu =int( (C * D )/ math.gcd(C, D))

bk =  B - B//C - B//D + B//kobaisu

ak = (A-1) - (A-1)//C - (A-1)//D + (A-1)//kobaisu

print(bk-ak)

### FIXED CODE ###

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

ans = b - (b // c + b//d - b//(c*d // fractions.gcd(c, d))) - ( a - 1  - ((a-1) // c + (a-1)//d - (a-1)//(c * d //fractions.gcd(c, d))))  

print(ans)
def gcd(a, b):
    if a < b:
        a, b = b, a
    if b == 0:
        return int(a)
    r = a % b
    return gcd(b, r)

def lcm(a,b):
  return int(a*b/gcd(a,b))
 
N,M = map(int,input().split())
S = input()
T = input()
L = lcm(N,M)
flag = True
min_len = min(Na,M)
s_index = int(int(L/M)/gcd(int(L/M),int(L/N)))
t_index = int(int(L/N)/gcd(int(L/M),int(L/N)))

if N == M:
  for i in range(N):
    if S[i] == T[i]:
      continue
    else:
      flag = False
      break
else:
  for i in range(min_len):
    if i * s_index < N-1 and i*t_index < M - 1:
      if S[i*s_index] == T[i*t_index]:
        continue
      else:
        flag = False
        break
    else:
      break
    
if flag:  
  print(L)
else:
  print(-1)

### FIXED CODE ###

def gcd(a, b):
    if a < b:
        a, b = b, a
    if b == 0:
        return int(a)
    r = a % b
    return gcd(b, r)

def lcm(a,b):
  return int(a*b/gcd(a,b))
 
N,M = map(int,input().split())
S = input()
T = input()
L = lcm(N,M)
flag = True
min_len = min(N,M)
s_index = int(int(L/M)/gcd(int(L/M),int(L/N)))
t_index = int(int(L/N)/gcd(int(L/M),int(L/N)))

if N == M:
  for i in range(N):
    if S[i] == T[i]:
      continue
    else:
      flag = False
      break
else:
  for i in range(min_len):
    if i * s_index < N-1 and i*t_index < M - 1:
      if S[i*s_index] == T[i*t_index]:
        continue
      else:
        flag = False
        break
    else:
      break
    
if flag:  
  print(L)
else:
  print(-1)
N, T = map(int,raw_input().split())
ans = float("inf")

for i in range(N):
    c,t = map(int,input().split())
    if t <= T:
        ans = min(ans,c)

if ans == float("inf"):
    print("TLE")
else:
    print(ans)


### FIXED CODE ###

N, T = map(int,input().split())
ans = float("inf")

for i in range(N):
    c,t = map(int,input().split())
    if t <= T:
        ans = min(ans,c)

if ans == float("inf"):
    print("TLE")
else:
    print(ans)
s = str(input())
n = 0
w = 0
s = 0
e = 0
for i in range(len(s)):
    if s[i] == "N":
        n += 1
    elif s[i] == "W":
        w += 1
    elif s[i] == "S":
        s += 1
    else:
        e += 1
if (n == 0 and s > 0) or (s == 0 and n > 0) or (e == 0 and w > 0) or (w == 0 and e > 0):
    print("No")
else:
    print("No")

### FIXED CODE ###

k = str(input())


n = 0
w = 0
s = 0
e = 0
for i in range(len(k)):
    if k[i] == "N":
        n += 1
    elif k[i] == "W":
        w += 1
    elif k[i] == "S":
        s += 1
    else:
        e += 1
if (n == 0 and s > 0) or (s == 0 and n > 0) or (e == 0 and w > 0) or (w == 0 and e > 0):
    print("No")
else:
    print("Yes")
N,M=int(input())
L=list(map(int,input().split()))
B=[1]*N
for i in range(M):
  a,b=map(int,input().split())
  if L[a-1]<L[b-1]:
    B[a-1]==0
  elif L[a-1]==L[b-1]:
    B[a-1]=0
    B[b-1]=0
  else:
    B[b-1]=0
print(sum(B))
  

### FIXED CODE ###

N,M=map(int,input().split())
L=list(map(int,input().split()))
B=[1]*N
for i in range(M):
  a,b=map(int,input().split())
  if L[a-1]<L[b-1]:
    B[a-1]=0
  elif L[a-1]==L[b-1]:
    B[a-1]=0
    B[b-1]=0
  else:
    B[b-1]=0
print(sum(B))
def Main(N, M, S, C):
    digits = {1:set([]), 2:set([]), 3:set([])}
    for i in range(M):
        digits[S[i]].add(C[i])
    for k, v in digits.items():
        if len(v) >= 2:
            return -1
    if len(digits[1]) > 0 and list(digits[1])[0] == 0:
        return -1
    if len(digits[1]) == 0 and len(digits[2]) > 0 and list(digits[2])[0] == 0:
        return -1  
    ans_list = []
    for v in digits.values():
        if len(v) == 0:
            ans_list.append('0')
        else:
            ans_list.append(str(list(v)[0]))
    ans_str = "".join(ans_list)
    return eval(ans_str)
        
                

def main():
    N, M = map(int, input().split())
    S = [0]*M
    C = [0]*M
    for i in range(M):
        S[i], C[i] = map(int, input().split())
    print(Main(N, M, S, C))

if __name__ == '__main__':
    main()

### FIXED CODE ###

def Main(N, M, S, C):
    dig = [set([]),set([]),set([])]
    for i in range(M):
        dig[S[i]-1].add(C[i])
    for s in dig:
        if len(s) == 2:
            return -1
    if N == 3:
        if len(dig[0]) > 0 and list(dig[0])[0] == 0:
            return -1
        if len(dig[0]) == 0:
            dig[0].add(1)
        if len(dig[1]) == 0:
            dig[1].add(0)
        if len(dig[2]) == 0:
            dig[2].add(0)
        return list(dig[0])[0]*100+list(dig[1])[0]*10+list(dig[2])[0]
    elif N == 2:
        if len(dig[0]) > 0 and list(dig[0])[0] == 0:
            return -1
        if len(dig[0]) == 0:
            dig[0].add(1)
        if len(dig[1]) == 0:
            dig[1].add(0)
        return list(dig[0])[0]*10+list(dig[1])[0]
    else:
        return list(dig[0])[0]       
        
                

def main():
    N, M = map(int, input().split())
    if M == 0:
        if(N == 3):
            print(100)
        elif(N == 2):
            print(10)
        else:
            print(0)
        exit()
    S = [1]*M
    C = [0]*M
    for i in range(M):
        S[i], C[i] = map(int, input().split())
    print(Main(N, M, S, C))

if __name__ == '__main__':
    main()
A,B,K=map(int,input().split())
div=[]
for i in range(1,max(A,B)):
    if A%i==0 and B%i==0:
        div+=[i]

       
print(div[-K])

### FIXED CODE ###

A,B,K=map(int,input().split())
div=[]
for i in range(1,max(A,B)+1):
    if A%i==0 and B%i==0:
        div+=[i]
print(div[-K])
import math
 
a,b = map(int,input().split())
 
def lcm(x,y):
    return (x*y)/(math.gcd(x,y))
 
print(int(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))