Harryxun/stf_run huggingface dataset:
import numpy as np
def factorize(n):
    fct = []  # prime factor
    b, e = 2, 0  # base, exponent
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append((b, e))
        b, e = b + 1, 0
    if n > 1:
        fct.append((n, 1))
    return fct


def divisorize(fct):
    b, e = fct.pop()  # base, exponent
    pre_div = divisorize(fct) if fct else [[]]
    suf_div = [[(b, k)] for k in range(e + 1)]
    return [pre + suf for pre in pre_div for suf in suf_div]

def num(fct):
    a = 1
    for base, exponent in fct:
        a = a * base**exponent
    return a
def yaku(n):
    fct = factorize(n)
    y = divisorize(fct)
    ys = []
    for yy in y:
        ys.append(num(yy))
    ys.sort()
    return ys

n,m = list(map(int,input().split()))
y = yaku(m)
print(np.max(np.array(y)[np.array(y) <= m/n]))

### FIXED CODE ###

import numpy as np
def factorize(n):
    fct = []  # prime factor
    b, e = 2, 0  # base, exponent
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append((b, e))
        b, e = b + 1, 0
    if n > 1:
        fct.append((n, 1))
    return fct


def divisorize(fct):
    b, e = fct.pop()  # base, exponent
    pre_div = divisorize(fct) if fct else [[]]
    suf_div = [[(b, k)] for k in range(e + 1)]
    return [pre + suf for pre in pre_div for suf in suf_div]

def num(fct):
    a = 1
    for base, exponent in fct:
        a = a * base**exponent
    return a
def yaku(n):
    fct = factorize(n)
    y = divisorize(fct)
    ys = []
    for yy in y:
        ys.append(num(yy))
    ys.sort()
    return ys

n,m = list(map(int,input().split()))
if n == 1 and m == 1:
    print(1)
else:
    y = yaku(m)
    print(np.max(np.array(y)[np.array(y) <= m/n]))
N, P = map(int, input().split())
def prime_factorize(n):
    a = []
    N = n
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= N:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

lis = prime_factorize(P)
#print(lis)
if N == 1:
    print(P)
elif len(lis) == 1:
    print(1)
else:
    d = [0] * (10 ** 6 + 5)
    for i in lis:
        d[i] += 1
    #print(d[:24])
    #print(d[103])
    lis2 = []
    for i in reversed(range(10 ** 6 + 5)):
        if d[i] >= N:
            val = d[i] // N
            lis2.append(pow(i,val))
    ans = 1
    for i in lis2:
        ans *= i
    print(ans)


### FIXED CODE ###

from math import sqrt
N, P = map(int, input().split())
def prime_factorize(n):
    a = []
    N = n
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= N:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

lis = prime_factorize(P)
#print(lis)
if N == 1:
    print(P)
    exit()

else:
    d = [0] * (10 ** 7)
    sq = sqrt(P) + 1
    for i in lis:
        if i < sq:
            d[i] += 1
    #print(d[:24])
    #print(d[103])
    lis2 = []
    for i in reversed(range(10 ** 6 + 5)):
        if d[i] >= N:
            val = d[i] // N
            lis2.append(pow(i,val))
    ans = 1
    for i in lis2:
        ans *= i
    print(ans)
a,b = [int(i)for i in input().spilt()]
x= (a+b)/2
if((a+b)%2 == 0):
    print(int(x))
else:
    print(int(x)+1)


### FIXED CODE ###

a,b = [int(i) for i in input().split()]
x= (a+b)/2
if((a+b)%2 == 0):
    print(int(x))
else:
    print(int(x)+1)
n, k = map(int, input().split())
x = abs(n - k)
a = n % x
b = abs(a - k)
print(min(a, b))

### FIXED CODE ###

n, k = map(int, input().split())
if n == 0 or n == k:
    print(0)
else:
    a = abs(n % k)
    b = abs(a - k)
    print(min(a, b))
import sys
sys.setrecursionlimit=10**8
mod=998244353
n,s=map(int,input().split())
a=list(map(int,input().split()))
ans=0
l=0
from functools import lru_cache
# @lru_cache(maxsize=None)
def dfs(x,y):
	global l
	global ans
	if y==s:
		ans+=pow(2,n-l,mod)
		ans%=mod
		return
	elif y>s or x==n:
		return
	l+=1
	dfs(x+1,y+a[x])
	l-=1
	dfs(x+1,y)
dfs(0,0)
print(ans)

### FIXED CODE ###

mod=998244353
n,s=map(int,input().split())
a=list(map(int,input().split()))
dp=[[0]*(s+1) for _ in range(n+1)]
dp[0][0]=1
for i in range(n):
	for j in range(s+1):
		dp[i+1][j]+=2*dp[i][j]
		dp[i+1][j]%=mod
		if j+a[i]<=s:
			dp[i+1][j+a[i]]+=dp[i][j]
			dp[i+1][j+a[i]]%=mod
print(dp[n][s])
road = int(input())
while road > 0:
    answer = [[float("inf") if n != m else 0 for n in range(10)] for m in range(10)]
    city = 0
    for _ in range(road):
        c1, c2, w = (int(n) for n in input().split(" "))
        answer[c1][c2] = w
        answer[c2][c1] = w
        city = max(city, c1, c2)
    city = max(connect.keys()) + 1
    for i in range(city):
        for j in range(city):
            for k in range(city):
                answer[j][k] = min(answer[j][k], answer[j][i] + answer[i][k])
    sum_ans = [-1 , float("inf")]
    for i in range(city):
        if sum(answer[i][:city]) < sum_ans[1]:
            sum_ans = [i, sum(answer[i][:city])]
    print(*sum_ans)
    road = int(input())

### FIXED CODE ###

road = int(input())
while road > 0:
    answer = [[float("inf") if n != m else 0 for n in range(10)] for m in range(10)]
    city = 0
    for _ in range(road):
        c1, c2, w = (int(n) for n in input().split(" "))
        answer[c1][c2] = w
        answer[c2][c1] = w
        city = max(city, c1, c2)
    city += 1
    for i in range(city):
        for j in range(city):
            for k in range(city):
                answer[j][k] = min(answer[j][k], answer[j][i] + answer[i][k])
    sum_ans = [-1 , float("inf")]
    for i in range(city):
        if sum(answer[i][:city]) < sum_ans[1]:
            sum_ans = [i, sum(answer[i][:city])]
    print(*sum_ans)
    road = int(input())
a,v,b,w,t=int(input().split())
 
print('NO')

### FIXED CODE ###

a,v=map(int, input().split())
b,w=map(int, input().split())
t=int(input())
 
if a<b:
  if b+w*t<=a+v*t:
    print('YES')
  else:
    print('NO')
if a>b:
  if a-v*t<=b-w*t:
    print('YES')
  else:
    print('NO')
import sys
input = sys.stdin.readline

S = input()
N = len(S)
mod_13 = [10 ** i % 13 for i in range(N)]

dp = [1] + [0 for _ in range(13 - 1)]

for i, char in enumerate(reversed(S)):
    next_dp = [0 for _ in range(13)]
    c = char != '?'
    for j in range(13):
        for k in range(10):
            if c and int(char) != k:
                continue
            next_dp[(j + mod_13[i] * k)  % 13] += dp[j]
    dp = list(map(lambda x: x % (10 ** 9 + 7), next_dp))

print(dp[5])


### FIXED CODE ###

S = input()
mod = 10 ** 9 + 7
N = len(S)
table = [[0] * 13 for _ in range(N + 1)]
table[0][0] = 1

dd = 1

for i, char in enumerate(reversed(S)):
    c = char != '?'
    for j in range(13):
        for k in range(10):
            if c and int(char) != k:
                continue
            table[i+1][(j + dd * k)  % 13] += table[i][j]
            table[i+1][(j + dd * k)  % 13] %= mod
    dd = (dd * 10) % 13

print(table[N][5])
k = int(input())
s = len(input())
MOD = 10 ** 9 + 7


def mod_inv(n):
    return pow(n, MOD - 2, MOD)


dp1 = [0 for i in range(s)]
dp1[0] = 25
dp1[1] = 1
dp2 = [0 for i in range(s)]
# 1moji
sum_not_0 = 1
end = 1
# 2moji kara s+k moji

total = pow(26, k + s, MOD)
tmp = pow(25, k + s, MOD)
print(total,tmp)
total = (total - tmp) % MOD

for i in range(0, s-1):
    tmp = ((tmp * ((k+s) - i)) % MOD * mod_inv((i + 1) * 25)) % MOD
#    print(tmp)
    total = (total - tmp) % MOD
print(total)

### FIXED CODE ###

k = int(input())
s = len(input())
MOD = 10 ** 9 + 7


def mod_inv(n):
    return pow(n, MOD - 2, MOD)

total = pow(26, k + s, MOD)
tmp = pow(25, k + s, MOD)
total = (total - tmp) % MOD

for i in range(0, s-1):
    tmp = ((tmp * ((k+s) - i)) % MOD * mod_inv((i + 1) * 25)) % MOD
    total = (total - tmp) % MOD
print(total)
import math
N = int(input())
A = list(map(int, input().split()))

sw = 0
for i in range(N):
    w = A[0 if i != 0 else 1]
    for j in range(N):
        if j != i:
            w = math.gcd(w, A[j])
    sw = max(sw, w)

print(sw)


### FIXED CODE ###

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

def gcd(x, y):
    if x == 0 or y == 0:
        return max(x, y)
    g = x % y
    if g == 0:
        return y
    return gcd(y, g)

R = [0] * N
R[N-1] = w = 0
for i in range(N-2, -1, -1):
    R[i] = w = gcd(w, A[i+1])

L = [0] * N
L[0] = w = 0
for i in range(1, N):
    L[i] = w = gcd(w, A[i-1])

w = 1
for i in range(N):
    w = max(w, gcd(L[i], R[i]))

print(w)
n = int(input())
a = []
b = []

for i in range(1, int(n**0.5)+10):
    if n % i == 0:
        a.append(i)
        if i != n//i:
            b.append(n//i)

def Check(x):
    cont= 0
    while x > 0:
        x = x//10
        cont += 1
    return cont

A = []
for i in a:
    A.append(Check(i))

B = []
for i in b:
    B.append(Check(i))

print(max(max(A), min(B)))

### FIXED CODE ###

n = int(input())

def Check(x):
    cont= 0
    while x > 0:
        x = x//10
        cont += 1
    return cont

a = []
for i in range(1, int(n**0.5)+1):
    if n % i == 0:
        a.append(i)

a = max(a)
b = n//a

print(max(Check(a), Check(b)))
s=input()
count=0
i=0
while i<=range(len(s) // 2):
	if s[i]!=s[-(i+1)]:
		count+=1
    i+=1
print(count)

### FIXED CODE ###

s=input()
count=0

for i in range(len(s) // 2):
	if s[i]!=s[-(i+1)]:
		count+=1
print(count)
a,b,c=map(int,input().split())
d=list[a,b,c]
for i in range(2):
    if d.count(d[i])!=1:
        del d[i]
print(len(d))


### FIXED CODE ###

a,b,c=input().split()
d=[a,b,c]
for i in range(2):
    if d.count(d[i])!=1:
        del d[i]
print(len(d))
#import sys
#input = sys.stdin.readline
#template input
import bisect

def IT():
    return int(input())
def IL():
    return [int(_) for _ in input().split()]
def SL():
    return [int(_) for _ in input().split()]
def ILS(n):
    return [int(input()) for _ in range(n)]
def SLS(n):
    return [input() for _ in range(n)]
def ILSS(n):
    return [[int(_) for _ in input().split()] for j in range(n)]

#template technique
def bit_full_search(ss):
    n = len(ss)
    for i in range(1 << n):
        s = ""
        for j in range(n + 1):
            if ((1 & i >> j) == 1):
                s += ss[j]
        print(s)

def bit_full_search2(A):
    #https://blog.rossywhite.com/2018/08/06/bit-search/
    value = []
    for i in range(1 << len(A)):
        output = []

        for j in range(len(A)):
            if ((i >> j) & 1) == 1:
                #output.append(A[j])
                output.append(A[j])
        #print(output)
        value.append([format(i, 'b'), sum(output)])
#    print(value)
    return value


"""ここからメインコード"""
def main():
    n = IT()
    #それぞれ半分全列挙
    list1 = [(-2) **  i for i in range(17)]
    list2 = [(-2) ** (i + 17) for i in range(17)]

    list1 = bit_full_search2(list1)
    list1.sort(key=lambda x:x[1])
    list1_bin = [list1[i][0] for i in range(len(list1))]
    list1_val = [list1[i][1] for i in range(len(list1))]

    list2 = bit_full_search2(list2)
    list2.sort(key=lambda x:x[1])
    list2_bin = [list2[i][0] for i in range(len(list2))]
    list2_val = [list2[i][1] for i in range(len(list2))]

    for i in range(len(list1_val)):
        j = bisect.bisect_left(list2_val, n - list1_val[i])
        if j < len(list2_val):
            if list1_val[i] + list2_val[j] == n:
                ans = list2_bin[j] +list1_bin[i]
                break

    print(int(ans))

main()



### FIXED CODE ###

n,k=[int(i) for i in input().split()]

if n%k==0:
  print(0)
else:
  print(1)
nk = list(map(int,input().split()))
a  = list(map(int,input().split()))

b = []

for i in range(nk[1]):
    b += a

def bubble_sort(A):
    cnt = 0
    for j in range(len(A)):
        for l in range(len(A)-1, j, -1):
            if A[l] < A[l-1]:
                A[l], A[l-1] = A[l-1], A[l]

                cnt += 1
    return int(cnt)

ans = bubble_sort(b)
ans = ans % 1000000007
print(ans)


### FIXED CODE ###

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

ans = 0

for j in range(i[0]):
    for k in range(i[1]):
        k += 1
        if len(str(k)) >= 2:
            k = str(k)
            if (int(k[-1])>=2)and(int(k[-2])>=2):
                if j+1 == int(k[-1])*int(k[-2]):
                    #print(j+1,int(k[-1]),int(k[-2]))
                    ans += 1
            k = int(k)
        k -= 1

        
print(ans)
import numpy as np
n = int(input())
jousi = list(map(int, input().split()))
a = np.zeros(n)
for i in jousi :
    a[jousi[i] -1] += 1
for i in range(len(a)):
    print(int(a[i]))

### FIXED CODE ###

import numpy as np
n = int(input())
jousi = list(map(int, input().split()))
a = np.zeros(n)
for i in range(len(jousi)) :
    a[jousi[i] - 1] += 1
for i in range(len(a)):
    print(int(a[i]))
N, A, B = map(int, input().split())

rep = "b" * A + "r" * B
C = N // (A + B)
D = N % (A + B)

if D == 0:
    ans = A * C
else:
    ans = A * C + rep[:D].count("b")
print(ans)

### FIXED CODE ###

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

C = N // (A + B)
D = N % (A + B)

ans = A * C + min(A, D)
print(ans)
x=str(input())
y=str(input())
def idx(x,y):
	if len(y)-len(x)!=1:
  		return False
	else:
  		for i in range(0,len(x)):
    		if x[i]!=y[i]:
      			return False
        return True
if idx(x,y):
  print("Yes")
else:
  print("No")


### FIXED CODE ###

def isokay(S,T):
    if len(T)-len(S)!=1:
        return False
    else:
        for i in range(len(S)):
            if S[i]!=T[i]:
                return False
    return True

S=input()
T=input()

if isokay(S,T):
    print("Yes")
else:
    print("No")
import sys
sys.setrecursionlimit(10**6)

N, K = map(int, input().split())
P = list(map(int,input().split()))
out_ = 0
p = P[0:K]
base = sum(p)
for i in range(N-K):
  out_ += P[i+K]-P[i]
  if i == 0:
    ans = out_
  else:
    if out > ans:
      ans = out_
    else:
      continue
answer = (base+ans+K)/2
print(answer)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)

N, K = map(int, input().split())
P = list(map(int,input().split()))
out_ = 0
p = P[0:K]
base = sum(p)
if N == K:
  answer = (sum(p)+K)/2
else:
  for i in range(N-K):
    out_ += P[i+K]-P[i]
    if i == 0:
      ans = out_
    else:
      if out_ > ans:
        ans = out_
      else:
        continue
  answer = (base+ans+K)/2
print(answer)
input (x)
print(x**3)

### FIXED CODE ###

x = int(input())
print(x**3)
[N,K,X,Y] = list( int, input().split() )

if N < K+1 : 
   tot = N * X
else : 
   tot = N * K + ( N - K ) * Y
    
print( tot )


### FIXED CODE ###

N = int( input() )
K = int( input() )
X = int( input() )
Y = int( input() )
 
if N < K + 1 :
   tot = N * X
else : 
   tot = K * X + ( N - K ) * Y
  
print( tot )
S = input()
r = 0
for s in S:
    if s == "x":
        r += 1
if r < 8:
    priant("YES")
else:
    print("NO")

### FIXED CODE ###

S = input()
r = 0
for s in S:
    if s == "x":
        r += 1
if r < 8:
    print("YES")
else:
    print("NO")
# coding: utf-8

import sys
from collections import deque

if __name__ == '__main__':
    while True:
        m,n = map(int,input().split())
        sw = []
        bw = []
        if m == 0 and n == 0:
            break
        for i in range(2*n-1):
            if i % 2 == 0:
                sw.append(list(map(int,input().split())))
            else:
                bw.append(list(map(int,input().split())))
        flag = [[0 for i in range(m)] for j in range(n)]
        l = []
        l.append([0,0,1])
        res = 0
        while len(l) != 0:
            bf = l[0]
            l.pop(0)
            if bf[0] == n-1 and bf[1] == m-1:
                res = bf[2]
                break
            flag[bf[0]][bf[1]] = 1
            if 1 <= bf[0] and bw[bf[0]-1][bf[1]] == 0 and flag[bf[0]-1][bf[1]] == 0:
                l.append([bf[0]-1,bf[1],bf[2]+1])
            if bf[1] < m-1 and sw[bf[0]][bf[1]] == 0 and flag[bf[0]][bf[1]+1] == 0:
                l.append([bf[0],bf[1]+1,bf[2]+1])
            if 1 <= bf[1] and sw[bf[0]][bf[1]-1] == 0 and flag[bf[0]][bf[1]-1] == 0:
                l.append([bf[0],bf[1]-1,bf[2]+1])
            if bf[0] < n-1 and bw[bf[0]][bf[1]] == 0 and flag[bf[0]+1][bf[1]] == 0:
                l.append([bf[0]+1,bf[1],bf[2]+1])
        print(res)

### FIXED CODE ###

while True:
    m,n = map(int,input().split())
    sw = []
    bw = []
    if m == 0 and n == 0:
        break
    for i in range(2*n-1):
        if i % 2 == 0:
            sw.append(list(map(int,input().split())))
        else:
            bw.append(list(map(int,input().split())))
    flag = [[0 for i in range(m)] for j in range(n)]
    l = [(0,0,1)]
    res = 0
    while l:
        bf = l.pop(0)
        if bf[0] == n-1 and bf[1] == m-1:
            res = bf[2]
            break
        flag[bf[0]][bf[1]] = 1
        if 1 <= bf[0] and bw[bf[0]-1][bf[1]] == 0 and flag[bf[0]-1][bf[1]] == 0:
            flag[bf[0]-1][bf[1]] = 1
            l.append((bf[0]-1,bf[1],bf[2]+1))
        if bf[1] < m-1 and sw[bf[0]][bf[1]] == 0 and flag[bf[0]][bf[1]+1] == 0:
            flag[bf[0]][bf[1]+1] = 1
            l.append((bf[0],bf[1]+1,bf[2]+1))
        if 1 <= bf[1] and sw[bf[0]][bf[1]-1] == 0 and flag[bf[0]][bf[1]-1] == 0:
            flag[bf[0]][bf[1]-1] = 1
            l.append((bf[0],bf[1]-1,bf[2]+1))
        if bf[0] < n-1 and bw[bf[0]][bf[1]] == 0 and flag[bf[0]+1][bf[1]] == 0:
            flag[bf[0]+1][bf[1]] = 1
            l.append((bf[0]+1,bf[1],bf[2]+1))
    print(res)
import numpy as np
N, M = map(int, input().split())
A = np.array([int(input()) for _ in range(M)], dtype = int)
l_a = len(A)

MOD= 1000000007
dp = np.zeros(N, dtype = int)
dp[A - 1] = - 1
if dp[0] == -1 and dp[1] == -1:
    pass
elif dp[0] == -1:
    dp[1] = 1
elif dp[1] == -1:
    dp[0] = 1
else:
    dp[0] = 1; dp[1] = 2;


for n in range(2, N):
    # print (dp)
    if dp[n] != -1:
        dp[n] = (max(dp[n-1], 0) + max(dp[n-2], 0)) % MOD

print (dp[-1])


### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)
import numpy as np
N, M = map(int, input().split())

MOD = 1000000007
dp = np.zeros(N, dtype = int)
if M != 0:
    A = np.array([int(input()) for _ in range(M)], dtype = int)
    dp[A - 1] = -1


if dp[0] == -1 and dp[1] == -1:
    pass
else:
    if dp[0] == -1:
        dp[1] = 1
    elif N >= 2 and dp[1] == -1:
        dp[0] = 1
    elif N >= 2:
        dp[0] = 1
        dp[1] = 2
    else:
        dp[0] = 1


if N >= 3:
    for n in range(2, N):
        if dp[n] != -1:
            dp[n] = (max(dp[n-1], 0) + max(dp[n-2], 0)) % MOD

print (dp[-1])
a,b=map(int,raw_input().split())
print(a*b,2*(a+b))

### FIXED CODE ###

a,b=map(int,input().split())
print(a*b,2*(a+b))
def is_collided(x: int, y: int, xn: list, ym: list) -> bool:
    xn_max = max(xn)
    ym_min = min(ym)

    if xn_max > ym_min:
        return True
    # xn_max ~ ym_minとx ~ yが重なっていれば衝突しない
    if xn_max < x < ym_min or xn_max < y <= ym_min or \
    x < xn_max < y or x < x < ym_min <= y:
        return False
    return True


def main():
    line1: list = list( map(lambda x:int(x), input().split(' ')) )
    line2: list = list( map(lambda x:int(x), input().split(' ')) )
    line3: list = list( map(lambda x:int(x), input().split(' ')) )
    if is_collided(line1[2], line1[3], line2, line3):
        print("War")
    else:
        print("No War")

if __name__=='__main__':
    main()
    # print(is_collided(10, 20, [8, 5, 13], [16, 22]))
    # print(is_collided(-48, -1, [-20, -35, -91, -23], [-22, 66]))
    # print(is_collided(6, 8, [-10, 3, 1, 5, -100], [100, 6, 14]))


### FIXED CODE ###

def is_collided(x: int, y: int, xn: list, ym: list) -> bool:
    xn_max = max(xn)
    ym_min = min(ym)

    if xn_max >= ym_min:
        return True
    # xn_max ~ ym_minとx ~ yが重なっていなければ衝突する
    return xn_max >= y or ym_min <= x

def main():
    line1 = list( map(lambda x:int(x), input().split(' ')) )
    line2 = list( map(lambda x:int(x), input().split(' ')) )
    line3 = list( map(lambda x:int(x), input().split(' ')) )
    print("War") if is_collided(line1[2], line1[3], line2, line3) else  print("No War")

if __name__=='__main__':
    main()
s = input()
l = s[:2]
r = s[2:]
yy = [str(i).zfill(2) for i in range(100)]
mm = [str(i).zfill(2) for i in range(1, 13)]

if l in mm and r in mm:
    print("AMBIGUOUS")
elif l in yy and r in mm:
    print("YYMM")
elif l in mm and r in yy:
    print("MMYY")
else:
    print("NA")

### FIXED CODE ###

s = input()
l = s[:2]
r = s[2:]
yy = [str(i).zfill(2) for i in range(100)]
mm = [str(i).zfill(2) for i in range(1, 13)]

if l in mm and r in mm:
    print("AMBIGUOUS")
elif l in yy and r in mm:
    print("YYMM")
elif l in mm and r in yy:
    print("MMYY")
else:
    print("NA")
a = list(map(int,input().split()))
print (l.index(0)+1)


### FIXED CODE ###

l = list(map(int,input().split()))
print (l.index(0)+1)
n, w, s, e = 0
for c in input():
	if c == "N":
		n += 1
	if c == "W":
		w += 1
	if c == "S":
		s += 1
	if c == "E":
		e += 1
b = ((n >= 1 and s >= 1) or (n==s==0)) and ((w >= 1 and e >= 1) or (w==e==0))
print("Yes" if b else "No")



### FIXED CODE ###

n = w = s = e = 0
for c in input():
	if c == "N":
		n += 1
	if c == "W":
		w += 1
	if c == "S":
		s += 1
	if c == "E":
		e += 1
b = ((n >= 1 and s >= 1) or (n==s==0)) and ((w >= 1 and e >= 1) or (w==e==0))
print("Yes" if b else "No")
N = int(input())
SP = [list(input().split()) for i in range(N)]

hoge = sorted(SP, key = lambda x:x[1], reverse = True)
SPsort = sorted(hoge, key = lambda x:x[0]

for i in range(N):
    print(SP.index(SPsort[i]) + 1)

### FIXED CODE ###

N = int(input())
SP = [list(input().split()) for i in range(N)]

for row in SP:
    row[1] = int(row[1])

hoge = sorted(SP, key = lambda x:x[1], reverse = True)
SPsort = sorted(hoge, key = lambda x:x[0])

for i in range(N):
    print(SP.index(SPsort[i]) + 1)
a,b = input().split()
print(a*b)

### FIXED CODE ###

a,b = map(int,input().split())
print(a*b)
def cubic(x):
    return x*x*x

print cubic(x)


### FIXED CODE ###

x = int(input())
if x <= 100 and x >= 1:
	print(x*x*x)
N = int(input())
train = [[] for _ in range(N)]
take_time = []
for cnt in range(N - 1):
    x, y , z = map(int,input().split())
    take_time.append(x)
    for _ in range(10**4):
        train[cnt].append(y)
        y += z

from bisect import bisect_left
for place in range(N):
    now = 0
    for i in range(place,N - 1):
        index = bisect_left(train[i],now)
        now = train[i][index]
        now += take_time[i]
    print(now)



### FIXED CODE ###

N = int(input())
train = [[] for _ in range(N)]
L = []
for cnt in range(N - 1):
    l = list(map(int,input().split()))
    L.append(l)

from math import ceil

from bisect import bisect_left
for place in range(N):
    now = 0
    for i in range(place,N - 1):
        k = max(0,ceil((now - L[i][1]) / L[i][2]))
        now = L[i][1] + L[i][2] * k
        now += L[i][0]
    print(now)
S = input()
ans = 0

for i in range(len(S) - 2):
    A = abs(753 - int(S[i:i+3]))
    ans = min(A, ans)

print(B)

### FIXED CODE ###

S = input()
B = 999
for i in range(len(S)-2):
    A = abs(753 - int(S[i:i+3]))
    B = min(A, B)
print(B)
N = input()
Sum = 0

for k in range(N):
    i = k+1

    if i % 3 != 0 and i % 5 != 0:
        Sum = Sum + i

print(Sum)

### FIXED CODE ###

N = input()
Sum = 0

for k in range(int(N)):
    i = k+1

    if i % 3 != 0:
        if i % 5 != 0:
            Sum = Sum + i

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

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

g = gcd(a, b)

common = []
for i in range(1, int(g**0.5)+1):
    if g%i == 0:
        common.append(i)
        common.append(g//i)
    
def Eratosthenes(n):
    if n < 2:
        return [1]
    prime = [1, 2]
    limit = math.ceil(n**0.5)
    data = list(range(3, n+1, 2))
    p = -1
    while p < limit:
        p = data[0]
        prime.append(p)
        data = [d for d in data if d%p != 0]
    return prime + data

prime = Eratosthenes(max(common))

print(len(set(common) & set(prime)))

### FIXED CODE ###

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
 
a, b = map(int, input().split())
print(len(set(prime_factorize(a)) & set(prime_factorize(b))) + 1)