Harryxun/stf_run huggingface dataset:
import sys
input = sys.stdin.readline
from collections import deque

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

#print(n,b)

ans=deque([])

for j in range(n):
    tmp=110
    for i in range(len(b)-1,-1,-1):
        if len(b)==1:
            break
        else:
            if i+1==b[i]:
                val=b.pop(b[i])
                ans.append(val)
                
ans.append(b[0])

if ans.count(110) > 0:
    print(-1)
else:
    for i in range(n):
        print(ans[i])

### FIXED CODE ###

import sys
input = sys.stdin.readline

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

anslist=[]
while len(b) > 0:
    val=110
    for i in range(len(b)-1,-1,-1):
        if i+1==b[i]:
            val=i+1
            break
    anslist.append(val)
    b.pop(i)

if anslist.count(110)>0:
    print(-1)
else:
    for i in (reversed(anslist)):
        print(i)
S = input('Enter something: ')
if S[2] == S[3] and S[4] == s[5]:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

S = input()
if S[2] == S[3] and S[4] == S[5]:
    print('Yes')
else:
    print('No')
import sys

if __name__=='__main__':
  lines = [int(x.strip()) for x in sys.stdin.readlines() if x != '']
  n = lines[0]
for i in xrange(n):
  # a, b  = int(lines[i+1]), int(lines[i+2])
  a, b  = lines[2*i+1], lines[2*i+2]
  if len(str(a+b)) > 80:
    print 'overflow'
  else:
    print a+b

### FIXED CODE ###

import sys

if __name__=='__main__':
  lines = [int(x.strip()) for x in sys.stdin.readlines() if x != '' and x != '\n']
  n = lines[0]
for i in xrange(n):
  a, b  = lines[2*i+1], lines[2*i+2]
  if len(str(a+b)) > 80:
    print 'overflow'
  else:
    print a+b
s = input()
ans = []
for i in range(len(s) - 2):
    ans.append(abs(s[i:i+3] - 753))
print(min(ans))

### FIXED CODE ###

s = str(input())
ans = 1000
for i in range(len(s)-2):
    x = int(s[i:i+3])
    ans = min(ans, abs(x-753))
print(ans)
from sys import stdin
N,X=[int(x) for x in stdin.readline().rstrip().split()]
burger_set=["P"]
for i in range(N):
    new_burger="B"+burger_set[0]+"P"+burger_set[0]+"B"
    burger_set[0]=(new_burger)
ans=burger_set[0][0:X].count('P')
print(ans)

### FIXED CODE ###

from sys import stdin
N, X = [int(x) for x in stdin.readline().rstrip().split()]

heights = [1]
putties = [1]
for _ in range(N):
    heights.append(heights[-1] * 2 + 3)
    putties.append(putties[-1] * 2 + 1)


def solve(n, x):
    if n == 0 and x == 1:
        return 1
    elif x == 1:
        return 0
    elif 1 < x <= 1+heights[n-1]:
        return solve(n-1, x-1)
    elif x == 2+heights[n-1]:
        return 1+putties[n-1]
    elif 2+heights[n-1] < x <= 2+2*heights[n-1]:
        return putties[n-1]+1+solve(n-1,x-2-heights[n-1]) 
    elif x == 3+2*heights[n-1]:
        return 2*putties[n-1]+1
print(solve(N, X))
n,k = [int(x) for x in input().split()]
p = [int(x) for x in input().split()]
max_t = 0
ans = 0
for i in range(n - k +1):
	buf = sum(p(i:i+k))
	if max_t < buf:
		max_t = buf
		ans = 0
		for j in range(k):
			ans += (1+p[i+j]) * p[i+j] / 2
print(ans)

### FIXED CODE ###

n, k = [int(x) for x in input().split()]
p = [1/2 + int(x)/2 for x in input().split()]
sum_p =[]
buf = 0
for i in p:
    buf += i
    sum_p.append(buf)
max_t = 0
for i in range(n - k + 1):
    buf = sum_p[i+k-1]
    if i > 0:
        buf -= sum_p[i-1]
    if max_t < buf:
        max_t = buf
print(max_t)
S=input()
tmp=[]
for i in range(len(S)-2):
  tmp.append(S[i:i+2])
for j in range(len(tmp)):
  tmp[i]=abs(753-int(tmp[i]))
print(int(min(tmp)))

### FIXED CODE ###

S = input()
tmp = []
for i in range(len(S)-2):
    tmp.append(S[i:i+3])
for j in range(len(S)-2):
    tmp[j] = abs(753-int(tmp[j]))
print(min(tmp))
a, b, c = int(input().split()) 
x = a - b
if c <= x:
	print(0)
else:
	y = c - x
	print(y)

### FIXED CODE ###

a, b, c = input().split()
x = int(a) - int(b)
if int(c) <= x:
	print(0)
else:
	y = int(c) - x
	print(y)
h, w, m = map(int, input().split())
h_cnt = [0 for i in range(h)]
w_cnt = [0 for i in range(w)]
bomb = set()
for _ in range(m):
    c_h, c_w = map(int, input().split())
    h_cnt[c_h-1] +=1
    w_cnt[c_w-1]+=1
    bomb.add(((c_h-1),(c_w-1)))

max_h = [i for i in range(len(h_cnt)) if h_cnt[i] == max(h_cnt)]
max_w = [i for i in range(len(w_cnt)) if h_cnt[i] == max(w_cnt)]

ans = []
for i in max_h:
    for j in max_w:
        if (i,j) in bomb:
            ans.append(h_cnt[i] + w_cnt[j] -1)
        else:
            ans.append(h_cnt[i] + w_cnt[j])

print(max(ans))

### FIXED CODE ###

h, w, m = map(int, input().split())
h_cnt = [0 for i in range(h)]
w_cnt = [0 for i in range(w)]
bomb = set()

for i in range(m):
    _h, _w = map(int, input().split())
    h_cnt[_h-1] += 1
    w_cnt[_w-1] += 1
    bomb.add(((_h-1),(_w-1))) #爆破対象の位置を判断

h_max = max(h_cnt)
w_max = max(w_cnt)

max_h = []
max_w = []

for i in range(h):
    if h_cnt[i] == h_max:
        max_h.append(i)

for i in range(w):
    if w_cnt[i] == w_max:
        max_w.append(i)

flg = True

for i in max_h:
    for j in max_w:
        if (i,j) not in bomb:
            flg = False
            break
print(h_max+w_max-1 if flg else h_max+w_max)
K = input()
X = input()

if K*500 >= X:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

K,X = map(int, input().split())

if K*500 >= X:
  print("Yes")
else:
  print("No")
import sys, math
from itertools import permutations, combinations
from collections import defaultdict, Counter, deque
from math import factorial
from bisect import bisect_left #bisect_left(list, value)
#from fractions import gcd
sys.setrecursionlimit(10**7)
enu = enumerate
MOD = 10**9+7
def input(): return sys.stdin.readline()[:-1]
def pri(x): print('\n'.join(map(str, x)))

D, N = map(int, input().split())

val = 100**D*N
if N<100:
    print(val)
else
    print(val+1)




### FIXED CODE ###

import sys, math
from itertools import permutations, combinations
from collections import defaultdict, Counter, deque
from math import factorial
from bisect import bisect_left #bisect_left(list, value)
#from fractions import gcd
sys.setrecursionlimit(10**7)
enu = enumerate
MOD = 10**9+7
def input(): return sys.stdin.readline()[:-1]
def pri(x): print('\n'.join(map(str, x)))

D, N = map(int, input().split())

val = 100**D
if N<100:
    print(val*N)
else:
    print(val*N + val)
n,a,b = (int(x) for x in input().split())

ans = 0

def keta(n):
    sum = 0
    while n>0:
        sum += n%10
        n = n//10
return sum

for i in range(1,n):
    if a<=keta(i)<=b:
        ans +=keta(i)
print(ans)


### FIXED CODE ###

n,a,b = (int(x) for x in input().split())

ans = 0

def keta(N):
    sum = 0
    while N>0:
        sum += N%10
        N = N//10
    return sum

for i in range(1,n+1):
    if a<=keta(i)<=b:
        ans +=i
print(ans)
N=input()
cnt=0

for i in range(len(N)):
    cnt+=int(N[i])

if int(N)%cnt==0:
    print("Yes")
    
else:
    print("No")
    

### FIXED CODE ###

n,a,b=map(int,input().split())
print(min(n*a,b))
n = int(input())
c = input()
count = 0

i, j = 0, n - 1
if c.count('W') == 0 | c.count('R') == 0:
    count = 0
else:
    white_cnt = []
    red_cnt = []
    for i in range(n):
        if c[i] == 'W':
            white_cnt.append(i)
        else:
            red_cnt.append(i)
while 1:
    white_num = white_cnt.pop(0)
    red_num = red_cnt.pop()
    if white_num < red_num:
        count += 1
    if len(white_cnt) == 0:
        break
    if len(red_cnt) == 0:
        break
print(count)


### FIXED CODE ###

n = int(input())
c = input()
count = 0

i, j = 0, n - 1
if c.count('W') == 0:
    count=0
elif c.count('R') == 0:
    count = 0
else:
    white_cnt = []
    red_cnt = []
    for i in range(n):
        if c[i] == 'W':
            white_cnt.append(i)
        else:
            red_cnt.append(i)
    while 1:
        white_num = white_cnt.pop(0)
        red_num = red_cnt.pop()
        if white_num < red_num:
            count += 1
        if len(white_cnt) == 0:
            break
        if len(red_cnt) == 0:
            break
print(count)
import sys

for line in sys.stdin:
    A=line.split()
    B=map(int,A)

    D=B.sort()
    e=1

    while e != 0:
        e=D[1]%D[0]
        C=D[0]
        D[0]=e
        D[1]=C

    print D[0]

### FIXED CODE ###

A=map(int,raw_input().split())
A.sort()

while A[1]%A[0]!=0:
    temp=A[0]
    A[0]=A[1]%A[0]
    A[1]=temp

print A[0]
import bisect

INF = 10 ** 10

N = int(input())
As = list(map(int, input().split()))
edges = [tuple(map(int, input().split())) for _ in range(N-1)]

dfs_stack = [1]
ans = [-1] * N
lis = [INF] * (N+1)
rewinder = []

while dfs_stack:
    pos = dfs_stack.pop()
    for u, v in edges:
        if u == pos:
            if ans[v-1] == -1:
                dfs_stack.append(v)
            else:
                parent = v
        elif v == pos:
            if ans[u-1] == -1:
                dfs_stack.append(u)
            else:
                parent = u
    
    while rewinder:
        i, before, after = rewinder.pop()
        if after == As[parent-1]:
            rewinder.append( (i, before, after) )
            break
        else:
            lis[i] = before

    index = bisect.bisect_left(lis, As[pos-1])
    rewinder.append( (index, lis[index], As[pos-1]) )
    lis[index] = As[pos-1]
    ans[pos-1] = lis.index(INF)

print(*ans, sep = '\n')

### FIXED CODE ###

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

flg = False
for i in range(a, b+1):
    if i % k == 0:
        flg = True
        break

if flg:
    print("OK")
else:
    print("NG")
h, w = list(map(int, input()))

if w % 2 == 0:
  print(h * 2 // 2)
else:
  if h % 2 == 0:
    print((w // 2 + w // 2 + 1) * h // 2)
  else:
    print((w // 2 + w // 2 + 1) * h // 2 + w // 2)

### FIXED CODE ###

h, w = list(map(int, input().split()))
import sys

if w == 1 or h == 1:
  print('1')
  sys.exit()

if w % 2 == 0:
  print(h * w // 2)
else:
  if h % 2 == 0:
    print((w // 2 + w // 2 + 1) * h // 2)
  else:
    print((w // 2 + w // 2 + 1) * (h // 2) + w // 2 + 1)
N = int(input())

ans = -1
for i in range(1, N+1)
	if int(i * 1.08)==N:
    	ans = i

if ans != -1:
	print(ans)
else:
	print(":(")
      

### FIXED CODE ###

# Input the amount of money Takahashi paid
N = int(input())

# Check if the price before tax is X, for X = 1, 2, 3, ..., N
ans = -1
for i in range(1, N + 1):
	if int(i * 1.08) == N:
		ans = i

# Print answer
if ans != -1:
	print(ans)
else:
	print(":(")
import math
from functools import reduce


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

n=int(input())
l1=range(1,n+1)
l2=range(1,n+1)
l3=range(1,n+1)

count=0

for i in l1:
    for j in l2:
        te=gcd(i,j)
        for k in l3:
            count+=(te,k)

print(count)

### FIXED CODE ###

import math
from functools import reduce


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

n=int(input())
l1=range(1,n+1)
l2=range(1,n+1)
l3=range(1,n+1)

count=0

for i in l1:
    for j in l2:
        te=math.gcd(i,j)
        for k in l3:
            count+=math.gcd(te,k)

print(count)
# coding: utf-8
import sys
import numpy as np
from math import factorial

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N, A, B = lr()
V = np.array(lr(), np.float64)
V.sort()
V = V[::-1]
Vcum = V.cumsum()
ave = Vcum / np.arange(1, N+1)
ma = ave[A-1:B].max()
print(ma)
cases = 0
Vrev = V[::-1]
for i, x in enumerate(ave[A-1:B], A-1):
    if x != ma:
        continue
    j = np.searchsorted(Vrev, V[i])
    k = np.searchsorted(Vrev, V[i], side='right')
    if j+1 == k:
        cases += 1
        continue
    r = i+1-j
    n = k-j
    a = factorial(n) / factorial(r) / factorial(n - r)
    cases += a

print(int(cases))


### FIXED CODE ###

import sys
import numpy as np
from math import factorial

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N, A, B = lr()
V = np.array(lr())
V.sort()
if A == 1:
    ave = V[-A]
else:
    ave = V[-A:].sum() / A
print(ave)
left_i = np.searchsorted(V, V[-A], side='left')
right_i = np.searchsorted(V, V[-A], side='right')
num = right_i - left_i
done = N - right_i

bottom = A-done
top = B-done

def combinations_count(n, r):
    ''' 組み合わせ '''
    return factorial(n) // (factorial(n - r) * factorial(r))

answer = combinations_count(num, bottom)
if ave == V[-A] and num > 1:
    for i in range(bottom+1, min(num, top)+1):
        answer += combinations_count(num, i)

print(answer)
# 15
n , k = map(int ,input().split())
h = list(map(int,input().split()))
ans = 0
for i in range(n):
if h[i] >= k:
ans += 1

print(ans)


### FIXED CODE ###

n , k = map(int ,input().split())
h = list(map(int,input().split()))
ans = 0
for i in range(n):
  if h[i] >= k:
    ans += 1

print(ans)
import sys, math

def CountDivisibleNumber(divisor, min, max):
    i = 0
    count = 0
    residue = min % divisor
    if residue == 0:
        i = min
    else:
        if min < divisor:
            i = divisor
        else:
            i = min + (divisor - residue)
            #print(residue)
            #print(i)

    while i <= max:
        count += 1
        i += divisor
        #print(i)
    
    return count

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

S = input().split()

A = int(S[0])
B = int(S[1])
C = int(S[2])
D = int(S[3])

count_U = B - A + 1

count_C  = CountDivisibleNumber(C, A, B)
#print(count_C)
count_D  = CountDivisibleNumber(D, A, B)
#print(count_D)
count_CD = CountDivisibleNumber(lcm(C, D), A, B)
#print(count_CD)

print(count_U - (count_C + count_D - count_CD))

### FIXED CODE ###

def gcd(a, b):
	while b:
		a, b = b, a % b
	return a
    
S = input().split()

A = int(S[0])
B = int(S[1])
C = int(S[2])
D = int(S[3])

CD = (C * D) // gcd(C, D)

count_B = B - (B // C) - (B // D) + (B // CD)
count_A = A - 1 - ((A - 1) // C) - ((A - 1) // D) + ((A - 1) // CD)

print(count_B - count_A)
foo = raw_input()
print foo**3

### FIXED CODE ###

print (input())**3
inputs = input()

inputs = list(inputs)

flag = False
for i in range(len(inputs) - 1):
    if inputs[i] == 'A' and inputs[i+1] == 'C'
        flag = True
        
if flag:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

inputs = input()

x = list(inputs)

flag = False
for i in range(len(x) - 1):
    if x[i] == 'A' and x[i+1] == 'C':
        flag = True

if flag:
    print('Yes')
else:
    print('No')
N = input()
n = 0
if N[0] =="7":
	n += 1
if N[1] == "7":
	n +=1
if N[2} == "7":
	n += 1
 
if n > 0:
	print("Yes")
else:
	print("No")

### FIXED CODE ###

N = input()
n = 0
if N[0] =="7":
	n += 1
if N[1] == "7":
	n +=1
if N[2] == "7":
	n += 1
 
if n > 0:
	print("Yes")
else:
	print("No")
from heapq import *
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SI(): return sys.stdin.readline()[:-1]

def main():

    inf=10**16
    n,m,s=MI()
    to=[[] for _ in range(n)]
    for _ in range(m):
        u,v,a,b=MI()
        to[u-1].append((v-1,a,b))
        to[v-1].append((u-1,a,b))
    cd=LLI(n)

    dp=[[inf]*5005 for _ in range(n)]
    hp=[]
    heappush(hp,(0,s,0))
    fin=[False]*n
    while hp:
        t,g,u=heappop(hp)
        if dp[u][g]<t:continue
        fin[u]=True
        if sum(fin)==n:break
        c,d=cd[u]
        for i in range(1,10000):
            if g+c*i>5000:
                if dp[u][5000] <= t + d * i: continue
                dp[u][5000] = t + d * i
                heappush(hp, (t + d * i, 5000, u))
                break
            if dp[u][g+c*i]<=t+d*i:continue
            dp[u][g + c * i]=t+d*i
            heappush(hp,(t+d*i,g+c*i,u))
        for v,a,b in to[u]:
            if g-a<0:continue
            if dp[v][g-a]<=t+b:continue
            dp[v][g - a] = t + b
            heappush(hp,(t+b,g-a,v))
    for u in range(1,n):
        print(min(dp[u]))

main()

### FIXED CODE ###

from heapq import *
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SI(): return sys.stdin.readline()[:-1]

def main():

    inf=10**16
    n,m,s=MI()
    to=[[] for _ in range(n)]
    for _ in range(m):
        u,v,a,b=MI()
        to[u-1].append((v-1,a,b))
        to[v-1].append((u-1,a,b))
    cd=LLI(n)

    dp=[[inf]*3005 for _ in range(n)]
    hp=[]
    heappush(hp,(0,min(s,3000),0))
    dp[0][min(s,3000)]=0

    while hp:
        t,g,u=heappop(hp)
        if dp[u][g]<t:continue
        c,d=cd[u]
        if g+c<3000:
            if dp[u][g + c] > t + d:
                dp[u][g + c] = t + d
                heappush(hp, (t + d, g + c, u))
        else:
            if dp[u][3000] > t + d:
                dp[u][3000] = t + d
                heappush(hp, (t + d, 3000, u))
        for v,a,b in to[u]:
            if g-a<0:continue
            if dp[v][g-a]<=t+b:continue
            dp[v][g - a] = t + b
            heappush(hp,(t+b,g-a,v))
    for u in range(1,n):
        print(min(dp[u]))

main()
n = int(input())
a = input().split()
for i in range(n)
 a[i] = int(a[i])

print("{} {} {}".format(min(a), max(a), sum(a)))

### FIXED CODE ###

n = int(input())
a = input().split()
for i in range(n):
 a[i] = int(a[i])

print("{} {} {}".format(min(a), max(a), sum(a)))
import math

N = int(input())
I = int(math.sqrt(N) // 1)

a = []
for i in range(1, I):
  if N%i==0:
    j=N//i
    i = len(list(str(i)))
    j = len(list(str(j)))
    k = max(i, j)
    a.append(k)
print(min(a))

### FIXED CODE ###

N = int(input())
l = []
for a in range(1, 10**5+1):
  if N % a == 0:
    b = N // a
    s = max(len(str(a)), len(str(b)))
    l.append(int(s))
print(min(l))
n,h = (int(i) for i in input().split())
x = [[int(i) for i in input().split()] for i in range(n)]
a,b = 0,[]
for j in x:
	if a < j[0]: a = j[0]
	b.append(j[1])
num = 0
b.sort().reverse()
for j2 in b:
	if j2 >=a and h>0: 
	    h -= j2
		num +=1
	else: break
if h<=0: print(num)
else:
	if h%a==0: print((h-h%a)//a + num)
	else: print((h-h%a)//a + num + 1)

### FIXED CODE ###

def main():
    N, H = map(int, input().split())
    AB = (tuple(map(int, input().split())) for _ in [0] * N)
    a, b = [], []
    appenda, appendb = a.append, b.append
    for i, j in AB:
        appenda(i)
        appendb(j)

    amax = max(a)
    b = [i for i in b if i > amax]
    b.sort(reverse=1)
    energy = H
    if energy <= sum(b):
        attack = 0
        i = 0
        while energy > 0:
            energy -= b[i]
            attack += 1
            i += 1
    else:
        energy -= sum(b)
        attack = (energy + amax - 1) // amax + len(b)

    print(attack)

main()
import sys
N = int(input())
A = list(map(int, input().split()))
for i in A:
    B = 1
    B = B * A[i]
    if B >= 10 ** 18
        print(-1)
        sys.exit()
print(B)

### FIXED CODE ###

import sys
N = int(input())
A = list(map(int, input().split()))
if 0 in A:
    print(0)
    sys.exit()
B = 1
for i in A:
    B = B * i
    if B > 10 ** 18:
        print(-1)
        sys.exit()
print(B)
import math
N,K=map(int, input().split()) 
lst=[]

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

for i in range(1, K+1):
    lst.append(combinations_count(N-K+1, i) * combinations_count(K-i+(i-1), i-1) )
        
for i in range(K):
    print(lst[i]%(10**9+7))

### FIXED CODE ###

import math
n,k=map(int,input().split()) 

def comb(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

mod_num = 10 ** 9 + 7
for i in range(1, k+1):
    if i > n - k + 1:
        print(0)
    else:
        print(comb(n-k+1, i) * comb(k-i+(i-1), i-1) % mod_num)
import math
a, b = map(int, input().split())
print((a*b)//math.gcd(a, b))

### FIXED CODE ###

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

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

a, b = map(int, input().split())
print(lcm(a, b))
X,Y = map(str, input().split())

"A" = 1
"B" = 2
"C" = 3
"D" = 4
"E" = 5
"F" = 6

if X > Y:
    print(">")
elif X < Y:
    print("<")
else:
    print("=")

### FIXED CODE ###

X,Y = map(str, input().split())

A,B,C,D,E,F = 10,11,12,13,14,15

if X > Y:
    print(">")
elif X < Y:
    print("<")
else:
    print("=")
import math
def factorize(a):
    x=2
    ret=[]
    while x<=a:
        while a%x==0:
            a//=x
            ret.append(x)
        x+=1
    return ret
a,b=map(int,input().split())
print(len(set(factorize(math.gcd(a,b))))+1)

### FIXED CODE ###

def factorize(a):
    x=2
    ret=[]
    rt_a=a**0.5
    while x<=a:
        if(x>=rt_a):
            ret.append(a)
            break
        if(a%x==0):
            ret.append(x)
        while a%x==0:
            a//=x
        x+=1
    return ret

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

a,b=map(int,input().split())
print(len(set(factorize(gcd(a,b))))+1)
rint(input().rstrip().replace("1","a").replace("9","1").replace("a","9"))


### FIXED CODE ###

print(input().rstrip().replace("1","a").replace("9","1").replace("a","9"))
n = int(input())
p = list(map(int,input().split()))
i = 1
ans = 0
while i =< n-2:
  if (p[i]-p[i-1])*(p[i]-p[i+1]) < 0:
    ans += 1
  if (p[i]-p[i-1])*(p[i]-p[i+1]) = 0:
    if p[i] < p[i-1] or p[i] < p[i+1]:
      ans += 1
  i += 1
print("%d",ans)

### FIXED CODE ###

n = int(input())
p = list(map(int,input().split()))
i = 1
ans = 0
while i <= n-2:
  if (p[i]-p[i-1])*(p[i]-p[i+1]) < 0:
    ans += 1
  if (p[i]-p[i-1])*(p[i]-p[i+1]) == 0:
    if p[i] < p[i-1] or p[i] < p[i+1]:
      ans += 1
  i += 1
print(ans)
n=input()
ans=0
for i in range(1,n):
  cnt=0
  for j in range(1,n):
    if i%j==0:
      cnt=cnt+1
  if cnt==8:
    ans+=1
print(int(ans))

### FIXED CODE ###

n=int(input())
ans=0
for i in range(1,n+1):
  if i % 2==0:
    continue
  cnt=0
  for j in range(1,n+1):
    if i%j==0:
      cnt=cnt+1
  if cnt==8:
    ans+=1
print(int(ans))
= 998244353
n, m, k = map(int, input().split())
 
fact = [0]*(n+1)
fact[0] = 1
for i in range(1, n+1):
    fact[i] = fact[i-1]*i % MOD
 
invfact= [0]*(n+1)
for i in range(n+1):
    invfact[i] = pow(fact[i], MOD-2, MOD)
 
 
def nCk(n, k):
    return fact[n]*invfact[k]*invfact[n-k]
 
 
ans = 0
for i in range(k+1):
    ans += m*pow(m-1, n-1-i, MOD)*nCk(n-1, i)
    ans %= MOD
print(ans)

### FIXED CODE ###

MOD = 998244353
n, m, k = map(int, input().split())
 
fact = [0]*(n+1)
fact[0] = 1
for i in range(1, n+1):
    fact[i] = fact[i-1]*i % MOD
 
invfact = [0]*(n+1)
for i in range(n+1):
    invfact[i] = pow(fact[i], MOD-2, MOD)
 
 
def nCk(n, k):
    return fact[n]*invfact[k]*invfact[n-k]
 
 
ans = 0
for i in range(k+1):
    ans += m*pow(m-1, n-1-i, MOD)*nCk(n-1, i)
    ans %= MOD
print(ans)
N = int(input())
Alist = list(map(int, input().split()))
memo = [{} for i in range(N)]

def ddp(cur_N, ai):
    if ai in memo[cur_N]:
        return memo[cur_N][ai]
    if cur_N >=N-1:
        return ai
    nx = Alist[cur_N+1]
    ret = max(ai + ddp(cur_N+1, nx), -1*ai + ddp(cur_N+1, -1*nx))
    memo[cur_N][ai] = ret
    return ret
print(ddp(0, Alist[0]))

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)
N = int(input())
Alist = list(map(int, input().split()))
memo = [{} for i in range(N)]

def ddp(cur_N, ai):
    if ai in memo[cur_N]:
        return memo[cur_N][ai]
    if cur_N >=N-1:
        return ai
    aj = Alist[cur_N+1]
    ret = max(ai + ddp(cur_N+1, aj), -1*ai + ddp(cur_N+1, -1*aj))
    memo[cur_N][ai] = ret
    return ret
print(ddp(0, Alist[0]))
print("x"*len(input())

### FIXED CODE ###

print("x"*len(input()))
n = int(input())
List = list(map(int, input().split()))

for i in range(n - 1):
    for j in range(n - i - 1):
        if List[i] == List[i + j + 1]:
            ans = 'NO'

print(ans)ß

### FIXED CODE ###

n = int(input())
List = list(map(int, input().split()))
Sorted = sorted(List)
ans = 'YES'
for i in range(n - 1):
    if Sorted[i] == Sorted[i + 1]:
        ans = 'NO'
        break

print(ans)