Harryxun/stf_run huggingface dataset:
x=int,input()

for v in range(x):
 print("case i :" v)

### FIXED CODE ###

i = 1

while True:

 x=int(input())
 if x==0:
  break
 print("Case {0}: {1}".format(i,x))
 i+=1
n,k = map(int, input().split())
a = set()
for i in [0]*k:
    _ = input()
    a.add(*map(int, input().split()))
print(n - len(a))

### FIXED CODE ###

(n,k),*p = [[*map(int, i.split())] for i in open(0)]
a = sum([p[2*i+1] for i in range(k)],[])
print(n - len(set(a)))
ABCD = list(map(int, input()))
op ="+-"
for i in range(pow(2, 3)):
  v = i
  f = str(ABCD[j])
  for j in range(3):
    f += op[v%2] + ABCD[j]
    v //= 2
  if eval(f) == 7:
    print("{}=7", f)
    break


### FIXED CODE ###

ABCD = input()
op ="+-"
for i in range(pow(2, 3)):
  v = i
  f = str(ABCD[0])
  for j in range(1,4):
    f += op[v%2] + ABCD[j]
    v //= 2
  if eval(f) == 7:
    print("{}=7".format(f))
    break
INF = float('inf')
H,W = map(int,input().split())
s = [input() for _ in range(H)]
cost = [[INF]*W for _ in range(H)]
cost[0][0] = 1

def bfs(h,w):
    for dh,dw in [[1,0],[-1,0],[0,1],[0,-1]]:
        if 0<=h+dh<H and 0<=w+dw<W:
            if s[h+dh][w+dw] == '.' and cost[h+dh][w+dw] > cost[h][w]+1:
                cost[h+dh][w+dw] = cost[h][w]+1
                bfs(h+dh,w+dw)
bfs(0,0)
if cost[-1][-1] == INF:
    print(-1)
else:
    ans = H*W-cost[-1][-1]
    for h in range(H):
        ans -= s[h].count('#')
    print(ans)

### FIXED CODE ###

import queue
H,W = map(int,input().split())
maze = [0]*H
for i in range(H):
    maze[i] = input()
inf = float('inf')
d = [[inf for i in range(W)] for i in range(H)]
dx = [1,0,-1,0]
dy = [0,1,0,-1]


def bfs():
    que = queue.Queue()
    que.put((0,0))
    d[0][0] = 0
    while que.qsize():
        p = que.get()
        if p == (H-1,W-1):
            break
        for i in range(4):
            nx = p[0]+dx[i]
            ny = p[1]+dy[i]
            if 0 <= nx and nx <= H-1 and 0 <= ny and ny <= W-1 \
            and maze[nx][ny] != '#' and d[nx][ny] == inf:
                d[nx][ny] = d[p[0]][p[1]] + 1
                que.put((nx,ny))

bfs()

count = 0
for i in range(H):
    for j in range(W):
        if maze[i][j] == '#':
            count += 1

ans = -1
if d[H-1][W-1] != inf:
    ans = H*W-count-1-d[H-1][W-1]
print(ans)
a = list(map(int,input().sprit()))
b = list(map(int,input().sprit()))
b.sort()
c = 0
for i in range(a[1])
	c += b[i]
print(c)

### FIXED CODE ###

n, k = map(int, input().split())
p = list(map(int, input().split()))
p.sort()
total = 0
for i in range(k):
    total+=p[i]
print(total)
import sys
import sympy as sym

def fib(n):
    x = sym.symbols('x',nonnegative=True,integer=True)
    Fib=1/sym.sqrt(5)*(((1+sym.sqrt(5))/2)**(n-1)-((1-sym.sqrt(5))/2)**(n-1)) #一般項の式
    result=Fib.subs(x,n)
    result=result.evalf()
    return int(result)


N, M = map(int, input().split())
a = [-1]
for i in range(M):
    a.append(int(input()))
    
for i in range(M-1):
    if a[i+1] == (a[i] + 1):
        print(0)
        exit()
    
combi = 1

for i in range(len(a)-1):
    dis = a[i+1] - a[i]
    combi *= fib(dis)
    
dis = N+1 - a[-1]
combi *= fib(dis)

print(combi % 1000000007)

### FIXED CODE ###

def fib(n):
    a, b = 0, 1
    if n == 1:
        return a
    elif n == 2:
        return b
    else:
        for i in range(n-2):
            a, b = b, a + b
        return b
    
N, M = map(int, input().split())
a = [-1]
for i in range(M):
    a.append(int(input()))
    
for i in range(M-1):
    if a[i+1] == (a[i] + 1):
        print(0)
        exit()
    
combi = 1

for i in range(len(a)-1):
    dis = a[i+1] - a[i]
    #print(dis)
    combi *= fib(dis)
    #print(a[i])
    
dis = N+1 - a[-1]
#print(dis)
combi *= fib(dis)

print(combi % 1000000007)
# -*- coding: utf-8 -*-
from decimal import Decimal
# input
n = int(input())
a = list(map(int, input().split()))
out = 1
for i in range(n):
    out = Decimal(out * a[i])
    if out.conut(0) > 0:
        print(out)
        quit()
    elif out > Decimal(10**18):
        print(-1)
        quit()
print(out)


### FIXED CODE ###

# -*- coding: utf-8 -*-
from decimal import Decimal
# input
n = int(input())
a = list(map(int, input().split()))
out = 1
if 0 in a:
    print(0)
    quit()
for i in range(n):
    out = Decimal(out * a[i])
    if out > Decimal(10**18):
        print(-1)
        quit()
print(out)
h, w, d = map(int, input().split())

a = [list(map(int, input().split())) for i in range(h)]

dic = [0] * (h * w)

for i in range(h):
    for j in range(w):
        dic[a[i][j] - 1] = i, j

s = [[0] * (h * w // d + 1) for i in range(d)]

for i in range(d):
    for j in range(1, h * w // d + 1):
        b = i + d * (j - 1)
        c = i + d * j

        if c >= len(dic):
            break
        
        y, x = dic[b]
        ny, nx = dic[c]
        s[i][j] = s[i][j - 1] + abs(ny - y) + abs(nx - x)

q = int(input())

for i in range(q):
    l, r = map(int, input().split())
    l -= 1
    r -= 1
    print(s[l % d][r // d] - s[l % d][l // d])


### FIXED CODE ###

n = int(input())

print(n // 3)
n=int(input())
l=[]
for i in range(n):
    a,b=map(int,input().split())
    l.append([a-b+1,i])
    l.append([a+b,i])
l.sort()
re=0
c=[0]*n
f=0
mf
di=set([])
for i in range(n*2):
    p=l[i][0]
    j=l[i][1]
    if c[j]==0:
        c[j]+=1
        f+=1
        mf=max(mf,f)
        #di.add(j)
    else:
        f-=1 
        if f==0:
            re+=mf-1
        mf=0
            
        #f=0
print(n-re)


### FIXED CODE ###

n=int(input())
l=[]
for i in range(n):
    a,b=map(int,input().split())
    l.append([a-b,a+b])
l.sort(key=lambda x: x[1])
ans=1
nl=l[0][0]
nr=l[0][1]
for i in range(1,n):
    if l[i][0]<nr:
        continue
    else:
        nr=l[i][1]
        ans+=1
print(ans)
A,B = map(int, input().split())

print((A+B)//2 if (A+B)% ==0 else 'IMPOSSIBLE')


### FIXED CODE ###

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

print( (A+B)//2 if (A+B)%2 ==0 else 'IMPOSSIBLE')
"""
偶数番目、機数番目をそれぞれリストに格納
偶数番目の中で、（全て）ー（もっとも要素数が多い数の数）
機数番目の中で、（全て）ー（もっとも要素数が多い数の数）
この和を求めれば良い
→一部WA
→ちょうど2種類ではなく、1種類になってしまうことがあるからでは？

偶数群と奇数群で、最頻値で場合わけ
一致している場合とそうでない場合で計算を変える

"""
import collections


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

even = []
odd = []
for nn in range(n):
    if nn % 2 == 0:
        even.append(V[nn])
    else:
        odd.append(V[nn])

e = collections.Counter(even).most_common()
o = collections.Counter(odd).most_common()

if e[0][0] != o[0][0]:
    print(n - e[0][1] - o[0][1])
else:
    print(n - max(e[1][1] + o[0][1], e[0][1] + o[1][1]))



### FIXED CODE ###

import collections
n = int(input())
V = list(map(int, input().split()))

even = []
odd = []
for nn in range(n):
    if nn % 2 == 0:
        even.append(V[nn])
    else:
        odd.append(V[nn])

e = collections.Counter(even).most_common()
o = collections.Counter(odd).most_common()

if e[0][0] != o[0][0]:
    print(n - e[0][1] - o[0][1])
else:
    if len(e) == 1 and len(o) == 1:
        print(n // 2)
    elif len(e) == 1 and len(o) >= 2:
        print(n - o[0][1])
    elif len(e) >= 2 and len(o) == 1:
        print(n - e[0][1])
    else:
        print(n - max(e[1][1] + o[0][1], e[0][1] + o[1][1]))
n,m = map(int,input().split())

l = []

for i in range(m):
    ta,tb = map(int,input().split())
    l.append((ta-1,tb))
ans = [0]*n
l.sort()
if l[0][1] == 0:
    print(-1)
    exit()
else:
    for i,j in l:
        if ans[i] ==0 or ans[i] ==j:
            ans[i] = j
        else:
            # print(i,j)
            print(-1)
            exit()
a = ''
for i in ans:
    a+=str(i)
print(a)

        

### FIXED CODE ###


n,m = map(int,input().split())

l = []

for i in range(m):
    ta,tb = map(int,input().split())
    l.append((ta-1,tb))
ans = [0]*n
l.sort()
if m ==0 and n==1:
    print(0)
    exit()
elif m ==0:
    print('1'+'0'*(n-1))
    exit()
elif n == 1:
    if len(set(l)) ==1:
        print(l[0][1])
    else:
        print(-1)
    exit()
elif l[0][1] == 0 and l[0][0]==0:
    print(-1)
    exit()
else:
    l = set(l)
    for i,j in l:
        if ans[i] ==0:
            ans[i] = j
        else:
            # print(i,j)
            print(-1)
            exit()
a = ''
for i in ans:
    a+=str(i)
if a[0]=='0':
    a='1'+a[1:]
print(a)
s=["Sunny","Cloudy","Rainy"]
a=input()
if a=="Sunny":
    print(Cloudy)
elif a=="Cloudy":
    print(Rainy)
else:
    print(Sunny)

### FIXED CODE ###

s=["Sunny","Cloudy","Rainy"]
a=input()
if a=="Sunny":
    print("Cloudy")
elif a=="Cloudy":
    print("Rainy")
else:
    print("Sunny")
import math

input()
a = sorted((map(int, input().split())))
ans = a[0]
for i in range(1, len(a)):
    ans = math.gcd(ans, a[i])
print(ans)


### FIXED CODE ###

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

input()
a = sorted((map(int, input().split())))
ans = a[0]
for i in range(1, len(a)):
    ans = gcd(ans, a[i])
print(ans)
N = int(input())
K = list(map(int,input().split()))
M = dict(zip(range(1,N+1),K))
M = sorted(M.items(), key = lambda x:x[1])
newM = []
for i in M:
  newM.append(i[0])
print(+newM)

### FIXED CODE ###

N = int(input())
K = list(map(int,input().split()))
M = dict(zip(range(1,N+1),K))
M = sorted(M.items(), key = lambda x:x[1])
newM = []
for i in M:
  newM.append(i[0])
print(*newM)
S = str(input())
if S == 'ABC'
	print('ARC')
else S == 'ARC'
	print('ABC')

### FIXED CODE ###

S = str(input())
if S == 'ABC':
	print('ARC')
else:
	print('ABC')
#TIME : 
import sys
from math import sqrt
input = sys.stdin.readline

def inp():
    return(int(input()))
def inlt():
    return(list(map(int,input().split())))
def insr():
    s = input()
    return(list(s[:len(s) - 1]))
def invr():
    return(map(int,input().split()))

MAX = 10**18
n = inp()
a = inlt()
if 0 in A:
    print(0)
    exit()
res = 1
for num in a:
    res*=num
if res > MAX:
    print(-1)
else:
    print(res)

### FIXED CODE ###

def main ():
  N = int(input())
  A = list(map(int,input(). split ()))
  if 0 in A:
      print(0)
      return

  prod = 1
  for a in A:
      prod *= a
      if prod > 1000000000000000000:
          print(-1)
          return
  print(prod)

main ()
def main():
    x, y = map(int, input().split())

    if x == y:
        ans = 0
    if x >= 0 and y >= 0:
        if x < y:
            # x:1, y:3
            ans = y - x
        else:
            # x:3, y:1
            ans = 1 + y + x
    elif x < 0 and y < 0:
        if x < y:
            # x:-3, y:-1
            ans = y - x
        else:
            # x:-1, y:-3
            # x:1,2,3,-3
            ans = 1 + abs(y - x) + 1
    elif x < 0 < y:
        if abs(x) < y:
            # x:-3, y:4
            # x:3,4
            ans = 1 + y + x
        else:
            # x:-5, y:4
            ans = y - x
    elif x > 0 > y:
        if x > abs(y):
            # x:3, y:-1
            # x:-3,-2,-1
            ans = 1 + x + y
        else:
            # x:3, y:-4
            ans = abs(y + x) + 1

    print(ans)


if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    x, y = map(int, input().split())

    ans = f(x, y)
    print(ans)


def f(x, y):
    if x == y:
        ans = 0
    elif x >= 0 and y >= 0:
        if x < y:
            # x:0, y:3
            ans = y - x
        elif y == 0:
            # x:3, y:0 -> x:-3,-2,-1,0
            ans = 1 + x
        else:
            # x:3, y:1 -> x:-3,-2,-1,1
            ans = 1 + abs(y - x) + 1
    elif x < 0 and y < 0:
        if x < y:
            # x:-3, y:0
            ans = y - x
        else:
            # x:-2, y:-3 -> x:  2,3,-3
            ans = 1 + abs(y - x) + 1
    elif x < 0 and y == 0:
        # x:-5, y:0 -> x:-4,-3,-2,-1,0
        ans = abs(x)
    elif x < 0 < y:
        if abs(x) <= y:
            # x:-1, y:4 -> x:1,2,3,4
            ans = 1 + y + x
        else:
            # x:-5, y:4 -> x:-4,4
            ans = abs(y + x) + 1
    elif x == 0 and y < 0:
        # x:0, y:-4 -> x:1,2,3,4,-4
        ans = abs(y) + 1
    elif x > 0 > y:
        if x >= abs(y):
            # x:3, y:-1 -> x:-3,-2,-1
            ans = 1 + x + y
        else:
            # x:3, y:-4 -> x:      4,-4
            ans = abs(y + x) + 1

    return ans


def note():
    """
    x,yについて =0,<0,0> の全列挙
    3*3=9
    例外:x == y

    x == 0 and y == 0(例外に含まれる)
    x == 0 and y >  0
    x == 0 and y <  0

    x >  0 and y == 0
    x >  0 and y >  0
    x >  0 and y <  0

    x <  0 and y == 0
    x <  0 and y >  0
    x <  0 and y <  0

    実装しやすさによって、<=,>=を変更
    """


if __name__ == '__main__':
    main()
s = raw_input()
if '7' in s:
    print('Yes')
else:
    print('No')



### FIXED CODE ###

s = input()
if '7' in s:
    print('Yes')
else:
    print('No')
X, Y = map(int, input().split())
mod = 10**9 + 7

if (X + Y) % 3 != 0:
    print(0)
else:
    n2x = (2*X - Y) // 3
    n1x = (2*Y - X) // 3
    n = n2x + n1x

    # nCn2xを求める
    facs = [1] * (n+1)
    invs = [1] * (n+1)
    nfac = 1
    for i in range(1, n+1):
        nfac = nfac * i % mod
        facs[i] = nfac
        invs[i] = pow(facs[i], mod-2, mod)
    
    combs = facs[n] * invs[n2x] * invs[n-n2x] % mod
    print(combs)

### FIXED CODE ###

X, Y = map(int, input().split())
mod = 10**9 + 7

if (X + Y) % 3 != 0 or X > 2*Y or Y > 2*X:
    print(0)
else:
    n2x = (2*X - Y) // 3
    n1x = (2*Y - X) // 3
    n = n2x + n1x

    # nCn2xを求める
    def combs(n,n2x):
        invs = [1] * (n+1)
        nfac = 1
        for i in range(1, n+1):
            nfac = nfac * i % mod
            invs[i] = pow(nfac, mod-2, mod)
        return nfac * invs[n2x] * invs[n-n2x] % mod

    print(combs(n, n2x))
from functools import reduce
def comb(n, max_k, mod):
    """
    (n,k) := n個からk個選ぶ組み合わせ
    k = 0~max_Kまでを計算して返す
    """
    res = [1]*(max_k+1)
    t = 1
    for i in range(max_k+1):
        res[i] *= t
        t *= n-i
        t %= mod

    n = reduce(lambda x,y: (x*y)%mod, range(1,max_k+1), 1)
    n = pow(n, mod-2, mod)

    for i in reversed(range(max_k+1)):
        res[i] *= n
        res[i] %= mod
        n *= i
        n %= mod
    return res

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

d = X+Y

if d%3 != 0:
    print(0)
else:
    n = d//3

    res = comb(n,X-n, 10**9+7)[X-n]
    print(res)


### FIXED CODE ###


from functools import reduce
def comb(n, max_k, mod):
    """
    (n,k) := n個からk個選ぶ組み合わせ
    k = 0~max_Kまでを計算して返す
    """
    res = [1]*(max_k+1)
    t = 1
    for i in range(max_k+1):
        res[i] *= t
        t *= n-i
        t %= mod

    n = reduce(lambda x,y: (x*y)%mod, range(1,max_k+1), 1)
    n = pow(n, mod-2, mod)

    for i in reversed(range(max_k+1)):
        res[i] *= n
        res[i] %= mod
        n *= i
        n %= mod
    return res

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

d = X+Y

if d%3 != 0:
    print(0)
else:
    n = d//3
    if X < n or 2*n < X:
        res = 0
    else:
        res = comb(n,X-n, 10**9+7)[X-n]
    print(res)
S = str(input())
ans = []
for i  in range(len(S)):
    ans.append(x)
ans = ''.join(ans)
print(ans)

### FIXED CODE ###

S = str(input())
ans = []
for i  in range(len(S)):
    ans.append('x')
ans = ''.join(ans)
print(ans)
A = int(input()) #¥500
B = int(input()) #¥100
C = int(input()) #¥50
X = int(input())

count = 0
for a in range(A+1):
  for b in range(B+1):
    for c in range(C+1):
      if X == (a*500 + b*100 + c*50):
        count += 1
print(count)

### FIXED CODE ###

X = int(input())
A = int(input())
B = int(input())

print((X-A) % B)
import sys
def input(): return sys.stdin.readline().strip()
import math
def resolve():
    a,b=map(int, input().split())
    print((a*b)//math.gcd(a,b))
resolve()


### FIXED CODE ###

import sys


def input(): return sys.stdin.readline().strip()


import fractions


def resolve():
    a, b = map(int, input().split())
    print((a * b) // fractions.gcd(a, b))
resolve()
def main():
    n,m = map(int, input().split())
    ans = [0] * n
    flg = 0
    for i in range(m):
        j,k = map(int, input().split())
        if ans[j-1] == 0:
            ans[j-1] = k
        elif ans[j-1] != 0 and ans[j-1] != k:
            flg = -1
    if flg == -1:
        print(flg)
    elif ans[0] == 0:
        print(-1)
    else:
        print(ans[0],ans[1],ans[2],sep="")

if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
    n,m = map(int, input().split())
    ans = [0] * n
    chg = [0] * n
    flg = 0
    for i in range(m):
        j,k = map(int, input().split())
        if chg[j-1] == 1 and ans[j-1] != k:
            flg = -1
        elif ans[j-1] == 0:
            ans[j-1] = k
            chg[j-1] = 1
    if flg == -1:
        print(flg)
    elif len(ans) >= 2 and ans[0] == 0:
        if chg[0] == 0:
            ans[0] = 1
            if n == 3:
                print(ans[0], ans[1], ans[2], sep="")
            elif n == 2:
                print(ans[0], ans[1], sep="")
        else:
            print(-1)
    else:
        if n == 3:
            print(ans[0],ans[1],ans[2],sep="")
        elif n == 2:
            print(ans[0],ans[1],sep="")
        else:
            print(ans[0])


if __name__ == '__main__':
    main()
a,b,c,d,e,f = map(int, input().split())

per = 0
ans = []

for i in range(f//(100*a) + 1):
    for j in range(f//(100*b) + 1):
        w = i * a * 100 + j * b * 100
        if w > f or w == 0:
            break
        for k in range((e * w//100)//c + 1):
            for l in range((e * w//100)//d + 1):
                if e * w//100 < c * k + d * l or w + c * k + d * l > f:
                    break
                now = 100 * (c*k+d*l) / (w+c*k+d*l)
                if per < now:
                    per = now
                    ans = [w+c*k+d*l, c*k+d*l]
if ans = []:
    print(100*a, 0)
else:
    print(ans[0], ans[1])



### FIXED CODE ###

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

per = 0
ans = []

for i in range(f//(100*a) + 1):
    for j in range(f//(100*b) + 1):
        w = i * a * 100 + j * b * 100
        if w > f or w == 0:
            break
        for k in range((e * w//100)//c + 1):
            for l in range((e * w//100)//d + 1):
                if e * w//100 < c * k + d * l or w + c * k + d * l > f:
                    break
                now = 100 * (c*k+d*l) / (w+c*k+d*l)
                if per < now:
                    per = now
                    ans = [w+c*k+d*l, c*k+d*l]
if ans == []:
    print(100*a, 0)
else:
    print(ans[0], ans[1])
from sys import stdin


def get(l, r):
    for i in range(1, 10001):
        if i != l and i != r:
            return i
    assert False, 'damepo'


def check(a):
    for i, x in enumerate(a[1:-1]):
        idx = i + 1
        l = a[idx - 1]
        r = a[idx + 1]
        assert l != x and x != r, 'damepo'


def main():
    N = int(stdin.readline().rstrip())
    a = [int(x) for x in stdin.readline().rstrip().split()]
    check(a)
    count = 0
    for i, x in enumerate(a[1:-1]):
        idx = i + 1
        l = a[idx - 1]
        r = a[idx + 1]
        if (l == x and x != r) or (l == x == r) or ((idx == len(a) - 2) and x == r):
            x = get(l, r)
            count += 1
            a[idx] = x
    # print(a)
    print(count)


if __name__ == '__main__':
    main()


### FIXED CODE ###

from sys import stdin


def get(l, r):
    for i in range(1, 10001):
        if i != l and i != r:
            return i
    assert False, 'damepo'


def main():
    N = int(stdin.readline().rstrip())
    a = [int(x) for x in stdin.readline().rstrip().split()]

    count = 0
    if N == 2:
        if a[0] == a[1]:
            count += 1
    else:
        for i, x in enumerate(a[1:-1]):
            idx = i + 1
            l = a[idx - 1]
            r = a[idx + 1]
            if (l == x and x != r) or (l == x == r) or ((idx == len(a) - 2) and x == r):
                x = get(l, r)
                count += 1
                a[idx] = x
        # print(a)
    print(count)


if __name__ == '__main__':
    main()
if __name__ =='__main__':
    N ＝ raw_input()
    A = raw_input()
    ans = N**2 - A
    print ans

### FIXED CODE ###

if __name__ =='__main__':
    N = int(input())
    A = int(input())
    ans = N**2-A
    print(ans)
a1 = list(map(int,input().split()))
a2 = list(map(int,input().split()))
a3 = list(map(int,input().split()))

l1=[a1[0],a2[0],a3[0]]
l2=[a1[1],a2[1],a3[1]]
l3=[a1[2],a2[2],a3[2]]
l4=[a1[0],a1[1],a1[2]]
l5=[a2[0],a2[1],a2[2]]
l6=[a3[0],a3[1],a3[2]]
l7=[a1[0],a2[1],a3[2]]
l8=[a1[2],a2[1],a3[0]]

N=int(input())
for i in range(N):
  b=int(input())
  try:
    a1.remove(b)
  else:
    pass
  try:
    a2.remove(b)
  else:
    pass
  try:
    a3.remove(b)
  else:
    pass
if(sum(l1)==0 or sum(l2)==0 or sum(l3)==0 or sum(l4)==0 or sum(l5)==0 or sum(l6)==0 or sum(l7)==0 or sum(l1)==8):
  print("Yes")
else:
  print("No")

### FIXED CODE ###

a1 = list(map(int,input().split()))
a2 = list(map(int,input().split()))
a3 = list(map(int,input().split()))

N=int(input())
for i in range(N):
  b=int(input())
  if(a1[0]==b):
    a1[0]=0
  if(a1[1]==b):
    a1[1]=0
  if(a1[2]==b):
    a1[2]=0
  if(a2[0]==b):
    a2[0]=0
  if(a2[1]==b):
    a2[1]=0
  if(a2[2]==b):
    a2[2]=0
  if(a3[0]==b):
    a3[0]=0
  if(a3[1]==b):
    a3[1]=0
  if(a3[2]==b):
    a3[2]=0                                   
l1=[a1[0],a2[0],a3[0]]
l2=[a1[1],a2[1],a3[1]]
l3=[a1[2],a2[2],a3[2]]
l4=[a1[0],a1[1],a1[2]]
l5=[a2[0],a2[1],a2[2]]
l6=[a3[0],a3[1],a3[2]]
l7=[a1[0],a2[1],a3[2]]
l8=[a1[2],a2[1],a3[0]]
if(sum(l1)==0 or sum(l2)==0 or sum(l3)==0 or sum(l4)==0 or sum(l5)==0 or sum(l6)==0 or sum(l7)==0 or sum(l8)==0):
  print("Yes")
else:
  print("No")
n,m=map(int,input().split())
s=str(input())
t=str(input())
from math import gcd
def lcm(a,b):
    return a*b//gcd(a,b)
if n%m!=0:
    if s[0]==t[0]:
        print(lcm(n,m))
    else:
        print("-1")
else:
    x=n//m
    for i in range(m):
        if s[0+x*i]!=t[i]:
            print("-1")
            exit()
    print(lcm(n,m))

### FIXED CODE ###

n,m=map(int,input().split())
s=str(input())
t=str(input())
def gcd(x, y):
    if x % y == 0:
        return(y)
    else:
        return gcd(y,x%y)
def lcm(a,b):
    return a*b//gcd(a,b)
a=n//gcd(n,m)
b=m//gcd(n,m)
for i in range(gcd(n,m)):
    if s[a*i]!=t[b*i]:
        print("-1")
        exit()
print(lcm(n,m))
a,b=map(int,input().split())

if(x%2==0 or y%2==0):
    print("Even")
else:
    print("Odd")

### FIXED CODE ###

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

if(x%2==0 or y%2==0):
    print("Even")
else:
    print("Odd")
a, b, c = map(int,input().split())
if a[-1] == b[0] and b[-1] == c[0]:
	print("YES")
else:
	print("NO")

### FIXED CODE ###

a, b, c = input().split()
if a[-1] == b[0] and b[-1] == c[0]:
	print("YES")
else:
	print("NO")
N = int(input())
A=list(map(int, input().split()))

def sol(i,want):
    num=int(N/(i+1))
    wa=-A[0]
    for j in range(num):
        wa+=A[i+j*i]
    wa=wa%2
    if wa==want:
        x=0
    else:
        x=1
#     print(num)
    return x 

B=A[:]
for i in range(half):
    j=half-1-i
#     print(j)
    B[j]=sol(j,A[j])
m=sum(B)
print(m)
ans=''
for b in B:
    ans+=str(b)+ ' '
print(ans)



### FIXED CODE ###

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




def sol(i,want):
    num=N//(i+1)
    wa=B[i]

    for j in range(num):
        k=i+j*(i+1)
        wa+=B[k]
#         print(i,wa,B[i])
#         print((i+1)+j*(i+1)-1)
#     print(i,wa,B[i])
    wa=wa%2
#     print(i,wa,A[i])
    
    if wa==want:
        x=0
    else:
        x=1
#     print(num)
    return x 

B=A[:]
half=N//2
for i in range(half):
    j=half-1-i
#     print(j)
    B[j]=sol(j,A[j])
    
C=[i+1 for i, x in enumerate(B) if x ==1]

m=sum(B)
print(m)
print(*C)
n,x=map(int,input().split())
a=list(map(int,input().split()))
if n<x:#ｎこのDPを作りたいのでｘが超えたらそれを変える必要がある
    dp=[-1]*(x+1)
else:#でもこれは実際甘え
    dp[-1]*n
dp[0]=0#さいしょのところは０かかる
for i in range(1,x+1):#飛べる距離までとべるところから最初の値を引く
    dp[i]=abs(a[i]-a[0])

for i in range(x+1,n):#さいしょのいちから飛べないところからDPを入れる
    min1=10**9
    for j in range(i-(x),i): # 最小を調べる繰り返し
        if min1>dp[j]+abs(a[j]-a[i]):               
            min1=dp[j]+abs(a[j]-a[i])#Xの数最小の値を調べる
    dp[i]=min1
print(dp[-1])

### FIXED CODE ###

n,x=map(int,input().split())
a=list(map(int,input().split()))
dp=[-1]*n
dp[0]=0
if n<=x:
    x=n-1
for i in range(1,x+1):
    dp[i]=abs(a[i]-a[0])

for i in range(x+1,n):
    min1=10**9
    for j in range(i-(x),i):  
        if min1>dp[j]+abs(a[j]-a[i]):               
            min1=dp[j]+abs(a[j]-a[i])
    dp[i]=min1
print(dp[-1])