Harryxun/stf_run huggingface dataset:
N, K = map(int, input().split())
Aall = set(range(1, N))
Ak = []
for i in range(N*2):
  #d = input()
  A = list(map(int, input().split()))
  if i % 2 == 1:
    Ak.extend((A))
print(len(Aall - set(Ak)))

### FIXED CODE ###

N, K = map(int, input().split())
Aall = set(list(range(1, N+1)))
A = []
for i in range(N*2):
  try: 
    if i % 2 != 0:
      a = list(map(int, input().split()))
      A.extend(a)
    else:
      d = list(map(int, input().split()))
  except EOFError:
    d = 1
print(len(Aall-set(A)))
a, b, c, d = map(int, input().split())

x,y = c,d

# 最小公倍数
while y != 0:
	x,y = y,x%y

x = (c*d)//x

count1 = b - (b//c + b//d -b//x)
count2 = (a - 1) - ((a-1)//c + (a-1)//d -(a-1)//x) 
print(count1 - count2)

### FIXED CODE ###

s = str(input())
is_good = True
for i in range(len(s)-1):
    if s[i] == s[i+1]:
        #print('Bad')
        is_good = False
        break

print('Good' if is_good else 'Bad')
a, b, q = map(int, input().split())
sno = [-10e6] + [int(input()) for _ in range(a)] + [10e6]
tno = [-10e6] + [int(input()) for _ in range(b)] + [10e6]
dis = [int(input()) for _ in range q]

for i in range(q):
 
    sl = 0
    sr = 0
    tl = 0
    tr = 0
 
    for j in range(a+2):
        if sno[j] >= dis[i]:
            sl = dis[i] - sno[j-1]
            sr = sno[j] - dis[i]
            break
        else:
            pass
 
    for k in range(b+2):
        if tno[k] >= dis[i]:
            tl = dis[i] - tno[k-1]
            tr = tno[k] - dis[i]
            break
        else:
            pass
 
    lds = max(sl, tl)
    rds = max(sr, tr)
    ans = min(lds, rds)
    print(ans)

### FIXED CODE ###

date = input()
tdate=[]
 
for s in date:
  tdate.append(s)
  
if tdate[5] != "0":
  mon = int(tdate[5] + tdate[6])
else:
  mon = int(tdate[6])


if mon <= 4:
  print("Heisei")
else:
  print("TBD")
a,b=map(int,input().split())
L=[list(map(str,input())) for i in rage(a)]
L.insert(0,[*]*(a+2))])
L.insert(-1,[*]*(a+2))])
for i in L
print("".join(i))

### FIXED CODE ###

import sys
input = sys.stdin.readline
h,w=map(int,input().split())
answer=["#"*(w+2)]
for _ in range(h):
    answer.append("#"+input()[:-1]+"#")
answer.append("#"*(w+2))
print(*answer,sep="\n")
seven = 0
five = 0

A,B,C = map(int,input().split())
if A == 7:
    seven += 1
elif A == 5:
    five += 1
if B == 7:
    seven += 1
elif B == 5:
    five += 1
if C == 7:
    seven += 1
elif C == 5:
    five += 1
    
if seven == 1 or five == 2:
    print("YES")
else:
    print("NO")

### FIXED CODE ###

seven = 0
five = 0

A,B,C = map(int,input().split())
if A == 7:
    seven += 1
elif A == 5:
    five += 1
if B == 7:
    seven += 1
elif B == 5:
    five += 1
if C == 7:
    seven += 1
elif C == 5:
    five += 1
    
if seven == 1 or five == 2:
    print("YES")
else:
    print("NO")
from sys import stdin
from math import gcd



rs = lambda: stdin.readline().strip()
ri = lambda: int(rs())
rsl = lambda: stdin.readline().split()
rim = lambda: map(int, rsl())
ril = lambda: list(rim())


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


def findGCD(lst):
    ret = 1
    for i in range(len(lst)-1):
        ret = max(ret, gcd(lst[i], lst[i+1]))
    return ret


def findLCM(lst):
    ret = max(lst)
    for i in range(len(lst)-1):
        ret = min(ret, lcm(lst[i], lst[i+1]))
        print(lcm(lst[i], lst[i+1]))
    return ret


N = ri()
integers = list(rim())
gc = findGCD(integers)
cnt = 0
for num in integers:
    if num % (gc*2) != 0:
        cnt += 1

if cnt > 1:
    print(gc)
else:
    print(gc*2)

### FIXED CODE ###

from sys import stdin, exit
from fractions import gcd


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

# List if length of 2 or shorter
if len(A) <= 2:
    print(max(A))
    exit()

# Left Side = [A0, 0, 0, 0, 0]
left_side = [0 for _ in range(N)]
left_side[0] = A[0]

# Right Side = [0, 0, 0, 0, An]
right_side = [0 for _ in range(N)]
right_side[-1] = A[-1]

for i in range(N - 1):  # DP: L1 = gcd(L0, A1); Maximum GCD on very RIGHT of list  (Dir -->)
    left_side[i + 1] = gcd(left_side[i], A[i + 1])

for i in range(1, N):   # DP: Rn-2 = gcd(An-2, Rn-1); Maximum GCD on very LEFT of list  (Dir <--)
    right_side[-1 * (i+1)] = gcd(A[-1*(i+1)], right_side[-1*i])

max_gcd = 1

# Left
max_gcd = max(max_gcd, right_side[1])
# Max of Right and Left
max_gcd = max(max_gcd, left_side[-2])

for i in range(1, N - 1):
    left = left_side[i - 1]
    # We exclude the number at i here, and compare whether new gcd is greater than previous
    right = right_side[i + 1]

    max_gcd = max(max_gcd, gcd(left, right))

print(max_gcd)
import copy
[n,x]=list(map(int,input().split()))
a=list(map(int,input().split()))
a0=copy.copy(a)
ans=0
for i in range(n-1):
	while a[i]+a[i+1]>x:
		a[i+1]-=1
for i in range(n):
	ans+=a0[i]-a[i]
print(ans)

### FIXED CODE ###

name=input().split()
b=list(name[1])
print("A"+b[0]+"C")
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n //= i
      table.append(i)
    i += 1
  if n > 1:
    table.append(n)
  return table

A, B = map(int, input().split())
x = gcd(A, B)
prime_list = prime_decomposition(x)
s = set(prime_list)
s.add(1)
for y in s:
    if y == x and len(s) != 1:
        s -= {x}
        
print(len(s))

### FIXED CODE ###

import fractions

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

GCD = fractions.gcd(A, B)

def pf(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

print(len(set(pf(GCD))) + 1)
import numpy as np

n, W = map(int, input().split())
w, v = [0] * n, [0] * n
for i in range(n):
    w[i], v[i] = map(int, input().split())
ndp = np.zeros(W + 1, dtype=np.int64)

for w, v in zip(w, v):
    # [:w]は品物の重量がナップサックの空きよりも重いので更新しない。
    # ndp[w:] は通常DPでのdp[i][w]=dp[i-1][w]。そのままでの更新。
    # ndp[:-w] + v は[:-w]が[w-weight]に相当。
    np.maximum(ndp[:-w] + v, ndp[w:], out=ndp[w:])

print(ndp[-1])


### FIXED CODE ###

N, W = map(int, input().split())
V = 10 ** 5
inf = 10 ** 18
dp = [inf] * (V + 1)
dp[0] = 0

for n in range(1, N+1):
    w, v = map(int, input().split())
    for i in range(v, V+1)[::-1]:
        if dp[i-v]+w <= W:
            dp[i] = min(dp[i], dp[i-v]+w)

for i in range(V+1)[::-1]:
    if dp[i] < inf:
        print(i)
        break
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

l = [a, b, c, d, e]
s = []
for i in l:
    if i % 10 > 0:
        s.append(10 - (i % 10))    
s.sort()
del s[-1]
ans = sum(l) + sum(s)
print(ans)

### FIXED CODE ###

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

l = [a, b, c, d, e]
s = []

for i in l:
    if i % 10 > 0:
        s.append(10 - (i % 10))
if len(s) > 0:
    s.sort()
    del s[-1]

ans = sum(l) + sum(s)
print(ans)
import sys
sys.setrecursionlimit(10 ** 6)

MOD = 10**9 + 7


def input():
    return sys.stdin.readline()[:-1]

class Combination:
    """
    O(n)の前計算を1回行うことで，O(1)でnCr mod mを求められる
    n_max = 10**6のとき前処理は約950ms (PyPyなら約340ms, 10**7で約1800ms)
    使用例：
    comb = Combination(1000000)
    print(comb(5, 3))  # 10
    """

    def __init__(self, n_max, mod=10**9+7):
        self.mod = mod
        self.modinv = self.make_modinv_list(n_max)
        self.fac, self.facinv = self.make_factorial_list(n_max)

    def __call__(self, n, r):
        return self.fac[n] * self.facinv[r] % self.mod * self.facinv[n-r] % self.mod

    def make_factorial_list(self, n):
        # 階乗のリストと階乗のmod逆元のリストを返す O(n)
        # self.make_modinv_list()が先に実行されている必要がある
        fac = [1]
        facinv = [1]
        for i in range(1, n+1):
            fac.append(fac[i-1] * i % self.mod)
            facinv.append(facinv[i-1] * self.modinv[i] % self.mod)
        return fac, facinv

    def make_modinv_list(self, n):
        # 0からnまでのmod逆元のリストを返す O(n)
        modinv = [0] * (n+1)
        modinv[1] = 1
        for i in range(2, n+1):
            modinv[i] = self.mod - self.mod//i * \
                modinv[self.mod % i] % self.mod
        return modinv


def main():
    N,K = map(int, input().split())
    comb = Combination()
    for i in range(1, K+1):
        print(comb(N-K+1, i)*comb(K-1, i-1)%MOD)


if __name__ == "__main__":
    main()


### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 6)


def input():
    return sys.stdin.readline()[:-1]


def main():
    N,K = map(int, input().split())
    mod = 10**9+7
    fac = [1]*(N+1)
    rev = [1]*(N+1)
    
    for i in range(1,N+1):
        fac[i] = i*fac[i-1]%mod
        rev[i] = pow(fac[i], mod-2, mod)
    
    comb = lambda a,b:(fac[a]*rev[a-b]*rev[b])%mod
    for i in range(1, K+1):
        if i >N-K+1:
            print(0)
            continue
        print(comb(N-K+1, i)*comb(K-1, i-1)%mod)


if __name__ == "__main__":
    main()
a, b, x = map(int, input().split())

if a**2 * b <= 2 * x:
    h = (a**2 * b - x) / a**2 * 2
    theta = h / (a**2 + h**2)**0.5
    ans = math.degrees(math.asin(theta))
else:
    h = 2 * x / a / b
    theta = h / (b**2 + h**2)**0.5
    ans = math.degrees(math.acos(theta))

print(ans)

### FIXED CODE ###

import math
a, b, x = map(int, input().split())

if a**2 * b <= 2 * x:
    h = (a**2 * b - x) / a**2 * 2
    theta = h / (a**2 + h**2)**0.5
    ans = math.degrees(math.asin(theta))
else:
    h = 2 * x / a / b
    theta = h / (b**2 + h**2)**0.5
    ans = math.degrees(math.acos(theta))

print(ans)
from sys import stdin
N,M,K=list(map(int,input().split()))
friend_list=[set() for _ in range(N+1)]
block_list=[set() for _ in range(N+1)]
def friend_tansaku(i,j):
    color.add(j)
    for friend in friend_list[j]:
        if friend not in color:
            if friend not in block_list[i] and friend not in candidate and friend not in friend_list[i]:
                candidate.add(friend)
                count[0]+=1
            friend_tansaku(i,friend)




for _ in range(M):
   a,b= list(map(int, input().split()))
   friend_list[a].add(b)
   friend_list[b].add(a)
for _ in range(K):
    a, b = list(map(int, input().split()))
    block_list[a].add(b)
    block_list[b].add(a)
for i in range(1,N+1):
    count=[0]
    color =set()
    candidate=set()
    friend_tansaku(i,i)
    if i==N:print(count[0])
    else:print(count[0],end=" ")

### FIXED CODE ###

from sys import stdin
import sys
import copy
sys.setrecursionlimit(200000)
N,M,K=list(map(int,input().split()))
counter=[[None,None] for i in range(N+1)]
friend_list=[set() for _ in range(N+1)]
block_list=[set() for _ in range(N+1)]
def friend_tansaku(i,j):
    color.add(j)
    cnt[0]+=1
    for friend in friend_list[j]:
        if friend not in color :
            friend_tansaku(i,friend)





for _ in range(M):
   a,b= list(map(int, input().split()))
   friend_list[a].add(b)
   friend_list[b].add(a)
for _ in range(K):
    a, b = list(map(int, input().split()))
    block_list[a].add(b)
    block_list[b].add(a)
for i in range(1,N+1):
    cnt=[0]
    color =set()
    if counter[i][0] is None:
        friend_tansaku(i,i)
        cnt=cnt[0]
        for aa in color:
            counter[aa]=[color,cnt]
    color,cnt =counter[i][0],counter[i][1]
    for k in block_list[i]:
        if k not in color:
            cnt+=1

    count=cnt-(len(friend_list[i])+len(block_list[i]))-1
    if i==N:print(count)
    else:print(count,end=" ")
def main():
    
    N = int(input())

    A = [list(map(int, input().split())) for _ in range(N)]

    # check = [[True] + [False] * (N - 2) for _ in range(N)] #True準備完了、False試合不可
    check = [0] * N #i番目の次の相手のindex

    ans = 0
    i = 0
    tmp = 0
    count = 0
    while tmp < 2 * N + 2:
        if tmp > N + 500:
            i += 290
        if i % N == 0:
            ans += 1
            flag  = [True] * N #試合をしたかどうかチェック
            i = 0
            
        if check[i] >= N - 1 or flag[i] == False:
            i += 1
            tmp += 1
            continue
        b = A[i][check[i]]
        # print (b)
        if A[b - 1][check[b - 1]] - 1 == i and flag[b - 1]: #試合できる時
            check[i] += 1
            check[b - 1] += 1
            flag[i] = False
            flag[b - 1] = False
            tmp = 0
            count += 1
            if count == (N * (N - 1))//2:
                print (ans)
                exit()
        i += 1
        tmp += 1
    
    print (-1)
    return 
            
if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
input = sys.stdin.readline
from collections import deque

N = int(input())
A = [list(reversed(list(map(lambda x: int(x) - 1, input().split())))) for _ in range(N)]
B = {i: row for i, row in enumerate(A)}

# print (A)
# print (B)

end = 0

for k in range(8000):
    used = set()
    dels = []
    for i, q in B.items():
        if not q:
            continue
        if i in used:
            continue
        j = q[-1]
        if j in used:
            continue
        if A[j][-1] == i:
            A[j].pop()
            A[i].pop()
            used.add(i)
            used.add(j)
            if not A[i]:
                end += 1
                dels.append(i)
            if not A[j]:
                end += 1
                dels.append(j)
    if not used:
        print (-1)
        exit()
    
    if end == N:
        print (k + 1)
        exit()
    
    for i in dels:
        del B[i]
        
print (N * (N - 1) // 2)
import fileinput
import math
for line in fileinput.input():
    if line == "\n":
        break
    else:
        a, b = map(int, line.split())
        g = math.gcd(a, b)
        lcm = a * b // g
        print(g, lcm)

### FIXED CODE ###

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

import fileinput
import math
for line in fileinput.input():
    a, b = map(int, line.split())
    g = gcd(a, b)
    lcm = a * b // g
    print(g, lcm)
A=sorted([int(i) for i in input().split()])
if A==[5,5,7]:
  print(“YES”)
else:
  print(“NO”)

### FIXED CODE ###

A=sorted([int(i) for i in input().split()])
if A==[5,5,7]:
  print("YES")
else:
  print("NO")
import sys
N = int(input())
num_list = 0
for i in range(N):
  a = int(input())
  num_list.append(a)
if 0 in num_list:
  print(0)
else:
  mul = 1
  for a in num_list:
    mul *= a
    if mul > 10**18:
      print(-1)
      sys.exit()
  print(mul)

### FIXED CODE ###

import sys
N = int(input())
num_list = [int(i) for i in input().split()]
if 0 in num_list:
  print(0)
else:
  mul = 1
  for a in num_list:
    mul *= a
    if mul > 10**18:
      print(-1)
      sys.exit()
  print(mul)
a, b = [i for i in input().split()]

if a >= 13:
  print(b)
elif a>=6 and a<=12:
  print(b/2)
else:
  print(0)

### FIXED CODE ###

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

if a >= 13:
  print(b)
elif a>=6 and a<=12:
  print(int(b/2))
else:
  print(0)
s=input()
if s[0]!="A" and s[2:-1].count("C")!=1:
      print("WA")
      exit()

s=list(s)
s[0]="a"
s.remove("C")
if "".join(s).islower():
      print('AC')
else:
      print("WA")

### FIXED CODE ###

s=input()
if s[0]!="A":
      print("WA")
      exit()
if s[2:-1].count("C")!=1:
      print("WA")
      exit()

s=list(s)
s[0]="a"
s.remove("C")
if "".join(s).islower():
      print('AC')
else:
      print("WA")
from itertools import *
X,Y = map(int,input().split())
if X*2 == Y:
    print("Yes")
elif X*4 == Y:
    print("Yes")
else:
    tmp = [2 for i in range(20)]+[4 for i in range(20)]
    li = set(combinations(tmp,X))
    for i in li:
        if sum(i) == Y:
            print("Yes")
            exit()
    print("No")


### FIXED CODE ###

print(list(map(int,input().split())).index(0)+1)
n = int(input())
a = list(map(long, input().split()))

ans = 0
for i in a:
   ans += abs(i)

print (ans)

### FIXED CODE ###

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

ans = 0
minus_cnt = 0
min_num = 10000000000000
for i in a:
  if i < 0:
    minus_cnt += 1
  if abs(i) < min_num:
    min_num = abs(i)

case = minus_cnt % 2

for i in a:
   ans += abs(i)

if case == 1:
  ans -= 2 * min_num

print (ans)
from collections import Counter
N, M = map(int, input().split())
groups = [0] * (N + 1)
group_num_list = [[0]]
group_num = 1
for _ in range(M):
    A, B = map(int, input().split())
    if groups[A] != 0 and groups[B] != 0:
        if groups[A] != groups[B]:
            lower = min(groups[A], groups[B])
            higher = max(groups[A], groups[B])
            for i in group_num_list[higher]:
                groups[i] = lower
            tmp = group_num_list[higher]
            group_num_list[lower].extend(tmp)
            # del group_num_list[higher]
    elif groups[A] != 0:
        groups[B] = groups[A]
        group_num_list[groups[A]].append(int(B))
    elif groups[B] != 0:
        groups[A] = groups[B]
        group_num_list[groups[B]].append(int(A))
    else:
        groups[A] = group_num
        groups[B] = group_num
        group_num_list.append([int(A), int(B)])
        group_num += 1
counter = Counter(groups)
# print(collection)
# print(group_num_list)
if len(groups) == 1:
    print(1)
elif int(counter.most_common()[0][0]) != 0:
    print(counter.most_common()[0][1])
else:
    print(counter.most_common()[1][1])


### FIXED CODE ###

from collections import Counter
N, M = map(int, input().split())
groups = [0] * (N + 1)
group_num_list = [[0]]
group_num = 1
for _ in range(M):
    A, B = map(int, input().split())
    if groups[A] != 0 and groups[B] != 0:
        if groups[A] != groups[B]:
            lower = min(groups[A], groups[B])
            higher = max(groups[A], groups[B])
            for i in group_num_list[higher]:
                groups[i] = lower
            tmp = group_num_list[higher]
            group_num_list[lower].extend(tmp)
            # del group_num_list[higher]
    elif groups[A] != 0:
        groups[B] = groups[A]
        group_num_list[groups[A]].append(int(B))
    elif groups[B] != 0:
        groups[A] = groups[B]
        group_num_list[groups[B]].append(int(A))
    else:
        groups[A] = group_num
        groups[B] = group_num
        group_num_list.append([int(A), int(B)])
        group_num += 1
counter = Counter(groups)
# print(collection)
# print(group_num_list)
if len(group_num_list) == 1:
    print(1)
elif int(counter.most_common()[0][0]) != 0:
    print(counter.most_common()[0][1])
else:
    print(counter.most_common()[1][1])
import sys
W, H, N = map(int, input().split())
area = W * H

right, left, bottom, top = W, 0, 0, H

for n in range(N):
    tmp_w, tmp_h, a = map(int, input().split())
    if left <= tmp_w <= right and bottom <= tmp_h <= top:
        if a == 1:
            tmp_area = (tmp_w - left) * (top - bottom)
            area -= tmp_area
            left = tmp_w
        if a == 2:
            tmp_area = (right - tmp_w) * (top - bottom)
            area -= tmp_area
            right = tmp_w
        if a == 3:
            tmp_area = (tmp_h - bottom) * (right - left)
            area -= tmp_area
            bottom = tmp_h
        if a == 4:
            tmp_area = (top - tmp_h) * (right - left)
            area -= tmp_area
            top = tmp_h
    else:
        if a == 1:
            if tmp_w >= right:
                tmp_area = tmp_w * H
            else:
                tmp_area = 0
        if a == 2:
            if tmp_w <= left:
                tmp_area = (W - tmp_w) * H
            else:
                tmp_area = 0
        if a == 3:
            if tmp_h >= top:
                tmp_area = tmp_h * W
            else:
                tmp_area = 0
        if a == 4:
            if tmp_h <= bottom:
                tmp_area = (H - tmp_h) * W
            esle:
                tmp_area = 0
        area -= tmp_area
        if area < 0:
            print(0)
            sys.exit()
print(area)
        
        

### FIXED CODE ###

import numpy as np
import sys
from collections import Counter
W, H, N = map(int, input().split())

grid = np.array([[0] * W] * H)

for n in range(N):
    tmp_w, tmp_h, a = map(int, input().split())
    if a == 1:
        grid.T[: tmp_w] = 1
    if a == 2:
        grid.T[tmp_w:] = 1
    if a == 3:
        grid[0: tmp_h] = 1
    if a == 4:
        grid[tmp_h: ] = 1
    #print(grid)

print(Counter((grid.reshape(1, W * H).tolist())[0])[0])
s = list(input())
t = list(input())

flag = True
s_len = len(s)
t_len = len(t)
save = 0
count = 0

for i in range(s_len):
    if s[i] == '?':
        s[i] = 'a'
        count += 1
        if count == t_len and flag:
            save = i - count + 1
            flag = False
    elif count < t_len and s[i] == t[count]:
        count += 1
        if count == t_len and flag:
            save = i - count + 1
            flag = False
    else:
        count = 0
        
for j in range(t_len):
    s[j+save] = t[j]

if flag:
    print("UNRESTORABLE")
else:
    print(s)

### FIXED CODE ###

s = list(input())
t = list(input())

ls = len(s)
lt = len(t)
match = -1

for i in range(ls-lt+1):
    for j in range(lt):
        if s[i+j] == t[j] or s[i+j] == '?':
            pass
            #continueはここで処理が終わってしまう
        else:
            break
            
        if j == lt - 1:
            match = i
        
for i in range(ls):
    if s[i] == '?':
        s[i] = 'a'
        
for i in range(lt):
    s[match+i] = t[i]
        
if match < 0:
    print("UNRESTORABLE")
else:
    print(''.join(s))
from math import gcd
mod = 10**9+7
n = int(input())
dicn = {}
dicp = {}
dicz = {'a': 0, 'b': 0, 'z': 0}
for i in range(n):
  a, b = map(int, input().split())
  if a == 0 and b == 0:
    dicz['z'] += 1
  else:
    g = gcd(a,b)
    a //= g
    b //= g
    if a < 0:
      a *= -1
      b *= -1
    elif a == 0 and b < 0:
      b *= -1
    if a * b > 0:
      if a in dicp:
        if b in dicp[a]:
          dicp[a][b] += 1
        else:
          dicp[a][b] = 1
      else:
        dicp[a] = {b: 1}
    elif a * b < 0:
      if b in dicn:
        if a in dicn[b]:
          dicn[b][a] += 1
        else:
          dicn[b][a] = 1
      else:
        dicn[b] = {a: 1}
    else:
      if a == 0:
        dicz['a'] += 1
      else:
        dicz['b'] += 1

ans = 1

for a in dicp:
  for b in dicp[a]:
    if -a in dicn:
      if b in dicn[-a]:
        ans *= (pow(2, dicp[a][b], mod) + pow(2, dicn[-a][b], mod) - 1)
        dicn[-a][b] = 0
      else:
        ans *= pow(2, dicp[a][b], mod)
    else:
      ans *= pow(2, dicp[a][b], mod)
    ans %= mod

for b in dicn:
  for a in dicn[b]:
    ans *= pow(2, dicn[b][a], mod)
    ans %= mod
    
if dicz['a'] > 0 and dicz['b'] > 0:
  ans *= pow(2,dicz['a'],mod) + pow(2,dicz['b'],mod) - 1
elif dicz['a'] > 0:
  ans *= pow(2,dicz['a'],mod)
elif dicz['b'] > 0:
  ans *= pow(2,dicz['b'],mod)
  
ans += pow(2,dicz['z'],mod)
print((ans-1)%mod)


### FIXED CODE ###

x = int(input()[-1])
if x in [2,4,5,7,9]:
  print('hon')
elif x == 3:
  print('bon')
else:
  print('pon')
import bisect
from collections import deque
N, M = map(int, input().split())
B = [int(x) for x in input().split()]
B = sorted(B)
A = deque([])
for i in range(N):
    A.append(B[i])
# print(A)
for i in range(M):
    value = A.pop()
    value = value//2
    bisect.insort_left(A, value)
# print(A)
ans = sum(A)
print(ans)


### FIXED CODE ###

# 他参加者の回答を参考にした．現在のAtcoderでのpythonのバージョンではdequeにinsertできないので（全ての値に-1をかけて）heapqがよさそう？
import bisect
N, M = map(int, input().split())
B = [int(x) for x in input().split()]
A = sorted(B, reverse=True)
ite = 0
for i in range(M):
    A[ite] //= 2
    if ite < N - 1:
        if A[ite] < A[ite + 1] and A[0] < A[ite+1]:
            ite += 1
        else:
            A = sorted(A, reverse=True)
            ite = 0
    else:
        A = sorted(A, reverse=True)
        ite = 0

ans = sum(A)
print(ans)
N= int(input())
M=int(input())
if N==M:
    print("yes")
else:
    print("no")

### FIXED CODE ###

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



if N==M:
    print("Yes")

        
else:
    print("No")