Harryxun/stf_run huggingface dataset:
N=int(input())
if N%2==0:
  print(N//2*(N-1))
elif:
  print((N-1)//2*N)

### FIXED CODE ###

N=int(input())
print((N-1)*N//2)
from collections import deque

S = input()
Q = int(input())
q = deque(S)
fg = False

for i in range(Q):
    que = list(map(str , input().split()))
    if que[0] == "1":
        fg = not fg
    elif (que[1] == "1" and fg == False) or (que[1] == "2" and fg == True) :
        q.appendleft(que[2])
    else:
        q.append(que[2])

if not fg:
    q.reverse()

print("".join(q))a



### FIXED CODE ###

from collections import deque

S = input()
Q = int(input())
q = deque(S)
fg = False
for i in range(Q):
    que = list(map(str , input().split()))
    if que[0] == "1":
        fg = not fg
    elif (que[1] == "1" and fg == False) or (que[1] == "2" and fg == True) :
        q.appendleft(que[2])
    else:
        q.append(que[2])
if fg:
    q.reverse()
print("".join(q))
cube = x*x*x
print(cube)


### FIXED CODE ###

x = int(input())
cube = x **3

print(cube)
a,b,c = [int(i) for i in input().split()]
print((a * b) / 2))

### FIXED CODE ###

a,b,c = [int(i) for i in input().split()]
print(a * b // 2)
x,y=map(int,input().split())
if x==1 or x==3 or x==5 or x== 7 or ==8 or x==12 or x==!0:
    if y==1 or y==3 or y==5 or y==7 or y==8 or y==10 or y==12:
        print('Yes')
    else:
        print('No')
elif x==4 or x==6 or x==9 or x==11:
    if y==4 or y==6 or y==9 or y==12:
        print('Yes')
    else:
        print('No')
else:
    print('No')


### FIXED CODE ###

x,y=map(int,input().split())
if x==1 or x==3 or x==5 or x== 7 or x==8 or x==12 or x==10:
    if y==1 or y==3 or y==5 or y==7 or y==8 or y==10 or y==12:
        print('Yes')
    else:
        print('No')
elif x==4 or x==6 or x==9 or x==11:
    if y==4 or y==6 or y==9 or y==11:
        print('Yes')
    else:
        print('No')
else:
    print('No')
s=input()
a=int(s[:2])
b=int(s[2:])
if a>=13 and b>=1 and b<=12:
  print("YYMM")
elif a>=1 and a<=12 and (b==0 or b>=13):
  print("MMYY")
elif a>=1 and a<=12 b>=1 and b<=12:
  print("AMBIGUOUS")
else:
  print("NA")

### FIXED CODE ###

s=input()
a=int(s[0]+s[1])
b=int(s[2]+s[3])

if a>=13 and b>=1 and b<=12:
  print("YYMM")
elif a==0 and b>=1 and b<=12:
  print("YYMM")  
elif a>=1 and a<=12 and b>=13:
  print("MMYY")
elif a>=1 and a<=12 and b==0:
  print("MMYY")
elif a>=1 and a<=12 and b>=1 and b<=12:
  print("AMBIGUOUS")
else:
  print("NA")
import math
n, m = map(int,input().split())
a = []
pam = -1

def fib(k):
    if k<0:
        return 0
    r=(((1+math.sqrt(5))/2)**(k+1)-((1-math.sqrt(5))/2)**(k+1))/math.sqrt(5)
    return round(r)


for i in range(0,m):
    am = int(input())
    a.append(am-pam)
    pam = am
a.append(n+1-pam)
count = 1
for aa in a:
    count = count * (fib(aa-2))%(1000000007)
print(count%(1000000007))

### FIXED CODE ###

n, m = map(int,input().split())
a = []
for i in range(m):
    a.append(int(input()))
dp = []
dp.append(1)
if m == 0:
    a.append(-1)
j = 0
k = len(a)-1
if 1 == a[j]:
    dp.append(0)
    j = min(k,j+1)
else:
    dp.append(1)

for i in range(2,n+1):
    if i == a[j]:
        dp.append(0)
        j = min(k,j+1)
    else:
        dp.append(dp[i-1] + dp[i-2])

print(dp[n]%(1000000007))
n, m = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
for i in range(m):
    a[-1] //= 2
    if a[-1] < a[-2]:
        a.sort()
print(sum(a))


### FIXED CODE ###

import heapq
n, m = map(int, input().split())
a = [-int(i) for i in input().split()]
heapq.heapify(a)
for _ in range(m):
    mx = -heapq.heappop(a)
    heapq.heappush(a, -(mx // 2))
print(-sum(a))
N = int(input())
P = list(map(int,input().split()))
Q = list(map(int,input().split()))

def f(n):
    if n == 1:
        return(1)
    else:
        return(n * f(n-1))

def g(a):
    if a == []:
        return(1)
    else:
        b = sorted(a)
        for i in range(0,len(a)):
            if a[0] == b[i]:
                a.pop(0)
                return(i * f(len(a)) * g(a))

print(abs(g(P)-g(Q)))

### FIXED CODE ###

import math
N = int(input())
P = list(map(int,input().split()))
Q = list(map(int,input().split()))

def g(a):
    if a == []:
        return(1)
    else:
        b = sorted(a)
        for i in range(0,len(a)):
            if a[0] == b[i]:
                a.pop(0)
                return(i * math.factorial(len(a)) + g(a))

print(abs(g(P)-g(Q)))
#!/usr/bin/env python3
from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall, dijkstra
# G = csgraph_from_dense(edge, null_value=10**9)
# f = floyd_warshall(G)
# d = dijkstra(G, indices=1)
import sys
input = lambda: sys.stdin.readline()[:-1]
sys.setrecursionlimit(10**8)

xs,ys,xt,yt=map(int,input().split())
n=int(input())
xyr=[(xs,ys,0),(xt,yt,0)]
data=[[-1]*(n+2) for i in range(n+2)]
for i in range(n):
    xyr.append(tuple(map(int,input().split())))
# print(xyr)

for i in range(n+1):
    for j in range(i+1,n+2):
        x0 = xyr[i][0]
        y0 = xyr[i][1]
        r0 = xyr[i][2]
        x1 = xyr[j][0]
        y1 = xyr[j][1]
        r1 = xyr[j][2]
        data[i][j]=max(((x0-x1)**2+(y0-y1)**2)**.5-r0-r1,0)

G = csgraph_from_dense(data, null_value=-1)
# for i in G:
#     print(i)
d = dijkstra(G, indices=0, directed=False)
print(d[1])



### FIXED CODE ###

#!/usr/bin/env python3
from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall
from collections import deque
import sys
input = lambda: sys.stdin.readline()[:-1]
sys.setrecursionlimit(10**8)
def solve():
    n=int(input())
    data=[list(map(int,list(input()))) for i in range(n)]
    fordfs=[[] for i in range(n)]
    for i in range(n):
        for j in range(n):
            if data[i][j]==1:
                fordfs[i].append(j)

    def dfs():
        V=[-1]*n
        V[0]=0
        que=deque()
        que.append(0)
        while que:
            now=que.popleft()
            nowv=V[now]
            for ne in fordfs[now]:
                if nowv==V[ne]:
                    print(-1)
                    exit()
                elif V[ne]==-1:
                    V[ne]=(nowv+1)%2
                    que.append(ne)
    
    dfs()
    # print(data)
    G=csgraph_from_dense(data)
    d = floyd_warshall(G)
    d.tolist()
    M=0
    for i in d:
        M=max(M,max(i))
    M=int(M)
    print(M+1)
    return



def main():

    solve()
    return
if __name__ == '__main__':
    main()
H,W,K = map(int,input().split())
S = [input().strip() for _ in range(H)]
A = [[0 for _ in range(W)] for _ in range(H)]
G = []
for i in range(H):
    for j in range(W):
        if S[i][j]=="#":
            G.append((i,j))
G = sorted(G,key=lambda x:x[0])
G = sorted(G,key=lambda x:x[1])
k = len(G)
cnt = 1
u = 0
l = 0
for i in range(k):
    if G[i][1]<W-1 and G[i][1]<G[i+1][1]:
        for i1 in range(u,H):
            for j1 in range(l,G[i+1][1]):
                A[i1][j1] = cnt
        u = 0
        l = G[i+1][1]
        cnt += 1
    elif G[i][1]<W-1 and G[i][1]==G[i+1][1]:
        j = i+2
        flag = 0
        while j<k:
            if G[i][1]<G[j][1]:
                flag = 1
                break
            j += 1
        if flag==1:
            for i1 in range(u,G[i+1][0]):
                for j1 in range(l,G[j][1]):
                    A[i1][j1] = cnt
            u = G[i+1][0]
            cnt += 1
        else:
            for i1 in range(u,G[i+1][0]):
                for j1 in range(l,W):
                    A[i1][j1] = cnt
            u = G[i+1][0]
            l = 0
            cnt += 1
    else:
        if i<k-1:
            for i1 in range(u,G[i+1][0]):
                A[i1][W-1] = cnt
            u = G[i+1][0]
            cnt += 1
        else:
            for i1 in range(u,H):
                A[i1][W-1] = cnt
for i in range(H):
    print(*A[i])

### FIXED CODE ###

H,W,K = map(int,input().split())
S = [input().strip() for _ in range(H)]
A = [[0 for _ in range(W)] for _ in range(H)]
row = 0
cnt = 1
for i in range(H):
    B = []
    for j in range(W):
        if S[i][j]=="#":
            B.append(j)
    if len(B)==0:
        continue
    elif len(B)==1:
        for k in range(row,i+1):
            for j in range(W):
                A[k][j] = cnt
        cnt += 1
        row = i+1
    else:
        for l in range(len(B)):
            if l==0:
                for k in range(row,i+1):
                    for j in range(B[0]+1):
                        A[k][j] = cnt
                cnt += 1
            elif l<len(B)-1:
                for k in range(row,i+1):
                    for j in range(B[l-1]+1,B[l]+1):
                        A[k][j] = cnt
                cnt += 1
            else:
                for k in range(row,i+1):
                    for j in range(B[-2]+1,W):
                        A[k][j] = cnt
                cnt += 1
        row = i+1
if row != H:
    for i in range(row,H):
        for j in range(W):
            A[i][j] = A[i-1][j]
for i in range(H):
    print(*A[i])
MOD = 10**9 + 7

#上限指定がなければ0,0 or 0,1 or 1,0
pow_3 = [1]
for _ in range(2*10**5):
  pow_3.append((pow_3[-1]*3)%MOD)

def F(i):
  # i桁目以降をL[i:]以下で作る方法
  if i == L_size:
    return 1
  result = 0
  c = int(L[i])
  if c == 0:
    # 0,0ととるしかない
    result += F(i+1)
  else:
    # 0,1 あるいは 1,0 ととった場合
    result += 2*F(i+1)
    # 0,0ととった場合は、下の桁は自由
    result += pow_3[L_size - i - 1]
  result %= MOD
  return result



L = input()
L_size = len(L)

answer = F(0)
print(answer)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)
MOD = 10**9 + 7

#上限指定がなければ0,0 or 0,1 or 1,0
pow_3 = [1]
for _ in range(2*10**5):
  pow_3.append((pow_3[-1]*3)%MOD)

def F(i):
  # i桁目以降をL[i:]以下で作る方法
  if i == L_size:
    return 1
  result = 0
  c = int(L[i])
  if c == 0:
    # 0,0ととるしかない
    result += F(i+1)
  else:
    # 0,1 あるいは 1,0 ととった場合
    result += 2*F(i+1)
    # 0,0ととった場合は、下の桁は自由
    result += pow_3[L_size - i - 1]
  result %= MOD
  return result



L = input()
L_size = len(L)

answer = F(0)
print(answer)
s=input()

l=len(s)

for i in range(l):
  s[i]="x"
  
  
print(s)


### FIXED CODE ###

s=input()
a=""

l=len(s)

for i in range (l):
  a=a+"x"
print(a)
try:
    while True:
        v=raw_input().split()
        print(m[''.join(v)][1])
except EOFError:
    pass
"""

/*

0 1 2 3 4 5 6 7
1 0 2 3 4 5 6 7
7 6 5 4 3 2 1 0


0
1
28
*/

"""

### FIXED CODE ###

from __future__ import division
import sys
if sys.version_info[0]>=3: raw_input=input

X=4
Y=2
i=0
m={}
prev={}
v=[]
for i in range(X*Y): v.append(str(i))
m[''.join(v)]=[0,0]
prev[''.join(v)]=[''.join(v),None]
q=[v]
while len(q)>0:
	v=q.pop(0)
	coor=m[''.join(v)][0]
	x=coor%X
	y=coor//X
	depth=m[''.join(v)][1]
	nextstr=''.join(v)
	if 0<x:
		v[coor],v[coor-1]=v[coor-1],v[coor]
		if ''.join(v) not in m:
			m[''.join(v)]=[coor-1,depth+1]
			q.append(v[:])
			prev[''.join(v)]=[nextstr,'R']
		v[coor],v[coor-1]=v[coor-1],v[coor]
	if x<X-1:
		v[coor],v[coor+1]=v[coor+1],v[coor]
		if ''.join(v) not in m:
			m[''.join(v)]=[coor+1,depth+1]
			q.append(v[:])
			prev[''.join(v)]=[nextstr,'L']
		v[coor],v[coor+1]=v[coor+1],v[coor]
	if 0<y:
		v[coor],v[coor-X]=v[coor-X],v[coor]
		if ''.join(v) not in m:
			m[''.join(v)]=[coor-X,depth+1]
			q.append(v[:])
			prev[''.join(v)]=[nextstr,'D']
		v[coor],v[coor-X]=v[coor-X],v[coor]
	if y<Y-1:
		v[coor],v[coor+X]=v[coor+X],v[coor]
		if ''.join(v) not in m:
			m[''.join(v)]=[coor+X,depth+1]
			q.append(v[:])
			prev[''.join(v)]=[nextstr,'U']
		v[coor],v[coor+X]=v[coor+X],v[coor]

try:
	while True:
		v=raw_input().split()
		print(m[''.join(v)][1])
except EOFError:
	pass
h, w = map(int, input().split())
data = []
for _ in range(h):
    data.append( list(input()) )

next_data = []
# 横列処理
for d in data:
    if "#" in d:
        next_data.append( d )

next_next_data = []
origin_v_data = []
# 縦列処理
for i in range( len(next_data[0]) ):
    # 縦配列生成
    v_data = []
    for j in range( len(next_data) ):
        v_data.append( next_data[j][i] )

    # 配列チェック
    if "#" in v_data:
        origin_v_data.append( v_data )

ans_data = []
for i in range( len(origin_v_data[0]) ):
    join_data = []
    for j in range( len(origin_v_data) ):
        join_data.append( origin_v_data[i][j] )
    ans_data.append( join_data )

# 標準出力
for a in ans_data:
    print("".join(a))


### FIXED CODE ###

h, w = map(int, input().split())
data = []
for _ in range(h):
    data.append( list(input()) )

next_data = []
# 横列処理
for d in data:
    if "#" in d:
        next_data.append( d )

next_next_data = []
origin_v_data = []
# 縦列処理
for i in range( len(next_data[0]) ):
    # 縦配列生成
    v_data = []
    for j in range( len(next_data) ):
        v_data.append( next_data[j][i] )

    # 配列チェック
    if "#" in v_data:
        origin_v_data.append( v_data )

ans_data = []
for i in range( len(origin_v_data[0]) ):
    join_data = []
    for j in range( len(origin_v_data) ):
        join_data.append( origin_v_data[j][i] )
    ans_data.append( join_data )

# 標準出力
for a in ans_data:
    print("".join(a))
n = int(input())
a = list(map(int,input().split()))
a_ = sorted(a)
if len(a)==2:
    print(a_[1],a_[0])
    exit()
a = a_[::-1]
import bisect
import math
def combinations_count(n,r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))
ret = 0
for i in range(10):
    k = bisect.bisect_left(a_,a[i]//2)
    if a[i]//2-a_[k]>a_[k+1]-a[i]//2:
        k += 1
    cmb = combinations_count(a[i],a_[k])
    if ret<cmb:
        ans = [a[i],a_[k]]
        ret = cmb
print(ans[0],ans[1])

### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
a_ = sorted(a)
if len(a)==2:
    print(a_[1],a_[0])
    exit()
a = a_[::-1]
k = 10**9
for i in range(1,n):
    if k>abs(a[0]/2-a[i]):
        k=abs(a[0]/2-a[i])
        ans = [a[0],a[i]]
print(ans[0],ans[1])
def main():
	N = int(input())
	A = list(map(int, input().split()))
	while(len(A) != 1):
		A = QUICKSORT(A)
		mini = A[0]
		for i in range(1, len(A)):
			if i >= len(A):
				continue
			if A[i] % mini == 0:
				A.pop(i)
			else:
				A[i] = A[i] % mini
		A = list(set(A))
	print(A[0])

def QUICKSORT(A):
	if len(A) < 1:
		return A
	pivot = A[0]
	left = []
	right = []
	for x in range(1, len(A)):
		if A[x] <= pivot:
			left.append(A[x])
		else:
			right.append(A[x])
	left = QUICKSORT(left)
	right = QUICKSORT(right)
	foo = [pivot]
	return left + foo + right

if __name__ == '__main__':
	main()

### FIXED CODE ###

def main():
	N = int(input())
	A = list(map(int, input().split()))
	while(len(A) != 1):
		A.sort()
		mini = A[0]
		i = 1
		while(True):
			if A[i] % mini == 0:
				A.pop(i)
			else:
				A[i] = A[i] % mini
				i += 1
			if i == len(A):
				break
		A = list(set(A))
	print(A[0])

if __name__ == '__main__':
	main()
#ABC144A
a,b = map(int,input().split())
print(a*b if 1<=a<=9 ans 1<=b<=9 else -1)

### FIXED CODE ###

#ABC144A
a,b = map(int,input().split())
print(a*b if 1<=a<=9 and 1<=b<=9 else -1)
S = input()

ans = 0
count_list = [[2 ** (len(S)-1)]]

for i in range(1, len(S)):
    if i == 1:
        count_list.append([2 ** (len(S)-2), 2 ** (len(S)-2)])
    else:
        count_list.append([*count_list[i-1][:i-1], count_list[i-1][-1]//2, count_list[i-1][-1]//2])

count_list = count_list[::-1]

for i in range(len(S)):
    flag = 1
    for j in count_list[i]:
        ans += int(S[i]) * flag * j
        flag *= 10

print(ans)

### FIXED CODE ###

S = input()

ans = 0
count_list = [[2 ** (len(S)-1)]]

for i in range(1, len(S)):
    if i == 1:
        count_list.append([2 ** (len(S)-2), 2 ** (len(S)-2)])
    else:
        a = []
        for j in count_list[i-1][:i-1]:
            a.append(j)
        a.append(count_list[i-1][-1]//2)
        a.append(count_list[i-1][-1]//2)
        count_list.append(a)

count_list = count_list[::-1]

for i in range(len(S)):
    flag = 1
    for j in count_list[i]:
        ans += int(S[i]) * flag * j
        flag *= 10

print(ans)
N, M = map(int, input().split())
data = [[int(i) for i in input().split()] for i in range(M)]
  
corresp = {}
for n in range(1, N+1):
    data_n = []
    for i in range(M):
        if data[i][0] == n:
            data_n.append(data[i])
    sort_n = sorted(data_n, key=lambda data_n_i: data_n_i[1])
    for k in range(len(sort_n)):
        corresp.update({str(sort_n[k]):k+1})
    

for i in range(M):
    print('{0:012d}'.format(data[i][0]*100000+corresp[str(data[i])]))


### FIXED CODE ###

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

print(X+(Y//2))
N,A,B = map(int, input().split())
addBlue = 'b'*A
addRed = 'r'*B
boals = ''

while len(boals) < N:
    boals += addBlue
    boals += addRed

print(boals[:N].count('b'))

### FIXED CODE ###

N,A,B = map(int, input().split())
adds = A + B
times = N // adds
boalsLen = adds * times
count = A * times


while True:
    if boalsLen > N:
        break
    
    tmpBoalsLen = boalsLen + A
    if tmpBoalsLen > N:
        addBoals = N - boalsLen
        count += addBoals
        break
    
    boalsLen = tmpBoalsLen
    boalsLen += B
    count += A

print(count)
a, b, c = map(int, raw_input().split())
d = a / b
r = a % b
f = float(a) / float(b)
print '%d %d %f' %(d, r, f)

### FIXED CODE ###

a, b = map(int, raw_input().split())
d = a / b
r = a % b
f = float(a) / float(b)
print '%d %d %f' %(d, r, f)
from fractions import gcd

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

def lcm(a):
    x = a[0]
    for i in range(1, len(a)):
        x = (x * a[i]) // gcd(x, a[i])
    return x

l = lcm(a)
count = 0
for i in range(len(a)):
    count += int(l/a[i])
    count = count % (1000000007)
print(count)

### FIXED CODE ###

from fractions import gcd
 
n = int(input())
a = list(map(int, input().split()))
mod = 10 ** 9 + 7
l = 1
for i in a:
    l = i * l // (gcd(i, l))
 
cnt = 0
for i in a:
    cnt += l // i
print(cnt % mod)
#from collections import deque,defaultdict
printn = lambda x: print(x,end='')
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
ins = lambda : input().strip()
DBG = True # and False
BIG = 10**18
R = 10**9 + 7
#R = 998244353

def ddprint(x):
  if DBG:
    print(x)

n,k = inm()
a = inl()
if n==4 and k==2:
    3/0
mx = sum(a)
lacc = [0]*(n+1)
racc = [0]*(n+1)
for i in range(n):
    lacc[i+1] = lacc[i]+max(a[i],0)
for i in range(n-1,-1,-1):
    racc[i] = racc[i+1]+max(a[i],0)
sk = sum(a[:k])
for i in range(n-k+1):
    mx = max(mx,lacc[i]+max(sk,0)+racc[i+k])
    if i<n-k:
        sk += a[i+k]-a[i]
print(mx)


### FIXED CODE ###

#from collections import deque,defaultdict
printn = lambda x: print(x,end='')
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
ins = lambda : input().strip()
DBG = True # and False
BIG = 10**18
R = 10**9 + 7
#R = 998244353

def ddprint(x):
  if DBG:
    print(x)

n,k = inm()
a = inl()
if n<-4 and k==2:
    3/0
mx = sum(a)
lacc = [0]*(n+1)
racc = [0]*(n+1)
for i in range(n):
    lacc[i+1] = lacc[i]+max(a[i],0)
for i in range(n-1,-1,-1):
    racc[i] = racc[i+1]+max(a[i],0)
sk = sum(a[:k])
for i in range(n-k+1):
    mx = max(mx,lacc[i]+max(sk,0)+racc[i+k])
    if i<n-k:
        sk += a[i+k]-a[i]
print(mx)
S = sorted(list(map(int, input().split())))
print('Yes' if X[0]==X[1] and X[2]==X[3] else 'No')

### FIXED CODE ###

S = set(input())
print('Yes' if len(S)==2 else 'No')
n = raw_input()

print(int(n)**3)

### FIXED CODE ###

x = int(input())
print(x**3)
X=1
Y=2
Z=3

A=Y
B=X
C=A
A=Z

Print(A,B,C)

### FIXED CODE ###

n=input().split()
X=n[0]
Y=n[1]
Z=n[2]

A=Y
B=X
C=A
A=Z

print(A,B,C)
line = list(input())
nums = [int(n) for n in line]
BadCookie = nums[0]
GoodCookie = nums[1]
GoodPoson = nums[2]

print(GoodCookie+(GoodPoson-(GoodCookie+BadCookie)))

### FIXED CODE ###

nums = input().split(' ')

BadCookie = int(nums[0])
GoodCookie = int(nums[1])
GoodPoson = int(nums[2])
if GoodCookie + BadCookie > GoodPoson:
    print(GoodCookie+GoodPoson)
elif GoodCookie + BadCookie < GoodPoson:
    print(GoodCookie+BadCookie+GoodCookie+1)
else:
    print(GoodCookie+GoodPoson)
import numpy as np
A=list(list(map(int, input().split())) for _ in range(3))
N=int(input())
B=list(int(input()) for _ in range(N))
a=np.array(A)
c=a.flatten()
C=c.tolist()

for c in range(len(C)):
    for b in range(len(B)):
        if C[c]==B[b]:
            C[c]=0

            if (sum(C[:3])==0) | (sum(C[3:6])==0) | (sum(C[6:9])==0):
    print("Yes")
elif (C[0]+C[3]+C[6]==0) | (C[1]+C[4]+C[7]==0) | (C[2]+C[5]+C[8]==0):
    print("Yes")
elif (C[0]+C[4]+C[8]==0) | (C[2]+C[4]+C[6]==0): 
    print("Yes")
else:
    print("No")

### FIXED CODE ###

import numpy as np
A=list(list(map(int, input().split())) for _ in range(3))
N=int(input())
B=list(int(input()) for _ in range(N))
a=np.array(A)
c=a.flatten()
C=c.tolist()

for c in range(len(C)):
    for b in range(len(B)):
        if C[c]==B[b]:
            C[c]=0

if (sum(C[:3])==0) | (sum(C[3:6])==0) | (sum(C[6:9])==0):
    print("Yes")
elif (C[0]+C[3]+C[6]==0) | (C[1]+C[4]+C[7]==0) | (C[2]+C[5]+C[8]==0):
    print("Yes")
elif (C[0]+C[4]+C[8]==0) | (C[2]+C[4]+C[6]==0): 
    print("Yes")
else:
    print("No")
from requests import api

n,W = map(int,input().split())
w,v = [],[]
for i in range(n):
    wi,vi = map(int,input().split())
    w.append(wi)
    v.append(vi)
sv = sum(v)
INF = float("INF")
dp = [[INF]*sv for i in range(n+1)]
dp[0][0] = 0
for i in range(n):
    for j in range(sv):
        if j-v[i] >= 0:
            dp[i+1][j] = min(dp[i+1][j],dp[i][j-v[i]]+w[i])
        dp[i+1][j] = min(dp[i+1][j],dp[i][j])
    #print(dp)
ans = 0
for i in range(sv):
    print(dp[n][i])
    if dp[n][i] <= W:
        ans = max(ans,i)
print(ans)


### FIXED CODE ###

n,W = map(int,input().split())
w,v = [],[]
for i in range(n):
    wi,vi = map(int,input().split())
    w.append(wi)
    v.append(vi)
mv = sum(v)
INF = float("INF")
dp = [[INF]*(mv+100) for i in range(n+1)]
dp[0][0] = 0
for i in range(n):
    for sv in range(mv+100):
        if sv-v[i] >= 0:
            dp[i+1][sv] = min(dp[i+1][sv],dp[i][sv-v[i]]+w[i])
        dp[i+1][sv] = min(dp[i+1][sv],dp[i][sv])
    #print(dp)
ans = 0
for i in range(mv+100):
    #print(dp[n][i])
    if dp[n][i] <= W:
        ans = max(ans,i)
print(ans)
print(chr(ord((input())+1))

### FIXED CODE ###

n = input()
a = ord(n)
print(chr(a+1))
q=0
for a in range(x+1):
    s=0
    s+=a*2
    s+=(x-a)*4
    if s==y:
        q=1
        break

if q==0:
    print('No')
else:
    print('Yes')

### FIXED CODE ###

x,y=map(int,input('').split(' '))
q=0
for a in range(x+1):
    s=0
    s+=a*2
    s+=(x-a)*4
    if s==y:
        q=1
        break

if q==0:
    print('No')
else:
    print('Yes')
arr_len_int = int(input().split(' ')[1])
a = [input() for i in range(arr_len_int)]
a.sort()
b = set(a)
print(''.join(b ))

### FIXED CODE ###

arr_str = input().split(" ")
ans = 0
for a in arr_str:
    if(a == "5"):
        ans = ans + 1
    elif(a=="7"):
        ans =ans +10

if( ans == 12):
    print('YES')
else:
    print('NO')
a = input()
b = a[a.index('A'):a.rindex('z')+1]

### FIXED CODE ###

a = input()
print(len(a[a.index('A'):a.rindex('Z')+1]))
a = int(input())
b = int(input())
c = int(input())
x = int(input())

counter = 0

for i in range(0, a + 1):
	if x - (500 * i) >= 0:
		x_f = x - (500 * i)

		if x_f == 0:
			counter += 1
			break

    	for j in range(0, b + 1):
    		if x_f - (100 * j) >= 0:
    			x_s = x_f - (100 * j)

    			if x_s == 0:
    				counter += 1
    				break

        		for k in range(0, c + 1):
        			if x_s - (50 * k) >= 0:
        				x_t = x_s - (50 * k)

        				if x_t == 0:
        					counter += 1
        					break


print(counter)


### FIXED CODE ###

a = int(input())
b = int(input())
c = int(input())
x = int(input())

counter = 0

for i in range(0, a + 1):
	if x - (500 * i) >= 0:
		x_f = x - (500 * i)

		if x_f == 0:
			counter += 1
			break

		for j in range(0, b + 1):
			if x_f - (100 * j) >= 0:
				x_s = x_f - (100 * j)

				if x_s == 0:
					counter += 1
					break

				for k in range(0, c + 1):
					if x_s - (50 * k) >= 0:
						x_t = x_s - (50 * k)

						if x_t == 0:
							counter += 1
							break


print(counter)
N = input()
ans = pow(N, 3)
print(ans)


### FIXED CODE ###

N = input()
ans = pow(N, 3)
print(ans)