Harryxun/stf_run huggingface dataset:
s,w=map(int,input().split())


if s>w:
    print(safe)
else:
    print(unsafe)

### FIXED CODE ###


s,w=map(int,input().split())


if s>w:
    print("safe")
else:
    print("unsafe")
import math
from collections import defaultdict
a, b = map(int, input().split())

g = math.gcd(a, b)
l = defaultdict(int)
for i in range(2, int(g**0.5)+1):
    if g % i == 0:
        while g % i == 0:
            l[i] += 1
            g = g // i
if g != 1:
    l[g] += 1
print(len(l)+1)


### FIXED CODE ###

import fractions
from collections import defaultdict
a, b = map(int, input().split())

g = fractions.gcd(a, b)
l = defaultdict(int)
for i in range(2, int(g**0.5)+1):
    if g % i == 0:
        while g % i == 0:
            l[i] += 1
            g = g // i
if g != 1:
    l[g] += 1
print(len(l)+1)
n = int(input().strip())
data = list(map(int, input().split())
print (sum(data) - n)

### FIXED CODE ###

n = int(input().strip())
data = list(map(int, input().split()))

print (sum(data) - n)
N = int(input())
A = int(input())
B = int (input())

if A == 0:
    print 0 
else: 
    print(  N - 2 )

### FIXED CODE ###

n, a, b = map(int, input().split())
period = a+b
times = n//period
k = n%period
n =  a if k >a else k
print(times*a + n)
def main():
    n, c = map(int, input().split())
    sushi = [None]*n
    for i in range(n):
        sushi[i] = list(map(int, input().split()))
    cal_r = [None] * n
    cal_l = [None] * n
    max_r = [None] * n
    max_l = [None] * n
    cal_r[0] = sushi[0][1] - sushi[0][0]
    max_r[0] = cal_r[0]
    for i in range(1, n):
        cal_r[i] = cal_r[i-1] + sushi[i][1] - (sushi[i][0] - sushi[i-1][0])
        max_r[i] = max(max_r[i-1], cal_r[i])
    cal_l[n-1] = sushi[n-1][1] - (c - sushi[n-1][0])
    max_l[n-1] = cal_l[n-1]
    for i in reversed(range(n-1)):
        cal_l[i] = cal_l[i+1] + sushi[i][1] - (sushi[i+1][0] - sushi[i][0])
        max_l[i] = max(max_l[i+1], cal_l[i])
    ans = max(0, *max_r, *max_l)
    cal_r_2 = [None] * n
    cal_l_2 = [None] * n
    cal_r_2[n-1] = 0
    cal_l_2[0] = 0
    for i in range(n-1):
        cal_r_2[i] = cal_r[i] - sushi[i][0] + max_l[i+1]
    for i in reversed(range(1, n)):
        cal_l_2[i] = cal_l[i] - (c - sushi[i][0]) + max_r[i-1]
    ans = max(ans, *cal_r_2, *cal_l_2)
    print(ans)

if __name__ == "__main__":
    main()

### FIXED CODE ###

def main():
    n, c = map(int, input().split())
    sushi = [None]*n
    for i in range(n):
        sushi[i] = list(map(int, input().split()))
    cal_r = [None] * n
    cal_l = [None] * n
    max_r = [None] * n
    max_l = [None] * n
    cal_r[0] = sushi[0][1] - sushi[0][0]
    max_r[0] = cal_r[0]
    for i in range(1, n):
        cal_r[i] = cal_r[i-1] + sushi[i][1] - (sushi[i][0] - sushi[i-1][0])
        max_r[i] = max(max_r[i-1], cal_r[i])
    cal_l[n-1] = sushi[n-1][1] - (c - sushi[n-1][0])
    max_l[n-1] = cal_l[n-1]
    for i in reversed(range(n-1)):
        cal_l[i] = cal_l[i+1] + sushi[i][1] - (sushi[i+1][0] - sushi[i][0])
        max_l[i] = max(max_l[i+1], cal_l[i])
    max_r_1 = max(max_r)
    max_l_1 = max(max_l)
    ans = max(0, max_r_1, max_l_1)
    cal_r_2 = [None] * n
    cal_l_2 = [None] * n
    cal_r_2[n-1] = 0
    cal_l_2[0] = 0
    for i in range(n-1):
        cal_r_2[i] = cal_r[i] - sushi[i][0] + max_l[i+1]
    for i in reversed(range(1, n)):
        cal_l_2[i] = cal_l[i] - (c - sushi[i][0]) + max_r[i-1]
    max_r_2 = max(cal_r_2)
    max_l_2 = max(cal_l_2)
    ans = max(ans, max_l_2, max_r_2)
    print(ans)

if __name__ == "__main__":
    main()
A,B = map(int,input().split())

ans = 0

if B = 1
print(0)

elif B <= A :
	print(1)

elif (B-A)%(A-1) <= 0 :
	ans = (B-A)//(A-1)+1
	print(ans)
elif (B-A)%(A-1) >= 1 :
	ans = (B-A)//(A-1)+2
	print(ans)

### FIXED CODE ###

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

ans = 0

if B == 1 :
	print(0)

elif B <= A :
	print(1)

elif (B-A)%(A-1) <= 0 :
	ans = (B-A)//(A-1)+1
	print(ans)
elif (B-A)%(A-1) >= 1 :
	ans = (B-A)//(A-1)+2
	print(ans)
import numpy as np
input()
A = np.array(map(list(int, input().split())))
print(A.min() ,A.max() ,A.sum())

### FIXED CODE ###

input()
a = list(map(int, input().split()))
print(min(a) ,max(a) ,sum(a))
words = stdin.readline().rstrip().split()
cards  = [int(x) for x in stdin.readline().rstrip().split()]
drop   = stdin.readline().rstrip()

if drop == words[0]:
    cards[0] -= 1
    print(str(cards[0]) + " " + str(cards[1]))
elif drop == words[1]:
    cards[1] -= 1
    print(str(cards[0]) + " " + str(cards[1]))

### FIXED CODE ###

words = input().split()
cards  = [int(x) for x in input().split()]
drop   = input()

if drop == words[0]:
    cards[0] -= 1
    print(str(cards[0]) + " " + str(cards[1]))
elif drop == words[1]:
    cards[1] -= 1
    print(str(cards[0]) + " " + str(cards[1]))
N,K,L = map(int, input().split())

#print(N,K,L,D,T)

list_D = [set([i]) for i in range(N)]
list_T = [set([i]) for i in range(N)]
root_D = [i for i in range(N)]
root_T = [i for i in range(N)]

#print(list_D)

for _ in range(K):
    d = map(int, input().split())
    d0 = d[0] - 1
    d1 = d[1] - 1
    r0 = root_D[d0]
    r1 = root_D[d1]
    list_D[r0] = list_D[r0] | list_D[r1]
    root_D[r1] = r0
    root_D[d1] = r0
    #print(list_D, root_D)

for _ in range(L):
    t = map(int, input().split())
    t0 = t[0] - 1
    t1 = t[1] - 1
    r0 = root_T[t0]
    r1 = root_T[t1]
    list_T[r0] = list_T[r0] | list_T[r1]
    root_T[r1] = r0
    root_T[t1] = r0
    #print(list_T, root_T)

#和集合
res = [0] * N
for i in range(N):
    rd = root_D[i]
    rt = root_T[i]
    d = list_D[rd]
    t = list_T[rt]
    res[i] = len(d & t)
#print(*(res[i] for i in range(N)))
print(" ".join([str(i) for i in res]))

### FIXED CODE ###

import sys
 
sys.setrecursionlimit(10000)

N,K,L = map(int, input().split())

#print(N,K,L,D,T)

class UnionFind:
    def __init__(self, n):
        self.par = [i for i in range(n+1)]
        self.rank = [0] * (n+1)

    # 検索
    def find(self, x):
        if self.par[x] == x:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]

    # 併合
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if self.rank[x] < self.rank[y]:
            self.par[x] = y
        else:
            self.par[y] = x
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1

    # 同じ集合に属するか判定
    def same_check(self, x, y):
        return self.find(x) == self.find(y)

def execOne(num, uf):
    for _ in range(num):
        d0, d1 = map(int, input().split())
        d0 = d0 - 1
        d1 = d1 - 1
        uf.union(d0, d1)

uf_D = UnionFind(N)
uf_T = UnionFind(N)

execOne(K, uf_D)
execOne(L, uf_T)


pairs = []
for i in range(N):
    pairs.append((uf_D.find(i), uf_T.find(i)))

pairs_count = {}
for p in pairs:
    if not p in pairs_count:
        pairs_count[p] = 1
    else:
        pairs_count[p] += 1

res = [0] * N
for i in range(N):
    res[i] = pairs_count[pairs[i]]
#print(*(res[i] for i in range(N)))
print(" ".join([str(i) for i in res]))
d,t,s=map(int,input().split())
actualTime=d/s
 
if actualTime=<t:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

d,t,s=map(int,input().split())
actualTime=d/s
 
if actualTime<=t:
  print('Yes')
else:
  print('No')
from math import gcd
from itertools import accumulate
def GCD(*args):
    return list(accumulate(*args,gcd))[-1]
def LCM(*args):
    g = GCD(args)
    return list(accumulate([x//g for x in list(args)], lambda x,y:x*y))[-1]*g
_,*T = open(0)
print(LCM(*map(int,T)))

### FIXED CODE ###

def gcd(n,m):
    if n < m:
        t = n
        n = m
        m = t
    r = n % m
    while r > 0:
        n, m = m, r
        r = n % m
    return m
N = int(input())
T = [int(input()) for _ in range(N)]
ans = T[0]
for i in range(1,N):
    g = gcd(ans,T[i])
    ans = ans*T[i]//g
print(ans)
import numpy as np
n,m,k=map(int,input().split())
A=list(map(int, input().split()))
B=list(map(int, input().split()))
ans=0
a, b=[0], [0]
for i in range(N):
    a.append(a[i]+A[i])
for i in range(M):
    b.append(b[i]+B[i])
for i in range(n+1):
    if k<a[i]:
        break
    j=m
    while b[j]>k-a[i]:
        j-=1
    ans=max(ans,i+j)
print(ans)

### FIXED CODE ###

n,m,k=map(int,input().split())
A=list(map(int, input().split()))
B=list(map(int, input().split()))
ans=0
a, b=[0], [0]
for i in range(n):
    a.append(a[i]+A[i])
for i in range(m):
    b.append(b[i]+B[i])
j=m
for i in range(n+1):
    if k<a[i]:
        break
    while b[j]>k-a[i]:
        j-=1
    ans=max(ans,i+j)
print(ans)
S= input()
if S[0::] = S[::-1]
  print(Yes)
else
  print(No)

### FIXED CODE ###

S = input()
N = len(S)
if S == S[::-1] and  S[:(N-1)//2] == S[(N-3)//2::-1] and S[(N+1)//2:] == S[:(N-1)//2:-1] :
  print('Yes')
else:
  print('No')
n = input()
ans = []
for ni in n:
    if ni == '1':
        ans.append('9')
    elif ni == '9':
        ans.append('1')
    else:
        ans.append(ni)
print(ans[0]+ans[1]+ans[2])

### FIXED CODE ###

n = input()
ans = []
for ni in n:
    if ni == '1':
        ans.append('9')
    elif ni == '9':
        ans.append('1')
    else:
        ans.append(ni)
print(ans[0]+ans[1]+ans[2])
n = int(input())
ab = [list(map(int,input().split())) for i in range(n)]

ab.sort(key= lambda x:x[1])
time = 0

for i in range(n):
    time += ab[i][0]
    if time > ab[i][1]:
        ans = "No"
        break
else:
    ans = "Yes"

print(ans)

### FIXED CODE ###

s = input()

for i in range(3):
    if s[i] == s[i+1]:
        ans = "Bad"
        break
else:
    ans = "Good"

print(ans)
a,b,k=map(int,input().split())
s=range(a+1,b+1)
for i in (sorted(s[:k]|s[k:]):print(i)

### FIXED CODE ###

a,b,k=map(int,input().split())
s=range(a,b+1)
for i in sorted(set(s[:k])|set(s[-k:])):print(i)
def solve():
    N = int(input())
    S = input()
    count = 0

    for i in range(N):
        if(S[i] == "A" and S[i+1] == "B" and S[i+2] == "C"):
            count += 1

    print(count)


if __name__ == "__main__":
    solve()

### FIXED CODE ###

def solve():
    N = int(input())
    S = input()
    count = 0

    for i in range(N-2):
        if(S[i] == "A" and S[i+1] == "B" and S[i+2] == "C"):
            count += 1

    print(count)


if __name__ == "__main__":
    solve()
N = int(input())
S = list(input()) 
result_list = []
for i in range(N):    
    result_list.append(S[:i].count("W") + S[i+1:].count("E"))
print(min(result_list))

### FIXED CODE ###

A, B = map(int, input().split())
print (max(A + B, A - B, A * B))
import sys
N,M=map(int, input().split())
a=[]
b=[]
c=[]
for m in range (0,M):
  A,B,C=map(int, input().split() )
  a+=[A]
  b+=[B]
  c+=[C]
V=[0]*N# iに到達するときの最大得点
moji=[1]+[0]*(N-1)#infなら0をかえす
 
for n in range(N-1):
  for m in range(M):
    u=a[m]
    v=b[m]
    if moji[a[m]-1]:#共に有限の時はやる
      if moji[b[m]-1]:
        V[b[m]-1]=max(V[b[m]-1],V[a[m]-1]+c[m])
      else:
        V[b[m]-1]=V[a[m]-1]+c[m]
        moji[b[m]-1]=1
 
moji2=[0]*N
for n in range(N):
  for m in moji:
    u=a[m]
    v=b[m]
    if V[a[m]-1]+c[m]>V[b[m]-1]:
      V[b[m]-1]=V[a[m]-1]+c[m]
      moji2[b[m]-1]=1
    if moji2[a[m]-1]:
      moji2[b[m]-1]=1
if moji2[N-1]:
  print("inf")
else:
  print(V[N-1])

### FIXED CODE ###

import sys
N,M=map(int, input().split())
a=[]
b=[]
c=[]
for m in range (0,M):
  A,B,C=map(int, input().split() )
  a+=[A]
  b+=[B]
  c+=[C]
V=[0]+[-10**12]*(N-1)# iに到達するときの最大得点
 
for n in range(N-1):
  for m in range(M):
    u=a[m]
    v=b[m]
    if V[b[m]-1]<V[a[m]-1]+c[m]:#共に有限の時はやる
      V[b[m]-1]=V[a[m]-1]+c[m]
 
moji2=[0]*N
for n in range(N):
  for m in range(M):
    u=a[m]
    v=b[m]
    if V[b[m]-1]<V[a[m]-1]+c[m]:#共に有限の時はやる
      V[b[m]-1]=V[a[m]-1]+c[m]
      moji2[b[m]-1]=1
      if moji2[N-1]:
        print("inf")
        sys.exit()
print(V[N-1])
N = int(input())
AB = [list(map(int, input().split())) for _ in range(N - 1)]


class Tree:
    def __init__(self, v):
        self.v = v
        self.neighbors = []

    def set_rank(self, rank, parent):
        self.rank = rank
        for neighbor in self.neighbors:
            if neighbor is parent:
                continue
            neighbor.set_rank(rank=rank + 1, parent=self)


trees = {i: Tree(i) for i in range(1, N + 1)}

for a, b in AB:
    trees[a].neighbors.append(trees[b])
    trees[b].neighbors.append(trees[a])
trees[1].set_rank(1, None)

exit()
group0 = [node.v for node in trees.values() if node.rank % 2 == 0]
group1 = [node.v for node in trees.values() if node.rank % 2]
x = [set(), set(), set()]
for i in range(1, N + 1):
    x[i % 3].add(i)
if len(group1) < len(group0):
    group1, group0 = group0, group1
result = {}
if len(group0) <= len(x[0]):
    while group0 and x[0]:
        result[group0.pop()] = x[0].pop()
    y = x[0] | x[1] | x[2]
    while group1 and y:
        result[group1.pop()] = y.pop()
else:
    while x[2] and group0:
        result[group0.pop()] = x[2].pop()
    while x[1] and group1:
        result[group1.pop()] = x[1].pop()
    while group0 and x[0]:
        result[group0.pop()] = x[0].pop()
    while group1 and x[0]:
        result[group1.pop()] = x[0].pop()
    if group0 or group1:
        print(-1)
        exit()

print(' '.join(str(result[i]) for i in range(1, N + 1)))


### FIXED CODE ###

import sys
sys.setrecursionlimit(1000000000)
N = int(input())
AB = [list(map(int, input().split())) for _ in range(N - 1)]


class Tree:
    def __init__(self, v):
        self.v = v
        self.neighbors = []

    def set_rank(self, rank, parent):
        self.rank = rank
        for neighbor in self.neighbors:
            if neighbor is parent:
                continue
            neighbor.set_rank(rank=rank + 1, parent=self)


trees = {i: Tree(i) for i in range(1, N + 1)}

for a, b in AB:
    trees[a].neighbors.append(trees[b])
    trees[b].neighbors.append(trees[a])
try:
    trees[1].set_rank(1, None)
except:
    print(-1)
    exit()

group0 = [node.v for node in trees.values() if node.rank % 2 == 0]
group1 = [node.v for node in trees.values() if node.rank % 2]
x = [set(), set(), set()]
for i in range(1, N + 1):
    x[i % 3].add(i)
if len(group1) < len(group0):
    group1, group0 = group0, group1
result = {}
if len(group0) <= len(x[0]):
    while group0 and x[0]:
        result[group0.pop()] = x[0].pop()
    y = x[0] | x[1] | x[2]
    while group1 and y:
        result[group1.pop()] = y.pop()
else:
    while x[2] and group0:
        result[group0.pop()] = x[2].pop()
    while x[1] and group1:
        result[group1.pop()] = x[1].pop()
    while group0 and x[0]:
        result[group0.pop()] = x[0].pop()
    while group1 and x[0]:
        result[group1.pop()] = x[0].pop()
    if group0 or group1:
        print(-1)
        exit()

print(' '.join(str(result[i]) for i in range(1, N + 1)))
def main():
    a,b,t = map(int,input().split())
    ans = 0
    for i in (t + 1):
        if i % a == 0:
            ans += b
    print(ans)
main()

### FIXED CODE ###

def main():
    a,b,t = map(int,input().split())
    ans = 0
    for i in range(1,t + 1, 1):
        if i % a == 0:
            ans += b
    print(ans)
main()
a = int(input())
b = str(a)
over = int(b[:2])
under = int(b[2:])
if 0<over<13 and 0<under<13:
   print("AMBIGUOUS")
else if 0<over<13 and (1>under or under>12):
   print("YYMM")
else if(0<under<13 and (1>over or over>12):
   print("MMYY")
else:
   print("NA")

### FIXED CODE ###

a = input()
over = int(a[:2])
under = int(a[2:])
if 0<over<13 and 0<under<13:
   print("AMBIGUOUS")
elif 0<over<13 and (1>under or under>12):
     print("MMYY")
elif 0<under<13 and (1>over or over>12):
     print("YYMM")
else:
     print("NA")
N=int(raw_input())
lis = []
for i in N:
	lis.append(int(raw_input()))
if sum(lis) % 0 == 0:
	print sum(lis)-min(lis)
else:
	print sum(lis)

### FIXED CODE ###

N=int(raw_input())
lis = []
for i in range(0,N):
	num = int(raw_input())
	lis.append(num)
get = sum(lis)
if sum(lis) % 10 == 0:
	for j in range(0,N-1):
		if min(lis) % 10 != 0:
			print get - min(lis)
			break
		lis.remove(min(lis))
	else:
		print 0
else:
	print get
iN,iM = [int(x) for x in input().split()]
iD = 10**9 +7 #法

def fPrimeCounter(iM):
    iS = int(iM ** 0.5) + 1
    aRet = []
    for i in range(2,iS + 1):
        iCounter = 0
        while iM % i == 0:
            iM /= i
            iCounter += 1
        if 0 < iCounter : aRet.append(iCounter)
        if iM == 1 : break
    if 1 < iM  : aRet.append(1)
    return aRet
def fnCr(iN,iR,iD):
    iR = min(iR,iN-iR)
    if iR == 1 :
        return iN
    return (iN % iD) * pow(iR,iD-2,iD) * fnCr(iN-1,iR-1,iD) % iD

aP = fPrimeCounter(iM)
if aP == []:
    print(1)
    exit()
iRet = 1
for i in aP:
    # i + iN -1  C  iN -1
    iRet *= fnCr(i+iN-1,i,iD)
iRet %= iD
print(iRet)


### FIXED CODE ###

iN,iM = [int(x) for x in input().split()]
iD = 10**9 +7 #法

def fPrimeCounter(iM):
    i = 2
    iS = int(iM ** 0.5) + 1
    aRet = []
    while i < iS or iM != 1:
        iCounter = 0
        while iM % i == 0:
            iM = iM // i
            iCounter += 1
        if 0 < iCounter : aRet.append(iCounter)
        i += 1

    return aRet

#二分累乗法 iDを法として
def fBiPow(iX,iN,iD):
    iY = 1
    while iN > 0:
        if iN % 2 == 0:
            iX = iX * iX % iD
            iN = iN // 2
        else:
            iY = iX * iY % iD
            iN = iN - 1
    return iY

aP = fPrimeCounter(iM)
if aP == [] :
    print (1)
else:
    iMax = max(aP) + iN - 1
    aM = [1] * (iMax + 1)
    #階乗 iD を法とした
    for i in range(1,iMax + 1):
        aM[i] = aM[i-1] * i  % iD
    aInvM = [1]* (iMax + 1)
    aInvM[iMax] = fBiPow(aM[iMax],iD-2,iD)
    #階乗の逆元 iD を法とした
    for i in range(iMax,0,-1):
        aInvM[i-1] = aInvM[i]*i % iD

    iRet = 1
    for i in aP:
        # i + iN -1  C  iN -1
        iRet *= aM[i+iN-1] * aInvM[iN-1] * aInvM[i] % iD
    iRet %= iD
    print(iRet)
while True:
    try:
        a,b,c,d,e,f = (map(int,input().split()))

        n = d/a
        a = n*a
        b = n*b
        c = n*c

        y = (c-f)/(b-e)
        x = (c-(b*y))/a

        print("{0:.3f} {1:.3f}".format(x, y))
    except EOFError:
        break


### FIXED CODE ###

EPS = 0.0001
while True:
    try:
        a = list(map(float, input().split()))
        dd = a[0]*a[4]-a[3]*a[1]
        d1 = a[2]*a[4]-a[5]*a[1]
        d2 = a[0]*a[5]-a[3]*a[2]
        print("{0:.3f} {1:.3f}".format(d1/dd+EPS, d2/dd+EPS))
    except EOFError:
        break
n=int(input())
t=[0]*n

for lop2 in range(n):
    t[lop2]=int(input())

ans=t[0]

for lop in range(1,n):
    ans=lcm(ans,t[lop])
print(int(ans))


def gcd(a,b):
    if a<b:
     c=a
     a=b
     b=c
     
    c=a%b
    return b
 
def lcm(a,b):
    c=gcd(a,b)
    return a/c*b
 
 
 
n=int(input())
t=[0]*n
 
for lop2 in range(n):
    t[lop2]=int(input())
 
ans=t[0]
 
for lop in range(1,n):
    ans=lcm(ans,t[lop])
print(int(ans))

### FIXED CODE ###

'''
def gcd(a,b):
    if a<b:
     c=a
     a=b
     b=c

    c=a%b

    if c==0:
     return b
    else:
     return gcd(b,c)
'''

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

def lcm(e,f):
    c=gcd(e,f)
    g=e*f
    return g//c



n=int(input())
t=[0]*n

for lop2 in range(n):
    t[lop2]=int(input())

ans=t[0]

for lop in range(1,n):
    ans=lcm(ans,t[lop])
print(int(ans))
from heapq import heappop, heappush
mod = 10**9+7
n, k = map(int, input().split())
a = [int(x) for x in input().split()]

pl = []
mn = []
zr = []

tmp = 1
cnt = 0

for x in a:
    if x > 0:
        pl.append(x)
    elif x < 0:
        mn.append(-x)
    else:
        zr.append(x)

pl = sorted(pl, reverse=True)
mn = sorted(mn, reverse=True)

ans = 0

if len(mn) >= k and k % 2:
    tmp = 1
    for i in range(1, k+1):
        tmp *= mn[-i]
        tmp %= mod
    ans = -tmp

if len(pl) == 0:
    tmp = 1
    for i in range(1, k+1):
        tmp *= mn[-i]
        tmp %= mod
    ans = -tmp
    print(ans % mod)
    exit()

if len(zr) > 0:
    ans = max(0, ans)

pl_cum = [1]
for i, x in enumerate(pl):
    pl_cum.append(pl_cum[-1]*x % mod)

mn_cum = [1]
for i, x in enumerate(mn):
    mn_cum.append(mn_cum[-1]*x % mod)


for p in range(0, k+1, 2):
    if len(mn) < p:
        break
    first = False
    if len(pl) >= k-p:
        first = True
        pl_ind = k-p
        mn_ind = p
        break

if not first:
    print(ans % mod)
    exit()

while pl_ind-2 > -1 and mn_ind+1 < len(mn):
    if pl[pl_ind-1]*pl[pl_ind-2] <= mn[mn_ind]*mn[mn_ind+1]:
        pl_ind -= 2
        mn_ind += 2
    else:
        break

if pl_ind < 0:
    ans = mn_cum[mn_ind]
else:
    ans = pl_cum[pl_ind]*mn_cum[mn_ind]

print(ans % mod)


### FIXED CODE ###

from heapq import heappop, heappush
mod = 10**9+7
n, k = map(int, input().split())
a = [int(x) for x in input().split()]


def sgn(x):
    if x >= 0:
        return 0
    elif x < 0:
        return 1


pl = []
mn = []

for x in a:
    if x >= 0:
        pl.append(x)
    elif x < 0:
        mn.append(-x)

pl = sorted(pl, reverse=True)
mn = sorted(mn, reverse=True)


b = [(abs(a[i]), sgn(a[i])) for i in range(n)]
b = sorted(b, reverse=True)

c = [0, 0]
for i in range(k):
    c[b[i][1]] += 1


def solve(c):
    ans = 1
    for i in range(c[0]):
        ans *= pl[i]
        ans %= mod
    for i in range(c[1]):
        ans *= mn[i]
        ans %= mod
    if c[1] % 2:
        ans = (-ans) % mod
    return ans


if c[1] % 2 == 0:
    print(solve(c))
    exit()

if len(mn) == n and k % 2:
    tmp = 1
    for i in range(k):
        tmp *= mn[-i-1]
        tmp %= mod
    ans = -tmp
    print(ans % mod)
    exit()

ans = 0

chk1 = False
chk2 = False

if c[0] <= len(pl) - 1:
    chk1 = True

if 0 < c[0] and c[1] <= len(mn)-1:
    chk2 = True

if chk1 and chk2:
    tmp1 = pl[c[0]]*pl[c[0]-1]
    tmp2 = mn[c[1]]*mn[c[1]-1]
    if tmp1 > tmp2:
        c[0] += 1
        c[1] -= 1
        print(solve(c))
    else:
        c[0] -= 1
        c[1] += 1
        print(solve(c))
elif chk1:
    c[0] += 1
    c[1] -= 1
    print(solve(c))
elif chk2:
    c[0] -= 1
    c[1] += 1
    print(solve(c))
else:
    print(solve(c))
a,b=map(int,input().split());print(6-a-b)

### FIXED CODE ###

print(6-int(input())-int(input()))
import math
import sympy


def make_divisors(n):
    lower_divisors, upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]


def using_sqrt(limit):
    n = []
    for k in range(2, limit + 1):
        factor = 0

        # 2以外の偶数は素数ではないので無視する
        if k % 2 == 0 and k != 2:
            continue

        # 繰り返しの上限を対象の平方根にする
        for divisor in range(2, math.floor(math.sqrt(k)) + 1):
            if k % divisor == 0:
                factor += 1

        if factor == 0:
            n.append(k)

    return n


def isPrime(limit):
    n = []
    for k in range(limit, limit + 1):
        factor = 0

        # 2以外の偶数は素数ではないので無視する
        if k % 2 == 0 and k != 2:
            continue

        # 繰り返しの上限を対象の平方根にする
        for divisor in range(2, math.floor(math.sqrt(k)) + 1):
            if k % divisor == 0:
                factor += 1

        if factor == 0:
            return True
    return False


n = int(input())
prime = using_sqrt(10**5)
prev = []

if n > 1 and isPrime(n):
    print(1)
    exit()


def check(n, prev):
    divs = make_divisors(int(n))
    flag = False
    for i in divs[1:]:
        for p in prime:
            e = math.log(i, p)
            if e.is_integer() and i not in prev:
                prev.append(i)
                flag = True
                check(n/i, prev)
                break
        if flag:
            break


check(n, prev)
print(len(prev))

### FIXED CODE ###

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append([i, cnt])

    if temp != 1:
        arr.append([temp, 1])

    if arr == []:
        arr.append([n, 1])

    return arr


n = int(input())
if n == 1:
    print(0)
    exit()
z = factorization(n)
cnt = 0
for item in z:
    p = item[0]
    e = item[1]
    num = 1
    while e >= num:
        e -= num
        cnt += 1
        num += 1

print(cnt)
X, A = map(int, input(),split())
print(0 if X < A else 10)

### FIXED CODE ###

X, A = map(int, input().split())
print(0 if X < A else 10)