Harryxun/stf_run huggingface dataset:
#coding:utf-8
import sys
sys.setrecursionlimit(10**6)
write = sys.stdout.write
dbg = lambda *something : print(*something) if DEBUG else 0
DEBUG = False
def main(input = sys.stdin.readline):
    LMIIS = lambda : list(map(int,input().split()))
    II = lambda : int(input())
    MAXL = 101
    def vtop(x1,x2,y1,y2,h1):
        ans = h1 + abs(x1-x2) + abs(y1-y2)
        return ans if ans <= 10**9 else 0
 
    N = II()
    b = [[0] * MAXL for _ in range(MAXL)]
 
    
    # get info
    info =[]
    info0 = []
    for _ in range(N):
        x,y,h = LMIIS()
        if h == 0:
            info0.append((x,y,h))
        else:
            info.append((x,y,h))
    if len(info) + len(info0) < N:
        raise

    # init candidates
    x,y,h = info[0]
    for i in range(MAXL):
        for j in range(MAXL):
            b[i][j] = vtop(x,j,y,i,h)



    # check
    for x,y,h in info0:
        for i in range(MAXL):
            for j in range(MAXL):
                if b[i][j] > vtop(x,j,y,i,h):
                    b[i][j] = 0
    for x,y,h in info:
        for i in range(MAXL):
            for j in range(MAXL):
                if b[i][j] != vtop(x,j,y,i,h):
                    b[i][j] = 0



    # answer
    ansl = []
    if N == 1:
        x,y,h = (info + info0)[0]
        print(x,y,h)
        return
    for i in range(MAXL):
        for j in range(MAXL):
            if b[i][j] > 0:
                ansl.append((j,i,b[i][j]))
    for x0,y0,h0 in ansl:
        f = True
        for x1,y1,h1 in info + info0:
            if h1 != max(h0-abs(x0-x1)-abs(y0-y1),0):
                f = False
                break
        if f:
            print(x0,y0,h0)
            return
    raise




if __name__ == '__main__':
    main()


### FIXED CODE ###

#coding:utf-8
import sys
sys.setrecursionlimit(10**6)
write = sys.stdout.write
dbg = lambda *something : print(*something) if DEBUG else 0
DEBUG = False
def main(input = sys.stdin.readline):
    LMIIS = lambda : list(map(int,input().split()))
    II = lambda : int(input())

    N = II()
    info = []
    for _ in range(N):
        xi, yi, hi = LMIIS()
        if hi != 0:
            xt, yt, ht = xi, yi, hi
        info.append((xi, yi, hi))

    for Cy in range(101):
        for Cx in range(101):
            H = ht + abs(xt - Cx) + abs(yt - Cy)
            found = True
            for xi, yi, hi in info:
                tmp_h = max(H - abs(Cy-yi) - abs(Cx-xi), 0)
                if tmp_h != hi:
                    found = False
                    break
            if found:
                print('{} {} {}'.format(Cx,Cy,H))
                return



if __name__ == '__main__':
    main()
s = input()
if s[:4] < 2019 or s[:4] == 2019 and s[5] ==0 and s[6] <= 4:
  print("Heisei")
else:
  print("TBD")

### FIXED CODE ###

s = input()
 
if s <= '2019/04/30':
    print('Heisei')
else:
    print('TBD')
import sys

n = int(input())
numbers = list(map(int, input().split()))

if numbers == []:
    print(-1)
    sys.exit(0)

index = 0
value = 1
breaks = 0
while True:
    while numbers[index] != value:
        if index >= len(numbers):
            print(-1)
            sys.exit(0)
        numbers.pop(index)
        breaks += 1
    index += 1
    value += 1
    if index >= len(numbers):
        print(breaks)
        sys.exit(0)

### FIXED CODE ###

import sys

n = int(input())
numbers = list(map(int, sys.stdin.readline().split()))

if 1 not in numbers:
    print(-1)
    sys.exit(0)

breaks = 0
current = 1
for i in range(n):
    if numbers[i] == current:
        current += 1
    else:
        breaks += 1
print(breaks)
S = input()
if S = "ARC":
    print("ABC")
else:
    print("ARC")

### FIXED CODE ###

S = input()
if S == "ARC":
    print("ABC")
else:
    print("ARC")
import sys


def solv(s):
    left, right = s.split('=')
    for i in range(10):
        i = str(i)
        l = left.replace('X', i)
        r = right.replace('X', i)
#        l1, l2 = l.split('+')
#        if i == '0' and (l1[0] == '0' or l2[0] == '0' or r[0] == '0'):
#            continue
        if eval(l) == int(r):
            return i
    else:
        return 'NA'


for line in sys.stdin:
    print solv(line.rstrip('\n'))

### FIXED CODE ###


import sys


def solv(s):
    for i in range(10):
        i = str(i)
        s2 = s.replace('X', i)
        left, right = s2.split('=')
        l1, l2 = left.split('+')
        if any([x[0] == '0' and len(x) > 1 for x in [l1, l2, right]]):
            continue
        if int(l1) + int(l2) == int(right):
            return i
    else:
        return 'NA'


for line in sys.stdin:
    print solv(line.rstrip('\n'))
a,b=map(int,input().split())

c=a+ba
d=a-b
e=a*b
f=[c,d,e]
print(max(f))
  


### FIXED CODE ###

a,b=map(int,input().split())
c=a+b
e=a*b
d=a-b
print(max(c,e,d))
import sys
sys.setrecursionlimit(1000000)

from collections import defaultdict

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

dict = defaultdict(int)

for i in range(M):
  B, C = map(int, input().split())
  dict[C] += B

idx = 0
for k, v in sorted(dict.items(), key=lambda x: -x[0]):
  for _ in range(v):
    if idx-1 <= len(A):
      if A[idx] < k:
      	A[idx] = k
      	idx += 1
      else:
        print(sum(A))
        exit()
    else:
      print(sum(A))
      exit()
      
      
print(sum(A))

### FIXED CODE ###

import sys
sys.setrecursionlimit(1000000)

from collections import defaultdict

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

dict = defaultdict(int)

for i in range(M):
  B, C = map(int, input().split())
  dict[C] += B

idx = 0
for k, v in sorted(dict.items(), key=lambda x: -x[0]):
  for _ in range(v):
    if idx+1 <= len(A):
      if A[idx] < k:
      	A[idx] = k
      	idx += 1
      else:
        print(sum(A))
        exit()
    else:
      print(sum(A))
      exit()
      
      
print(sum(A))
n = int(raw_input())
s = ["" for i in range(n)]
while True:
    a = raw_input().split()
    if a[0] == "quit":
        break
    if a[0] == "push":
        s[int(a[1])] += a[2]
    elif a[0] == "pop":
        l = len(s[int(a[1])]) - 1
        print s[int(a[1])][l]
        s[int(a[1)]] = s[int(a[1])][:l]
    elif a[0] == "move":
        l = len(s[int(a[1])]) - 1
        s[int(a[2])] += s[int(a[1])][l]
        s[int(a[1])] = s[int(a[1])][:l]

### FIXED CODE ###

n = int(raw_input())
s = ["" for i in range(n)]

while True:
    a = raw_input().split()
    if a[0] == "quit":
        break

    i = int(a[1]) - 1
    if a[0] == "push":
        s[i] += a[2]

    elif a[0] == "pop":
        l = len(s[i]) - 1
        print s[i][l]
        s[i] = s[i][:l]

    elif a[0] == "move":
        j = int(a[2]) - 1 
        l = len(s[i]) - 1
        s[j] += s[i][l]
        s[i] = s[i][:l]
N, K = map(int, input().split())
Hs = list(map(int, input().split()))
Hs.sort(reverse=True)
for i in range(K):
  Hs[i] = 0
print(sum(Hs))

### FIXED CODE ###

N, K = map(int, input().split())
Hs = list(map(int, input().split()))
Hs.sort(reverse=True)
if K > N:
  print(0)
else:
  for i in range(K):
    Hs[i] = 0
  print(sum(Hs))
def my_index_multi(l, x):
    return [i for i, _x in enumerate(l) if _x == x]
N=int(input())
A=list(map(int,input().split()))
Q=int(input())
BC=[]
for i in range(Q):
    BC.append(list(map(int,input().split())))
for i in BC:
    if i[0] in A:
        indexlist=my_index_multi(A,i[0])
        for j in indexlist:
            A[j]=i[1]
    print(sum(A))

### FIXED CODE ###

def num2alpha(num):
    if num<=26:
        return chr(64+num)
    elif num%26==0:
        return num2alpha(num//26-1)+chr(90)
    else:
        return num2alpha(num//26)+chr(64+num%26)
N=int(input())
print(num2alpha(N).lower())
cnt = 0
a, b = input().split()
d = int(a+b)
for i in l:
    if i <= d:
        cnt += 1
print(cnt)

### FIXED CODE ###

a, b = map(int, input().split())
print(a if a <= b else a - 1)
from fractions import gcd
from bisect import bisect_right
n,k=map(int,input().split())
A=list(map(int,input().split()))
A.sort()
if k>A[n-1]:ans=-1
elif k=A[n-1]:ans=1
else:
    a=A[0]
    for i in range(1,n):
        a=gcd(a,A[i])
    m=A[bisect_right(A,k)]
    if (m-k)%a==0:
        ans=1
    else:
        ans=-1
if ans==1:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

### FIXED CODE ###

from fractions import gcd
from bisect import bisect_right
n,k=map(int,input().split())
A=list(map(int,input().split()))
A.sort()
if k>A[n-1]:ans=-1
elif k==A[n-1]:ans=1
else:
    a=A[0]
    for i in range(1,n):
        a=gcd(a,A[i])
    m=A[bisect_right(A,k)]
    if (m-k)%a==0:
        ans=1
    else:
        ans=-1
if ans==1:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")
N,K = map(int,input().split())
number = 0
data = []
nolist = list(range(1,K+1))
print(nolist)
for i in range(N):
  number = int(input())
  for j in range(number):
    data = input().split()
    nolist[int(data[j])-1] = 0
try:
  for i in range(N):
  	nolist.remove(0)
except:
  pass
print(len(nolist))

### FIXED CODE ###

N,K = map(int,input().split())
data = []
nolist = list(range(1,N+1))
for i in range(K):
  number = int(input())
  data = input().split()
  for j in range(number):
    nolist[int(data[j])-1] = 0
try:
  for i in range(N):
  	nolist.remove(0)
except:
  pass
print(len(nolist))
N = int(input())
rec = []
for i in range(N):
    a, b = map(int, input().split())
    rec.append((a, b, i))

rec1 = sorted(rec, key=lambda x: x[0] - x[1], reverse=True)
rec2 = sorted(rec, key=lambda x: x[1] - x[0], reverse=True)
used = [-1] * N
i = 0
j = 0
k = 0
num = 0
while k < N:
    if k % 2 == 0:
        while i < N and used[i] != -1:
            i += 1
        num += rec1[i][0]
        used[rec1[i][2]] = 1
        i += 1
    else:
        while j < N and used[j] != -1:
            j += 1
        num -= rec2[i][1]
        used[rec2[i][2]] = 1
        j += 1

    k += 1

print(num)

### FIXED CODE ###

N = int(input())
rec = []
num = 0
for i in range(N):
    a, b = map(int, input().split())
    rec.append(a + b)
    num -= b

rec = sorted(rec, reverse=True)
for i in range(N):
    if i % 2 == 0:
        num += rec[i]
print(num)
# -*- coding: utf-8 -*-

import math

# code start
def lcm(a,b):
	return a*b/math.gcd(int(a),int(b))

def main():
	count = int(input())
	i = 0
	temp = 1
	while(i<count):
		i+=1
		num = int(input())
		temp = lcm(temp,num)
	print(int(temp))


if __name__ == '__main__':
    main()

# code end


### FIXED CODE ###


def computeGCD(x, y): 
   while(y):
   		x, y = y, x % y
   return x 
n=int(raw_input())
ar=[]
for i in range(0,n):
	k=int(raw_input())
	ar.append(k)

an=ar[0]
for x in range(1,n):
	an=(an*ar[x])/computeGCD(an,ar[x]);
print(an)
S=input()
K=int(input())
S_=S*K+"A"
cnt=0
import queue
q=queue.Queue()
for i in S_:
    if not q.empty():
        if not i == q.get():
            n=1
            while not q.empty():
                q.get()
                n+=1
            cnt+=n//2
            q.put(i)
        else:
            q.put(i)
            q.put(i)#出した分戻さないと           
    else:
        q.put(i)
        #最後、入れっぱなしで終わってしまっていた
print(cnt)

### FIXED CODE ###

S=input()
S_=S+"A"
K=int(input())
i=0
cnt=0
lst=[]
while i<len(S_)-1:
    if not S_[i] == S_[i+1]:
        cnt+=1
        lst.append(cnt)
        cnt=0
        i+=1
    else:
        i+=1
        cnt+=1
if len(lst)==1:#一種類の時
    print((lst[0]*K)//2)
elif S[0]!=S[-1]:
    ans=0
    for j in lst:
        ans+=j//2
    print(ans*K)
else:
    ans_1=0
    ans_2=0
    for k in range(len(lst)):
        ans_1+=lst[k]//2
    for k in range(len(lst)):
        if k==0:
            ans_2+=lst[k]//2
        elif k==len(lst)-1:
            ans_2+=lst[k]//2
            ans_2+=(lst[k]+lst[0])//2
        else:
            ans_2+=(lst[k]//2)*2
    print(ans_1+(ans_2-ans_1)*(K-1))
import numpy as np
h,w,m = map(int,input().split())
bomb = list(tuple(map(lambda x: int(x)-1,input().split())) for i in range(m))
Map= np.zeros((h,w))
for i in bomb:
    Map[i] = 1
    
bombx = np.count_nonzero(Map,axis=0)
bomby = np.count_nonzero(Map,axis=1)
maxx = max(bombx)
maxy = max(bomby)
maxx_index = np.where(bombx == maxx)
maxy_index = np.where(bomby == maxy)

flag = 0
for i in maxx_index[0]:
    for j in maxy_index[0]:
        if Map[i][j] == 0:
            flag = 1
if flag == 0:
    print(maxx+maxy)
else:
    print(maxx+maxy-1)

### FIXED CODE ###

h,w,m = map(int,input().split())
bombX = [0]*h
bombY = [0]*w
bomb = set()
maxX = maxY = 0
for i in range(m):
    i,j = map(lambda x:int(x)-1, input().split())
    bomb.add((i,j))
    bombX[i] += 1
    bombY[j] += 1
    maxX = max(maxX,bombX[i])
    maxY = max(maxY,bombY[j])
maxX_index = list(i for i in range(h) if bombX[i] == maxX)
maxY_index = list(i for i in range(w) if bombY[i] == maxY)
for i in maxX_index:
    for j in maxY_index:
        if (i,j) in bomb: continue
        print(maxX+maxY)
        exit()
print(maxX+maxY-1)
a,op,b = input()
if op == "+":
  ans = int(a)+int(b)
else:
  ans = int(a)-int(b)
print(ans)

### FIXED CODE ###

a,op,b = input().split()
ans = 0
if op == "+":
  ans = int(a)+int(b)
else:
  ans = int(a)-int(b)
print(ans)
from math import pi

r = int(input())
print(pi * r ** 2, pi * r * 2)



### FIXED CODE ###

from math import pi

r = float(input())
print(pi * r ** 2, pi * r * 2)
n,X,m=map(int,input().split())
x=[0]*m
y=[0]*m
y[0]=X
z=[0]*(m+1)
z[X]+=1
for i in range(1,m):
    x[i]=(i**2)%m
for i in range(1,m+1):
    y[i]=x[y[i-1]]
    z[y[i]]+=1
    if z[y[i]]==2:
        e=i
        q=y[i]
        break
for i in range(len(y)):
    if y[i]==q:
        b=i
        break
l=y[b:e]
L=len(l)
s=sum(l)
#print(x)
#print(y)
#print(z)
#print(b,e)
#print(l)
#print(sum(y[:b]))
#print(((n-b)//L)*s)
#print(sum(l[:(n-b)%L]))
ans=sum(y[:b])+((n-b)//L)*s+sum(l[:(n-b)%L])
print(ans)

### FIXED CODE ###

n,X,m=map(int,input().split())
if m==1:
    print(0)
else:
    x=[0]*m
    y=[0]*m
    y[0]=X
    z=[0]*(m+1)
    z[X]+=1
    for i in range(1,m):
        x[i]=(i**2)%m
    for i in range(1,m):
        y[i]=x[y[i-1]]
        z[y[i]]+=1
        if z[y[i]]==2:
            e=i
            q=y[i]
            break
    for i in range(len(y)):
        if y[i]==q:
            b=i
            break
    l=y[b:e]
    L=len(l)
    s=sum(l)
    #print(x)
    #print(y)
    #print(z)
    #print(b,e)
    #print(l)
    #print(sum(y[:b]))
    #print(((n-b)//L)*s)
    #print(sum(l[:(n-b)%L]))
    if n>=b:
        ans=sum(y[:b])+((n-b)//L)*s+sum(l[:(n-b)%L])
    else:
        ans=sum(y[:n])
    print(ans)
# -*- coding: utf-8 -*-
N = int(input())
a_list = []
for i in range(N):
    a_list.append(int(input()))
color_counter = 0
for i in range(N):
    color_counter += 1
    compare_a = a_list.pop(0)
    for idx, ite in enumerate(a_list[:]):
        if compare_a < ite:
            compare_a = a_list.pop(idx)
    if len(a_list) == 0:
        break
print(color_counter)

### FIXED CODE ###

# -*- coding: utf-8 -*-
from bisect import bisect_right, bisect_left
N = int(input())
a_list = [int(input()) for _ in range(N)]

color_list = [1]
for a in a_list:
    a *= -1
    index = bisect_right(color_list, a)
    if index < len(color_list):
        color_list[index] = a
    else:
        color_list.append(a)
#     print(color_list, a)
print(len(color_list))
import collections

n = int(input())
a = list(map(int, input().split()))
ac = collections.Counter(a)

for i in range(1,n+1):
    print(a[i])

### FIXED CODE ###

import collections
 
n = int(input())
a = list(map(int, input().split()))
ac = collections.Counter(a)
 
for i in range(1,n+1):
    print(ac[i])
i = list(map(int,input().split()))
j = list(map(int,input().split()))
S=sum(j)

  
if i[0]>=S:
	print(i[0]-S)
else:
	print("-1")

### FIXED CODE ###

import math
i =int(input())
print(2*i*math.pi)
n, k, q = map(int, input().split())
a = [int(input()) for _ in range(q)]
p = k - q
s = [[i, p] for i in range(n)]
for i in a:
    s[i][1] += 1

for i in s:
    if i[1] < 1:
        print("No")
    else:
        print("Yes")


### FIXED CODE ###

n, k, q = map(int, input().split())
a = [int(input()) for _ in range(q)]
p = k - q
s = [p]*n
for i in a:
    s[i-1] += 1

for i in s:
    if i < 1:
        print("No")
    else:
        print("Yes")
N,T=map(int,input().split())
s=2000
for i in range(N):
    a,b=map(int,input().split())
    if b<=T:s=min(s,a)
print(s if ans<2000 else "TLE")


### FIXED CODE ###

N,T=map(int,input().split())
ans=2000
for i in range(N):
    a=list(map(int,input().split()))
    if a[1]<=T:ans=min(ans,a[0])
print(ans if ans<2000 else "TLE")
N = int(input())
A = list(map(int, input().split())

num_subordinates = [0 for _ in N]
for a in A:
	++num_subordinates[a]

for n in num_subordinates:
	print(n)

### FIXED CODE ###

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

num_subordinates = [0 for _ in range(N)]
for a in A:
	num_subordinates[a-1] += 1

for n in num_subordinates:
	print(n)
S =input()
ls_S = list(S)
ans = "Yes"

while len(ls_S) != 0:
  print(ls_S)
  if "".join(ls_S[len(ls_S)-5:]) == "dream":
    ls_S = ls_S[:len(ls_S)-5]
  elif "".join(ls_S[len(ls_S)-5:]) == "erase":
    ls_S = ls_S[:len(ls_S)-5]
  elif "".join(ls_S[len(ls_S)-7:]) == "dreamer":
    ls_S = ls_S[:len(ls_S)-7] 
  elif "".join(ls_S[len(ls_S)-6:]) == "eraser":
    ls_S = ls_S[:len(ls_S)-6]
  else:
    ans = "No"
    break
print(ans)

### FIXED CODE ###

S =input()
ls_S = list(S)
ans = "YES"

while len(ls_S) != 0:
  if "".join(ls_S[len(ls_S)-5:]) == "dream":
    ls_S = ls_S[:len(ls_S)-5]
  elif "".join(ls_S[len(ls_S)-5:]) == "erase":
    ls_S = ls_S[:len(ls_S)-5]
  elif "".join(ls_S[len(ls_S)-7:]) == "dreamer":
    ls_S = ls_S[:len(ls_S)-7] 
  elif "".join(ls_S[len(ls_S)-6:]) == "eraser":
    ls_S = ls_S[:len(ls_S)-6]
  else:
    ans = "NO"
    break
print(ans)
def main():
    n = input()
    xy = []
    for _ in xrange(n):
        x, y = map(int, raw_input().split())
        xy.append([x, y])
    count = {}
    for i in xrange(n - 1):
        x0, y0 = xy[i]
        for j in xrange(i + 1, n):
            x1, y1 = xy[j]
            key = (x1 - x0, y1 - y0)
            try:
                count[key] += 1
            except KeyError:
                count[key] = 1
    print n - max(count.values())


if __name__ == '__main__':
    main()


### FIXED CODE ###



def main():
    n = input()
    if n == 1:
        print 1
        return
    xy = []
    for _ in xrange(n):
        x, y = map(int, raw_input().split())
        xy.append([x, y])
    count = {}
    for i in xrange(n):
        x0, y0 = xy[i]
        for j in xrange(n):
            if i == j:
                continue
            x1, y1 = xy[j]
            key = (x1 - x0, y1 - y0)
            try:
                count[key] += 1
            except KeyError:
                count[key] = 1
    print n - max(count.values())


if __name__ == '__main__':
    main()
# c
import numpy as np
n = int(input())
a = {}
xy = {}
for i in range(n):
    a[i] = int(input())
    xy[i] = {}
    for j in range(a[i]):
        xy[i][j] = list(map(int,input().split()))

### 自分についての情報を付け加える
for s in range(n):
    xy[s][a[i]] = [s+1,1]

# pさんによる証言とqさんによる証言を比較する
pq_list = [[0 for inki in range(n)] for jinjin in range(n)]
for p in range(n):
    for q in range(n):
        for l in range(len(xy[p])):
            for m in range(len(xy[q])):
                if xy[p][l][0] == xy[q][m][0] and xy[p][l][1] != xy[q][m][1]:
                    pq_list[p][q] += 1

pq_list = np.array(pq_list)
count = 0
while np.sum(pq_list) >= 1:
    max_index = 0
    for i in range(len(pq_list)):
        if sum(pq_list[max_index]) <= sum(pq_list[i]):
            max_index = i
    if sum(pq_list[max_index]) == 0:
        break
    pq_list = np.delete(pq_list,max_index,0)
    pq_list = np.delete(pq_list, max_index, 1)
    count += 1
    
print(n-count)

### FIXED CODE ###

n = int(input())
a = {}
xy = {}
for i in range(n):
    a[i] = int(input())
    xy[i] = {}
    for j in range(a[i]):
        xy[i][j] = list(map(int,input().split()))
ans = []
for i in range(2 ** n):
    flag = []
    k_low = bin(i)[2:]
    if len(k_low) < n:
        k_low = "0" * (n-len(k_low)) + k_low
    for k in k_low:
        flag.append(int(k))
    mujun = 0
    for x in range(len(xy)):
        if flag[x] == 1:
            for y in range(len(xy[x])):
                if flag[xy[x][y][0]-1] != xy[x][y][1]:
                    mujun = 1
    if mujun == 0:
        ans.append(flag)
sum_list = []
for answer in ans:
    sum_list.append(sum(answer))
print(max(sum_list))
import sys

x = sys.stdin.readline()

a, b, c = x.split(" ")

if a < b && b < c:
  print Yes

else:
  print No

### FIXED CODE ###

import sys

x = sys.stdin.readline()

a_list = x.split(" ")

if int(a_list[0]) < int(a_list[1]) and int(a_list[1]) < int(a_list[2]):
  print "Yes"

else:
  print "No"
def fatora(n):
	ans = []
	for i in range(1, n+1):
		if i*i > n:
			break
		else:
			if n % i == 0:
				ans.append(i)
				ans.append(n//i)
	return set(ans)

def eh_primo(n):
	if n == 0:
		return False
	elif n == 1:
		return True
	elif n == 2:
		return True
	else:
		for i in range(2, n+10):
			if i*i > n:
				break
			else:
				if n % i == 0:
					return False
		return True


import math

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

primos_qtd = 0

for num in fatora(new_gcd):
	if eh_primo(num):
		primos_qtd += 1
print(primos_qtd)

### FIXED CODE ###

def fatora(n):
	ans = []
	for i in range(1, n+1):
		if i*i > n:
			break
		else:
			if n % i == 0:
				ans.append(i)
				ans.append(n//i)
	return set(ans)

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


def eh_primo(n):
	if n == 0:
		return False
	elif n == 1:
		return True
	elif n == 2:
		return True
	else:
		for i in range(2, n+10):
			if i*i > n:
				break
			else:
				if n % i == 0:
					return False
		return True



a, b = map(int, input().split())
print(len(list(filter(eh_primo, fatora(gcd(a, b))))))
N =input()
if N%9==0:
    print('Yes')
else :
    print('No')

### FIXED CODE ###

N=int(input())
print('Yes' if N%9==0 else 'No')
from itertools import accumulate
from collections import Counter
# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

MOD = 10**9+7


def comb2(N):
    return int(N*(N-1)/2)


N = int(input())
prev = -1
Col = []
for _ in range(N):
    c = int(input())
    if c == prev:
        continue
    else:
        prev = c
        Col.append(c)


cntF = [0]*(N+1)
forward = [0]*(len(Col)+1)
for i, c in enumerate(Col):
    forward[i] = cntF[c]
    cntF[c] += 1

cntB = [0]*(N+1)
back = [0]*(len(Col)+1)
for i in reversed(range(len(Col))):
    c = Col[i]
    back[i] = cntB[c]
    cntB[c] += 1

backr = back[::-1]
backr = list(accumulate(backr))
back = backr[::-1]
# print(forward)
# print(back)
ans = 1
for i in range(len(Col)):
    tmp = forward[i]*(back[i+1]+1)
   #print("tmp->", tmp)
    ans += tmp
    ans %= MOD
print(ans)


### FIXED CODE ###

N = int(input())
C = [-1]

for _ in range(N):
    c = int(input())
    if c == C[-1]:
        continue
    else:
        C.append(c)

MOD = 10**9+7
dp = 1
prev = [0]*(max(C)+1)

for c in C[1:]:
    dp = (dp+prev[c]) % MOD
    prev[c] = dp
print(dp)
import bisect

N = int(input())
A = list(map(int,input().split()))
A.sort()
ans = 0
L=0
t=31
while(t>0):
    if len(A) == 0:
        break
    if A[-1]<(1<<(t-1)) or (1<<t) <= A[-1]:
        t -= 1
        L = 0
        continue

    large = A.pop(-1)
    small = (1<<t)-large
    if small < A[0] or A[-1]< small:
        t -= 1
        L = 0
        continue
    tmp = bisect.bisect_left(A,(1<<t)-large,lo=L,hi=len(A))
    if tmp == len(A):
        t -= 1
        L = 0
        continue
    if A[tmp] == (1<<t)-large:
        del A[tmp]
        ans += 1
        L = max(0,tmp-1)

print(ans)


### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
A.sort(reverse=True)
dic = {}
for a in A:
    dic[a] = dic.get(a,0)+1
ans = 0

for a in A:
    small = (1<<(len(format(a,"b")))) - a
    if small == a:
        if dic[a] >= 2:
            dic[a] -= 2
            ans += 1
        continue
    if dic.get(a,0)>0 and dic.get(small,0)>0:
        dic[a] -= 1
        dic[small] -= 1
        ans += 1
print(ans)
D = int(input())
if D =22:
  print("Christmas Eve Eve Eve")
  
elif D = 23:
  print("Christmas Eve Eve")
  
elif D = 24:
  print("Christmas Eve")
  
elif D = 25:
  print("Christmas")

### FIXED CODE ###

D = int(input())
if D == 22:
  print("Christmas Eve Eve Eve")
  
elif D == 23:
  print("Christmas Eve Eve")
  
elif D == 24:
  print("Christmas Eve")
  
elif D == 25:
  print("Christmas")