Harryxun/stf_run huggingface dataset:
from operator import itemgetter
N , M = map(int, input().split(' '))

city = []
for i in range(M):
    lscity = list(map(int, input().split(' ')))
    city.append([*lscity, i])

city_y = sorted(city, key = itemgetter(1))
city_num = [0 for _ in range(N+1)]
city_ID = {}

for i in range(M):
    city_num[city[i][0]] += 1
    city_ID[city_y[i][2]] = ("{:06d}{:06d}".format(city_num[city[i][0]], city[i][0]))

for i, j in sorted(city_ID.items()):
    print(j)

### FIXED CODE ###

from operator import itemgetter
N , M = map(int, input().split(' '))

city = []
for i in range(M):
    a, b = map(int, input().split(' '))
    city.append([a, b, i])

city_y = sorted(city, key = itemgetter(1))
city_num = [0 for _ in range(N+1)]
city_ID = {}

for i in range(M):
    city_num[city_y[i][0]] += 1
    city_ID[city_y[i][2]] = ("{:0=6}{:0=6}".format(city_y[i][0], city_num[city_y[i][0]]))

for i, j in sorted(city_ID.items()):
    print(j)
num=1000000
prime=[1]*1000000
prime[0]=0
prime[1]=0
i=2
ans=0
while i<1000000:
 if prime[i]==1:
  ans+=1
 if i<1000:
  j=i*i
  while j<1000000:
   prime[j]=0
   j+=i
 prime[i]=ans
 i+=1
while True:
 n=input()
 print prime[n]

### FIXED CODE ###

num=1000000
prime=[1]*1000000
prime[0]=0
prime[1]=0
i=2
ans=0
while i<1000000:
 if prime[i]==1:
  ans+=1
 if i<1000:
  j=i*i
  while j<1000000:
   prime[j]=0
   j+=i
 prime[i]=ans
 i+=1
while True:
 try:
  n=input()
  print prime[n]
 except:
  break
import queue
def main():
    n,m=map(int,input().split())
    root=[[0 for i in range(n)] for i in range(n)]
    for i in range(m):
        a,b=map(int,input().split())
        root[a-1][b-1]=1
        root[b-1][a-1]=1
    min=[-1 for i in range(n)]
    min[0]=2
    dict={}
    for i in range(n):
        dict[i]=-1

    start=0
    check=[False]*n
    toVis=queue.Queue()
    check[start]=True
    for i in range(len(root[0])):
        if root[0][i]==1:
            toVis.put(i)
            dict[i]=start
        #   print(i,":",start)
            check[i]=True
    while(toVis.empty()!=True):
        now=toVis.get()
        #print(now)
        check[now]=True
        for i in range(n):
            if root[now][i]==1 and check[i]==False:
                toVis.put(i)
                dict[i]=now
            # print(i,":",now)
                check[i]=True
    #print(dict)  
    for i in range(1,n):
        if dict[i]==-1:
            print("No")
            return 0
    print("Yes")
    for i in range(1,n):
        print(dict[i]+1)         


if __name__=="__main__":
    main()

### FIXED CODE ###

n=input()

if n[-1]=="3":
    print("bon")
elif n[-1]=="0" or n[-1]=="1" or n[-1]=="6" or n[-1]=="8":
    print("pon")
else:
    print("hon")
N = input()
A = map(int, input().split())
sum = 0
pre = 0
for ai in A:
  if pre > ai:
    sum += pre - ai
  else:
    pre = ai
print(sum

### FIXED CODE ###

N = input()
A = map(int, input().split())
sum = 0
pre = 0
for ai in A:
  if pre > ai:
    sum += pre - ai
  else:
    pre = ai
print(sum)
N,M = map(int,raw_input().split())
node_list = [0 for l in range(N)]
for i in range(M):
    items = map(int,raw_input().split())
    node_list[items[0]-1]+=1
    node_list[items[1]-1]+=1
flag=False
for n in range(N):
    if n%2==1:
        flag=True
        
if flag:
    print 'NO'
else:
    print 'YES'


### FIXED CODE ###

A,B,C = map(int,raw_input().split())

if A==B and B==C:
    if A%2==0 and B%2==0 and C%2==0:
        print -1
    else:
        print 0
else:
    for i in range(1000):
        if A%2==1 or B%2==1 or C%2==1:
            print i
            break
        newA = B/2 + C/2
        newB = C/2 + A/2
        newC = A/2 + B/2
        A = newA
        B = newB
        C = newC
n=int(input())
num=math.log(n,10)
if 0<=num<1:
  print(n)
elif 1<=num<2:
  print(9)
elif 2<=num<3:
  print(n-90)
elif 3<=num<4:
  print(909)
elif 4<=num<5:
  print(n-9090)
else:
  print(90909)

### FIXED CODE ###

n=int(input())
ans=0
for i in range(1,n+1):
  if len(str(i))%2!=0:
    ans+=1
print(ans)
n=int(input())
t=list(map(int,input().split()))
m=int(input())
px=[list(map(int,input().split())) for _ in range(m)]

ans=sum(t)-t[0]-t[1]

for i in range(m):
    
    print(ans+sum(px[i]))



### FIXED CODE ###

n=int(input())
t=list(map(int,input().split()))
m=int(input())
px=[list(map(int,input().split())) for _ in range(m)]

ans=sum(t)

for i in range(m):
    print(ans-t[px[i][0]-1]+px[i][1])
_, s = map(int, open(0))
S = sum(s)
t = [i for i in s if i%10]
print(S if S%10 else S-min(t) if t else 0)

### FIXED CODE ###

_, *s = map(int, open(0))
S = sum(s)
t = [i for i in s if i%10]
print(S if S%10 else S-min(t) if t else 0)
n = int(input())
li = [list(map(int,input().split())) for _ in range(n)]

li2 = [(x[0]-y[0],x[1]-y[1]) for x in li for y in li]
data = list(set(li2)) #かぶりを消すような作業や、カウントする前はsetがよい
data.remove((0,0))
data2 = tuple(data) #forなどでlistの中身をたくさん参照する場合はtupleがよい
qty = list(map(lambda x: li2.count(x),data2))

print(n-max(qty))


### FIXED CODE ###

n = int(input())
li = []
for i in range(n):
    a = list(map(int,input().split()))
    li.append(a)

li.sort(key = lambda x:x[0])
li2 = []

for i in range(n):
    for j in range(i):
        a = [li[i][0]-li[j][0],li[i][1]-li[j][1]]
        li2.append(a)

for i in li2:
    if i[0] < 0:
        i[0] = -i[0]
        i[1] = -i[1]
    if i[0] == 0 and i[1] < 0:
        i[1] = -i[1]

ans = 0

for i in li2:
    ans = max(ans,li2.count(i))

print(n-ans)
d = [2,5,5,4,5,6,3,7,6]

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

memo = [ "-" for _ in range(N + 1)]

def find(N):
    global memo
    if memo[N] != "-":
        return memo[N]

    mval = ""
    val = ""
    for a in A:
        if d[a - 1] < N:
            val = str(find(N - d[a - 1]))
            if val == "":
                continue
            val = val + str(a)
        elif d[a - 1] == N:
            val = str(a)
        else:
            continue

        if len(mval) < len(val) or mval < val:
            mval = val
    memo[N] = mval
    return memo[N]

m = find(N)
print(m)


### FIXED CODE ###

import sys
sys.setrecursionlimit(150000)


d = [2,5,5,4,5,6,3,7,6]

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

memo = [ "-" for _ in range(N + 1)]

def find(N):
    global memo
    if memo[N] != "-":
        return memo[N]

    mval = ""
    val = ""
    for a in A:
        if d[a - 1] < N:
            val = find(N - d[a - 1])
            if val == "":
                continue
            val = val + str(a)
        elif d[a - 1] == N:
            val = str(a)
        else:
            continue

        if len(mval) < len(val) or (len(mval) == len(val) and mval < val):
            mval = val
    memo[N] = mval
    return memo[N]

m = find(N)
print(m)
import sys
input=sys.stdin.readline
n,k=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
a=sorted(a,reverse=True)
b=sorted(b)

def ok(N):
    sums=0
    for i in range(n):
        sums+=max(0,a[i]-N//b[i])
    if sums<=k:
        return True
    else:
        return False
    
import math

left=0
right=a[-1]*b[0]+1
for _ in range(math.ceil(math.log2(right))+1):
    if ok(math.floor((left+right)/2)):
      left=left
      right=(left+right)/2
    elif not ok(math.floor((left+right)/2)):
      left=(left+right)/2
      right=right
print(math.floor(right))
   


### FIXED CODE ###

# いきぬきreview　忘れた問題
# gluttony
N, K = map(int, input().split())
A = list(map(int, input().split()))
F = list(map(int, input().split()))
F.sort()
A.sort(reverse=True)


def func(X):
    s = 0
    for i in range(N):
        a, f = A[i], F[i]
        s += max(0, a-X//f)
    return s <= K


R = 10**12
L = -1
while R-L > 1:
    m = (R+L)//2
    if func(m):
        R = m
    else:
        L = m
print(R)
A = input()
for i in range(len(A)):
  if A[i] == ',':
    A[i] = ''

print(A)

### FIXED CODE ###

A = input()
A = A.replace(',',' ')

print(A)
# -*- coding: utf-8 -*-
"""
Created on Sun May  3 21:27:48 2020
"""

import sys
import numpy as np
import itertools

sys.setrecursionlimit(10 ** 9)
#def input():
#    return sys.stdin.readline()[:-1]
mod = 10**9+7

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

A = np.array(A)
B = np.arange(N)

x = A - B
y = A + B

x.sort()
y.sort()

ans = 0
i, j = 0, N - 1
#pre = 10**10
x1, y1 = 0, 0
while i < N and j >= 0:
    if -x[i] < y[j]:
        j -= 1
    elif -x[i] > y[j]:
        i += 1
    else:
        x1,y1 = 1, 1
        pre = y[j]
        while pre == -x[i+1]:
            x1 += 1
            i += 1
#            print('x',pre,x1)
        while pre == y[j-1]:
            y1 += 1
            j -= 1
#            print('y',pre,y1)
        i += 1
        j -= 1
        ans += x1 * y1
#        print()
#    print(i,j,x[i],y[j],x1,y1,ans)
print(ans)

### FIXED CODE ###

# -*- coding: utf-8 -*-
"""
Created on Sun May  3 21:27:48 2020
"""

import sys
import numpy as np
import itertools

sys.setrecursionlimit(10 ** 9)
#def input():
#    return sys.stdin.readline()[:-1]
mod = 10**9+7

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

A = np.array(A)
B = np.arange(N)

x = A - B
y = A + B

x.sort()
y.sort()

ans = 0
i, j = 0, N - 1
#pre = 10**10
x1, y1 = 0, 0
while i < N and j >= 0:
    if -x[i] < y[j]:
        j -= 1
    elif -x[i] > y[j]:
        i += 1
    else:
        x1,y1 = 1, 1
        pre = y[j]
        while pre == -x[i+1]:
            x1 += 1
            i += 1
#            print('x',pre,x1)
        while pre == y[j-1]:
            y1 += 1
            j -= 1
#            print('y',pre,y1)
        i += 1
        j -= 1
        ans += x1 * y1
#        print()
#    print(i,j,x[i],y[j],x1,y1,ans)
print(ans)
import math
from scipy.special import comb

def com(s, t):
    mod = 10**9+7
    t = min(s-t, t)
    S = 1
    T = 1
    for i in range(t):
        S = ((s-i)*S)%mod
        T = ((i+1)*T)%mod
    return (S*pow(T, mod-2, mod))%mod

def main():
    n, k = map(int, input().split())
    mod = 10**9+7
    for i in range(1, k+1):
        print(comb(n-k+1, i, exact=True)*comb(k-1, i-1, exact=True)%mod)

if __name__=='__main__':
    main()

### FIXED CODE ###

import math
from scipy.misc import comb

def com(s, t):
    mod = 10**9+7
    t = min(s-t, t)
    S = 1
    T = 1
    for i in range(t):
        S = ((s-i)*S)%mod
        T = ((i+1)*T)%mod
    return (S*pow(T, mod-2, mod))%mod

def main():
    n, k = map(int, input().split())
    mod = 10**9+7
    for i in range(1, k+1):
        print(comb(n-k+1, i, exact=True)*comb(k-1, i-1, exact=True)%mod)

if __name__=='__main__':
    main()
import itertools
N,C = map(int,input().split())
imos = [0]*(50)
info = [list(map(int,input().split())) for i in range(N)]
info = sorted(info,key=lambda x:(x[2],x[0]))
note = -1
before_t = -1
for i in range(N):
    s,t,c = info[i]
    s -= 1
    if c == note and s < before_t:
        s = before_t
    imos[s] += 1
    imos[t] -= 1
    note = c
    before_t = t
print(imos)
acc_sum = list(itertools.accumulate(imos))
ans = max(acc_sum)
print(ans)

### FIXED CODE ###

import itertools
N,C = map(int,input().split())
imos = [0]*(10**6)
info = [list(map(int,input().split())) for i in range(N)]
info = sorted(info,key=lambda x:(x[2],x[0]))
note = -1
before_t = -1
for i in range(N):
    s,t,c = info[i]
    s -= 1
    if c == note and s < before_t:
        s = before_t
    imos[s] += 1
    imos[t] -= 1
    note = c
    before_t = t
acc_sum = list(itertools.accumulate(imos))
ans = max(acc_sum)
print(ans)
import sys

d = {'A': True, 'B': False, 'C': False}

for line in sys.stdin:
    a, t = line.split().split(',')
    d[a], d[t] = d[t], d[a]

for k, v in d.items():
    if v:
        print(k)

### FIXED CODE ###

d = {'A': True, 'B': False, 'C': False}

while True:
    try:
        a, t = input().split(',')
        d[a], d[t] = d[t], d[a]
    except:
        for k, v in d.items():
            if v:
                print(k)
        break
n=int(input())
arr=list(map(int,input().split()))
brr=list(map(int,input().split()))[::-1]
start=end=-1
for i,val in range(n):
  if arr[i]==brr[i]:
    if start==-1:
      start=end=i
    else:
      end=i
if start==-1:
  print('Yes')
  print(*brr)
else:
  i=0
  while i<n and start<=end:
    if brr[i]!=arr[end] and arr[i]!=arr[end]:
      brr[i],brr[start]=brr[start],brr[i]
      start+=1
    i+=1
  if start>end:
    print('Yes')
  	print(*brr)
  else:
    print('No')
  
  
    
    
  
  
  
  
  
  

### FIXED CODE ###

n=int(input())
arr=list(map(int,input().split()))
brr=list(map(int,input().split()))[::-1]
start=end=-1
for i in range(n):
    if arr[i]==brr[i]:
        
        if start==-1:
            start=end=i
        else:
            end=i
if start==-1:


    print('Yes')
    print(*brr)
else:

    i=0
    while i<n and start<=end:
        if brr[i]!=arr[end] and arr[i]!=arr[end]:
            brr[i],brr[start]=brr[start],brr[i]
            start+=1
        i+=1
    if start>end:
        print('Yes')
        print(*brr)
    else:
        print('No')
n,q = list(map(int, input().split()))
s = input()
s_ps=[]

a =s[0]
for i in range(n):
    b = a
    a = s[i]
    if b+a=='AC':
        s_ps.append(i)
#print(s_ps)
len_s = len(s_ps)


for _ in range(q):
    l,r=list(map(int, input().split()))
    count =0
    for i in s_ps:
        if l<=i:
            low =i
            break
    for i in s_ps[::-1]:
        if i < r:
            high=i
            break
    print(s_ps.index(high)-s_ps.index(low)+1)

### FIXED CODE ###


n,q = list(map(int, input().split()))
s = input()
ans = [0]*(n+1)
lr=[list(map(int, input().split())) for _ in range(q)]
for i in range(1,n):
    
    if s[i-1]=='A' and s[i]=='C':
        ans[i+1] = ans[i] + 1
    else:
        ans[i+1]= ans[i]
#print(ans)
for i in range(q):
    print(ans[lr[i][1]]-ans[lr[i][0]])
numbers = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
K = int(input())

print(numbers[K])

### FIXED CODE ###

K = int(input())
k = K-1
numbers = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]


print(numbers[k])
n = int(input())
T,A = map(int,input().split())
h = list(map(int,input().split()))
#print(h)
l =[]
for i in range(n):
  a = T - h[i]*0.006
  print(a)
  b = abs(a-A)
  l.append(b)
  print(l)
c = h.index(h[l.index(min(l))])
print(c+1)

### FIXED CODE ###

x,y = map(int,input().split())

print(int(x+y/2))
n=int(input())
a=[]
for i in range(n):
    a.append(int(input()))

print(max(a) - min(a))

### FIXED CODE ###

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

print(max(a) - min(a))
#!/usr/bin/env python3

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

n = I()
s = LI()

if n == 1:
    if s[0] == s[1]:
        print('No')
    else:
        print('Yes')
    quit()
h = []
for i in range(2**n):
    heappush(h,-s[i])
x = heappop(h)
use = [-x]
for i in range(n-1):
    rest = []
    for j in range(2**i):
        x = heappop(h)
        rest.append(-x)
    for i in range(2**i):
        if use[i] > rest[i]:
            continue
        else:
            print('No')
            quit()
    for i in range(2**i):
        use.append(rest[i])
print('Yes')

### FIXED CODE ###

#!/usr/bin/env python3

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

n = I()
s = LI()
s.sort(reverse=True)
use = [s[0]]
rest = s[1:]
for _ in range(n):
    new_use = []
    que = deque(rest)
    for i in use:
        rest_tmp = []
        while que:
            x = que.popleft()
            if i > x:
                new_use.append(x)
                break
            else:
                rest_tmp.append(x)
        que += rest_tmp
    use += new_use
    use.sort(reverse=True)
    rest = list(que)
    rest.sort(reverse=True)
if len(use) == 2**n:
    print('Yes')
else:
    print('No')
from collections import defaultdict, deque

n, m = [int(i) for i in raw_input().split()]

# children = defaultdict(list)
parents = defaultdict(list)

for _ in range(m):
    u, v = [int(i) for i in raw_input().split()]
    # children[u-1].append(v-1)
    parents[v-1].append(u-1)

def longest_path(parents, n):
    f = [None] * n
    # targets = [x for y in children.values() for x in y]
    # starts = [v for v in range(n) if v not in targets]

    # print f
    for i in range(n):
        get_f(parents, f, i)

    # print f
    return max(f)

def get_f(parents, f, i):
    if f[i] != None:
        return f[i]

    f[i] = 0
    for v in parents[i]:
        f[i] = max(f[i], get_f(parents, f, v) + 1)

    return f[i]

# def longest_path(children, parents, n):
#     targets = [x for y in children.values() for x in y]
#     starts = [v for v in range(n) if v not in targets]
#     f = [None] * n
    
#     Q = deque([])
#     for v in starts:
#         f[v] = 0
#         Q.append((v, 0))

#     output = 0
#     while len(Q) > 0:
#         node, length = Q.pop()
#         output = max(output, length)
#         for v in children[node]:
#             Q.append((v, length+1))

#     return output

print(longest_path(parents, n))


### FIXED CODE ###

from collections import defaultdict
import sys
sys.setrecursionlimit(1000000)

n, m = [int(i) for i in raw_input().split()]
parents = defaultdict(list)

i = 0
while i < m:
    u, v = [int(x) for x in raw_input().split()]
    parents[v-1].append(u-1)
    i += 1

def calc_f(parents, f, i):
    if i < 0 or i >= len(f):
        return 0

    if f[i] != -1:
        return f[i]

    f[i] = 0
    for v in parents[i]:
        f[i] = max(f[i], calc_f(parents, f, v)+1)

    return f[i]

f = [-1] * n
j = 0
while j < n:
    calc_f(parents, f, j)
    j += 1

if len(f) == 0:
    print 0
else:
    print max(f)
a, b = (int(x) for x in input().split())
print(int((b-1) / (a-1))
  
  

### FIXED CODE ###

a, b = (int(x) for x in input().split())
print(int((b-1) / (a-1)) + (1 if (b-1) % (a-1) != 0 else 0))
N = int(input())
mochis = []
for _ in range(N):
	mochis.append(int(input()))

mochis = sorted(mochis, reverse=True)
dan = 0
for i in range(N):
	dan += 1
	if mochis[i] == mochis[i+1]:
		break

print(dan)


### FIXED CODE ###

N = int(input())
mochis = []
for _ in range(N):
	mochis.append(int(input()))

dan = len(list(set(mochis)))
print(dan)
a= input()
b= input()
print(b+a)

### FIXED CODE ###

a,b = input().split()
print(b+a)
import numpy as np

def main():

    N,L = (int(i) for i in input().split())
    L_list = [int(L+i) for i in range(N)]

    Tmp = L_list[0]


    if L_list[0] < 0:
        if L_list[0]+N-1 >= 0 :
            print(sum(L_list[:]))
        else:
            print(sum(L_list[:-1]))
    else:
        print(sum(L_list[1:]))


if __name__ == '__main__':
    main()


### FIXED CODE ###

import numpy as np

def main():

    N,L = (int(i) for i in input().split())
    L_list = [int(L+i) for i in range(N)]

    if L_list[0] < 0:
        if L_list[0]+N-1 >= 0 :
            print(sum(L_list[:]))
        else:
            print(sum(L_list[:-1]))
    else:
        print(sum(L_list[1:]))


if __name__ == '__main__':
    main()
import statistics
n = int(input())
a = list(map(int,input().split()))
s = statistics.mean(a)
print(s)
c = float("inf")
d = i
for i in range(n):
    if c!= min(abs(s-a[i]),c):
        c = s-a[i]
        d = i
print(d)

### FIXED CODE ###

import statistics
n = int(input())
a = list(map(int,input().split()))
s = statistics.mean(a)
c = float("inf")
for i in range(n):
    if c!=min(abs(s-a[i]),c):
        c = abs(s-a[i])
        d = i
print(d)
n=int(input())
d,x=map(int,input().split())
a=[int(input()) for i in range(n)]
eaten = [((d-1)//a[i])+1 for i in range(n)]
print(sun(eaten)+x)

### FIXED CODE ###

n=int(input())
d,x=map(int,input().split())
a=[int(input()) for i in range(n)]
eaten = [((d-1)//a[i])+1 for i in range(n)]
print(sum(eaten)+x)
a=input()
if a=='SUN':
  print(7)
elif a=='MON':
  print(6)
elif a=='TUE':
  print(5)
elif a=='WED':
  pirnt(4)
elif a=='THU':
  print(3)
elif a=='FRI':
  print(2)
elif a=='SAT':
  print(1)
else:
  pass

### FIXED CODE ###

c=0
a=input()
if a=='SUN':
  c+=7
elif a=='MON':
  c+=6
elif a=='TUE':
  c+=5
elif a=='WED':
  c+=4
elif a=='THU':
  c+=3
elif a=='FRI':
  c+=2
else:
  c+=1
print(c)
n,k=map(int,input().split())
kashi = [0] * n
cnt = 0
for s in range(n-1):
	i=int(input())
	li=list(map(int,input().split()))
	for m in li:
		kashi[m-1] +=1

for i in kashi:
	if i == 0:
		cnt += 1

print(cnt)

### FIXED CODE ###

n,k=map(int,input().split())
kashi = [0] * n
cnt = 0
M = 0
for s in range(k):
	i=int(input())
	li=list(map(int,input().split()))
	if i > 0:
		for m in li:
			kashi[m-1] +=1

for i in kashi:
	if i == 0:
		cnt += 1

print(cnt)
N,X=map(int,input().split())
a=[]
for i in range(N):
	a.append(map(int,input().split()))
n=0
d=0
while n<=N:
	if d>X:
		break
	else:
		d=d+a[n]
		n=n+1

print(n+1)

### FIXED CODE ###

N,X=map(int,input().split())
L=list(map(int,input().split()))
count=0
length=0
while length<=X:
	count=count+1
	if count==N+1:
		break
	length=length+L[count-1]
print(count)
import math

a,b,c,d = map(int,input().split())

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

v = lcm(c, d)

s = b//c - (a-1)//c
t = b//d - (a-1)//d
u = b//v - (a-1)//v

print((b-a+1) - (s+t-u))


### FIXED CODE ###



a,b,c,d = map(int,input().split())

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


v = c*d//gcd(c,d)

s = b//c - (a-1)//c
t = b//d - (a-1)//d
u = b//v - (a-1)//v

print((b-a+1) - (s+t-u))
n,k = map(int, input().split())
s = list(input())
if s[k-1] == A:
  s[k-1] = a
elif s[k-1] == B:
  s[k-1] = b
else:
  s[k-1] = c
print("".join(s))


### FIXED CODE ###

n, k = map(int, input().split())
s = list(input())
if s[k-1] == "A":
  s[k-1] = "a"
elif s[k-1] == "B":
  s[k-1] = "b"
else:
  s[k-1] = "c"
print("".join(s))
N = int(input())
xyh = [list(map(int,input().split(' '))) for i in [0]*N]


ls = [[0]*101 for i in [0]*101]

cor = [[i,j] for i in range(101) for j in range(101)]

x,y,h = xyh[0]
for cx,cy in cor[:]:
	hx = abs(cx-x)
	hy = abs(cy-y)
	H = h+hx+hy
	ls[cx][cy] = H

for x,y,h in xyh[1:]:
	for cx,cy in cor[:]:
		hx = abs(cx-x)
		hy = abs(cy-y)
		H = h + hx + hy
		if not ls[cx][cy] == H:
			cor.remove([cx,cy])

cx,cy = cor[0]
print(cx,cy,ls[cx][cy])







### FIXED CODE ###

N = int(input())
xyh = [list(map(int,input().split(' '))) for i in [0]*N]


ls = [[0]*101 for i in [0]*101]

cor = [[i,j] for i in range(101) for j in range(101)]


for cx,cy in cor:
	H = 0
	for x,y,h in xyh:
		if h != 0:
			hx = abs(cx-x)
			hy = abs(cy-y)
			H = h + hx + hy
			break
	ok = True 
	for x,y,h in xyh:
		hx = abs(cx-x)
		hy = abs(cy-y)
		if h != max(H-hx-hy,0):
			ok = False
			break
	if ok:
		break

print(cx,cy,H)
import sys
# A,B,C = [int(n) for n in input().split()]
N = int(input())
# S = str(input())
# T = str(input())
t = [0]*N
x = [0]*N
y = [0]*N
for i in range(N):
    t[i],x[i],y[i] = [int(n) for n in input().split()]
dt = t[0]
d = x[0] + y[0]
if(dt < d || dt%2 != d%2):
    print("No")
    sys.exit()
for i in range(1,N):
    dt = t[i] - t[i-1]
    d = abs(x[i] - x[i-1]) + abs(y[i] - y[i-1])
    if(dt < d || dt%2 != d%2):
        print("No")
        sys.exit()
print("Yes")


### FIXED CODE ###

import sys
N = int(input())
t = [0]*N
x = [0]*N
y = [0]*N
for i in range(N):
    t[i],x[i],y[i] = [int(n) for n in input().split()]
dt = t[0]
d = x[0] + y[0]
if(dt < d or dt%2 != d%2):
    print("No")
    sys.exit()
for i in range(1,N):
    dt = t[i] - t[i-1]
    d = abs(x[i] - x[i-1]) + abs(y[i] - y[i-1])
    if(dt < d or dt%2 != d%2):
        print("No")
        sys.exit()
print("Yes")