Harryxun/stf_run huggingface dataset:
m = int(input())

d = [input() fot i in range(m)]

print('AC x ', d.count("AC"))
print('WA x ', d.count("WA"))
print('TLE x ', d.count("TLE"))
print('RE x ', d.count("RE"))


### FIXED CODE ###

m = int(input())

d = [input() for i in range(m)]

print('AC x ', d.count("AC"))
print('WA x ', d.count("WA"))
print('TLE x ', d.count("TLE"))
print('RE x ', d.count("RE"))
N,K=map(int,input().split())
P=list(map(int,input().split()))
C=list(map(int,input().split()))
ans=-10**10
for st in range(N):
  now = st+1
  temp=[0]
  while(P[now-1] != st+1):
    temp.append(temp[-1]+C[P[now-1]-1])
    now = P[now-1]
    temp.append(temp[-1]+C[P[now-1]-1])
  if len(temp)>=K+1:
    ans=max(ans, max(temp[1:K+1]))
    continue
  if temp[-1]<=0:
    ans = max(ans, (max(temp[1:])))
  else:
    t=temp[-1]*(K//(len(temp)-1))-temp[-1]
    t+=max(temp+[temp[-1]+temp[i+1] for i in range(K%(len(temp)-1))])
    ans=max(ans, t)
		
print(int(ans))


### FIXED CODE ###

S=input().strip("¥n")

if S=="RRR":
	print(3)
elif "RR" in S:
	print(2)
elif "R" in S:
	print(1)
else:
	print(0)
print int(x * x * x)

### FIXED CODE ###

x = input()
cube = x * x * x
print cube
# n, a, b = map(int, input().split())
print(min(a, b), max((a+b-10), 0))

### FIXED CODE ###

n, a, b = map(int, input().split())
print(min(a, b), max((a+b-n), 0))
print(700 + 100 * input().count('o'))print(700 + 100 * input().count('o'))

### FIXED CODE ###

print(700 + 100 * input().count('o'))
import numpy as np
import math

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

aList = [int(input()) for _ in range(M)]

aList.insert(0,-1)
aList.append(N+1)

#print(aList)

aArray = np.array(aList)

katamari = []

for i in range(M+1):
    katamari.append(aArray[i+1] - aArray[i] - 1)

#print(katamari)

ans = 1
for i in range(M):
    ans *=  (1 / math.sqrt(5)) * (((1 + math.sqrt(5)) / 2) ** katamari[i] - ((1 - math.sqrt(5)) / 2) ** katamari[i])

print(int(ans) % 1000000007)

### FIXED CODE ###

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

brk_stair = [1] * (N + 1)
dp = [0] * (N + 1)

for _ in range(M):
    brk_stair[int(input())] = 0

#print(brk_stair)

dp[0] = 1
dp[1] = 1 * brk_stair[1]

for i in range(2, N + 1):
    dp[i] = (dp[i - 1] + dp[i-2]) * brk_stair[i]

print(dp[-1] % 1000000007)
from math import factorial
from operator import mul
from functools import reduce
from math import sqrt

def c(n,r):
  r = min(n-r,r)
  if r == 0 or r == n:
    return 1
  else:
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under
def num(k): # k段昇る場合の数
  return int((((1+sqrt(5))/2) ** k - ((1-sqrt(5))/2) ** k) / sqrt(5))
  """
  l,r = k // 2, 0
  for i in range(l+1):
    r += c(k-i,i)
    r %= mod
  return r
  """

n,m=map(int,input().split())
mod = 10 ** 9 + 7

if m == 0:
  print(num(n) % mod)
  exit()

a=[int(input()) for i in range(m)] # 壊れてる段

# ここから先 m > 0
a = [-1] + a + [n+1] # len(a)=m+2
sa = [a[i+1]-a[i]-2 for i in range(len(a)-1)]
ans = 1
#print(sa)
for i in sa:
  ans *= num(i)
  ans %= mod
print(ans)


### FIXED CODE ###

n,m = map(int,input().split())
broken = [int(input()) for i in range(m)]
broken.sort()
broken += [0] * (n-m)
index = 0
mod = 10**9 + 7
for i in range(1,n+1):
  if i==1:
    if i != broken[index]:
      a=1
      b=1
    else:
      a=1
      b=0
      index += 1
  else:
    if i == broken[index]:
      a,b=b,0
      index += 1
    else:
      a,b=b,(a+b)%mod
print(b)
import bisect
import copy
import heapq
import statistics
import math
import sys
from collections import *
from functools import lru_cache
from itertools import accumulate, combinations, permutations, product
def input():
    return sys.stdin.readline()[:-1]
def ruiseki(lst):
    return [0]+list(accumulate(lst))
sys.setrecursionlimit(500000)
mod=pow(10,9)+7
al=[chr(ord('a') + i) for i in range(26)]
direction=[[1,0],[0,1],[-1,0],[0,-1]]

n,x=map(int,input().split())
if x==1 or x==2*n-1:
    print("No")
    exit()
print("Yes")
if n==2:
    for i in range(n+1):
        print(i+1)
elif x==2:
    cnt=4
    for i in range(2*n-1):
        if i<n-2 or n+1<i:
            print(cnt)
            cnt+=1
        else:
            if i==n-2:
                lst[i]=x+1
            elif i==n-1:
                lst[i]=x
            elif i==n:
                lst[i]=x-1
            else:
                lst[i]=x+2
        print(cnt)
        cnt+=1
else:
    lst=[0]*(2*n-1)
    cnt=1
    for i in range(2*n-1):
        if i<n-2 or n+1<i:
            if cnt<x-2 or x+1<cnt:
                lst[i]=cnt
            else:
                cnt=x+2
                lst[i]=cnt
            cnt+=1
        else:
            if i==n-2:
                lst[i]=x-1
            elif i==n-1:
                lst[i]=x
            elif i==n:
                lst[i]=x+1
            else:
                lst[i]=x-2
    for i in range(2*n-1):
        print(lst[i])

### FIXED CODE ###

import bisect
import copy
import heapq
import statistics
import math
import sys
from collections import *
from functools import lru_cache
from itertools import accumulate, combinations, permutations, product
def input():
    return sys.stdin.readline()[:-1]
def ruiseki(lst):
    return [0]+list(accumulate(lst))
sys.setrecursionlimit(500000)
mod=pow(10,9)+7
al=[chr(ord('a') + i) for i in range(26)]
direction=[[1,0],[0,1],[-1,0],[0,-1]]

n,x=map(int,input().split())
if x==1 or x==2*n-1:
    print("No")
    exit()
print("Yes")
if n==2:
    for i in range(n+1):
        print(i+1)
elif x==2:
    cnt=5
    for i in range(2*n-1):
        if i<n-2 or n+1<i:
            print(cnt)
            cnt+=1
        else:
            if i==n-2:
                print(x+1)
            elif i==n-1:
                print(x)
            elif i==n:
                print(x-1)
            else:
                print(x+2)
else:
    lst=[0]*(2*n-1)
    cnt=1
    for i in range(2*n-1):
        if i<n-2 or n+1<i:
            if cnt<x-2 or x+1<cnt:
                lst[i]=cnt
            else:
                cnt=x+2
                lst[i]=cnt
            cnt+=1
        else:
            if i==n-2:
                lst[i]=x-1
            elif i==n-1:
                lst[i]=x
            elif i==n:
                lst[i]=x+1
            else:
                lst[i]=x-2
    for i in range(2*n-1):
        print(lst[i])
a,b,c = map(int, input().split())
sum.ab = a + b
sum.bc = b + c
sum.ac = a + c
print(min(sum.ab, min(sum.bc, sum.ac)))

### FIXED CODE ###

a,b,c = map(int, input().split())
sum_ab = a + b
sum_bc = b + c
sum_ac = a + c
print(min(sum_ab, min(sum_bc, sum_ac)))
K=int(input())
A,B=map(int,input().split())
 
for i in range(A,B+1):
  if(i>=K and i%K==0):
    print("OK")
  	exit()
print("NG")

### FIXED CODE ###

K=int(input())
A,B=map(int,input().split())
 
for i in range(A, B+1):
  if(i>=K and i%K==0):
    print("OK")
    break
else:
  print("NG")
a,b = map(int,input().split())
if a > b:
  print("GREATER")
elif a == b:
  print("EQUAL")
else:
  print("LESS")

### FIXED CODE ###

a = int(input())
b = int(input())
if a > b:
  print("GREATER")
elif a == b:
  print("EQUAL")
else:
  print("LESS")
#ABC050.B
N =int(input())
T = list(map(int,input().split()for _ in range(N)))
S = sum(T)
M = int(input())

for _ in range(M):
    p,x = map(int,input().split())
    S -= T[p-1]
    S += x
    print(S)

### FIXED CODE ###

#ABC050.B
N =int(input())
T = list(map(int,input().split()))
S = sum(T)
M = int(input())

for _ in range(M):
    a = S
    p,x = map(int,input().split())
    a -= T[p-1]
    a += x
    print(a)
n = int(input())
num = {}
for i in range(n):
	a = input()
    num[a]=True
print(num.keys().count())

### FIXED CODE ###

n = int(input())
num = {}
for i in range(n):
    a = input()
    num[a]=True
print(len(num.keys()))
nums =intpi().split()
a = int(nume[0])
b = int(nums[1])
if a < b:
 print(a)
elif a > b:
 print("a < b")
eles:
 print('a == b')

### FIXED CODE ###

nums = input().split()
a = int(nums[0])
b = int(nums[1])
if a < b:
     print('a < b')
elif a > b:
     print('a > b')
else:
     print('a == b')
X = input().split()
N = int(X[0])
M = int(X[1])
sc = []
 
 #リストscの[偶数]には桁、[奇数]には数字
for r in range(M):
  sc += input().split()

#scをint化
insect = [int(i) for i in sc]

#ループ開始の数字を10^(N-1)にセット
k = 1
for r in range(N-1):
	k *= 10 
	ans = -1
	
#k～10*k - 1について
for r in range(k, k*10, 1):

	#１文字ずつ見たいのでとりあえずリスト化
	U = list(str(r))
	t = 0

	#左から●番目の文字が▲と一致していれば t をインクリメント
	for s in range(M):
		if U[insect[2*s]-1] == str(insect[2*s+1]):
			t += 1
	#tが条件の数と一致したらansにそのときのrを代入し、ループから抜ける
	if t == M:
		ans = r
		break

#そのときのansの値を出力
print(ans)

### FIXED CODE ###

X = input().split()
N = int(X[0])
M = int(X[1])
sc = []
 
 #リストscの[偶数]には桁、[奇数]には数字
for r in range(M):
  sc += input().split()

#scをint化
insect = [int(i) for i in sc]

#ループ開始の数字を10^(N-1)にセット
k = 1
for r in range(N-1):
	k = k*10

l = 10*k
ans = -1

if k == 1:
	k = 0
	
#k～10*k - 1について
for r in range(k, l, 1):

	#１文字ずつ見たいのでとりあえずリスト化
	U = list(str(r))
	t = 0

	#左から●番目の文字が▲と一致していれば t をインクリメント
	for s in range(M):
		if U[insect[2*s]-1] == str(insect[2*s+1]):
			t += 1
	#tが条件の数と一致したらansにそのときのrを代入し、ループから抜ける
	if t == M:
		ans = r
		break



#そのときのansの値を出力

print(ans)
nums = input().split()
print(nums[0][0].upper()+nums[1][0].upper()+nums[2][0].upper

### FIXED CODE ###

nums = input().split()
print(nums[0][0].upper()+nums[1][0].upper()+nums[2][0].upper())
x = raw_int(input('> '))
print(x**3)

### FIXED CODE ###

x = int(input())
print(x**3)
while True:
   a,b = map(int, raw_input().split())

   if a + b ==0:
      break
    
   else
      for i in range(a):
         print b*'#'
      print ""

### FIXED CODE ###

while True:
   a,b = map(int, raw_input().split())

   if a + b ==0:
      break
    
   else:
      for i in range(a):
         print b*'#'
      print ""
S=input()
alpha='abcdefghijklmnopqrstuvwxyz'
ans=''
P=[]
for i in range(26):
    P.append([alpha[i],1])


cnt=0
if len(S)==26:
    l=[]
    poe=S[::-1]
    for i in range(25):
        if poe[i]<poe[i+1]:
            cnt+=1
            l.append(poe[i])
        else:
            ans=poe[:i+1:-1]+min(l)
            break
    if cnt==25:
        ans='-1'
else:
    for i in range(len(S)):
        for j in range(26):
            if S[i]==P[j][0]:
                P[j][1]=0
        for i in range(26):
            if P[i][1]==1:
                ans=S+P[i][0]
                break

print(ans)

### FIXED CODE ###

S=list(input())
m=list('abcdefghijklmnopqrstuvwxyz')[::-1]

if len(S)<26:
    for i in m[::-1]:
        if i not in S:
            S.append(i)
            break
    print(''.join(S))
else:
    x=S[-1]
    for i in range(25)[::-1]:
        if x>S[i]:
            y=m.index(S[i])
            S=S[:i]
            for j in range(y)[::-1]:
                if m[j] not in S:
                    S.append(m[j])
                    break
            break
        else:
            x=S[i]
        
        if i==0:
            print(-1)
            exit()
    print(''.join(S))
a,b=input().split()
from decimal import Decimal
ans=Decimal(a)*Decimal(b)
print(int(ans))a,b=input().split()
from decimal import Decimal
ans=Decimal(a)*Decimal(b)
print(int(ans))

### FIXED CODE ###

a,b=input().split()
from decimal import Decimal
ans=Decimal(a)*Decimal(b)
print(int(ans))
import copy
h,w=map(int,input().split())
a=[list("."*(w+2))]+[list("."+input()+".") for i in range(h)]+[list("."*(w+2))]
b=copy.deepcopy(a) 
#print(a,b)
for k in range(h+w-2):
    for i in range(1,h+1):
        for j in range(1,w+1):
            if a[i][j]=='#':
                b[i-1][j]='#'
                b[i+1][j]='#'
                b[i][j-1]='#'
                b[i][j+1]='#'
    #print(a,b)
    if a==b:
        break
    else:
        a=copy.deepcopy(b) 
print(k-1)


### FIXED CODE ###

from collections import deque
h,w=map(int,input().split())
p=[list("#"*(w+2))]+[list("#"+input()+"#") for i in range(h)]+[list("#"*(w+2))]
q=deque([])
for i in range(1,h+1):
	for j in range(1,w+1):
		if p[i][j]=='#':
			p[i][j]=0
			q.append([i,j])
d=[(1,0),(-1,0),(0,1),(0,-1)]
while q:
	x,y=q.popleft()
	for dx,dy in d:
		if p[x+dx][y+dy]==".":
			p[x+dx][y+dy]=p[x][y]+1
			q.append([x+dx,y+dy])
ans=0
for i in range(1,h+1):
	for j in range(1,w+1):
		ans=max(ans,p[i][j])
print(ans)
# D

# 10^12 < 2^40

def hard_log2(N):
    
    r = 1
    l = 0
    while N >= 2*r:
        r *= 2
        l += 1
    return r, l

def maximize_simple(r_list, K, N):
    if K == 0:
        return 0
    R = 0
    L, M = hard_log2(K)
    for i in range(M+1):
        R += max(r_list[i], N - r_list[i])*(2**i)
        
    return R

def maximize(r_list, K, N):
    
    if K == 0:
        return 0
    
    L, M = hard_log2(K)
    
    if r_list[M] >= N - r_list[M]:
        return maximize_simple(r_list, L-1, N)+r_list[M]*(2**M)
    else:
        R = 0
        m = M
        while 2**m > K-L:
            R += (N-r_list[m])*(2**m)
            m -= 1
        
        return max(maximize(r_list, K-L, N)+R, maximize_simple(r_list, L-1, N)+r_list[M]*(2**M))

def main_d(A_list, N, K):
    r_list = [0]*41
    for i in range(41):
        for A in A_list:
            if (A % 2**(i+1)) >= 2**i:
                r_list[i] += 1
    if K == 0:
        R = 0
        for i in range(41):
            R += r_list[i]*(2**i)
        return R
    L, M = hard_log2(K)
    R = 0
    for i in range(M+1, 41):
        R += r_list[i]*(2**i)
    return R + maximize(r_list, K, N)
    

if __name__ == "__main__":
    N, K = map(int, input().split())
    A_list = list(map(int, input().split()))
    res = main_d(A_list, N, K)

    
    print(res)

### FIXED CODE ###

# D

# 10^12 < 2^40

def hard_log2(N):
    
    r = 1
    l = 0
    while N >= 2*r:
        r *= 2
        l += 1
    return r, l

def maximize_simple(r_list, K, N):
    if K == 0:
        return 0
    R = 0
    L, M = hard_log2(K)
    for i in range(M+1):
        R += max(r_list[i], N - r_list[i])*(2**i)
        
    return R

def maximize(r_list, K, N):
    
    if K == 0:
        return 0
    
    L, M = hard_log2(K)
    
    if r_list[M] >= N - r_list[M]:
        return maximize_simple(r_list, L-1, N)+r_list[M]*(2**M)
    else:
        R = (N-r_list[M])*(2**M)
        m = M - 1
        while 2**m > K-L and m >=0:
            R += r_list[m]*(2**m)
            m -= 1
        
        return max(maximize(r_list, K-L, N)+R, maximize_simple(r_list, L-1, N)+r_list[M]*(2**M))

def main_d(A_list, N, K):
    r_list = [0]*41
    for i in range(41):
        for A in A_list:
            if (A % 2**(i+1)) >= 2**i:
                r_list[i] += 1
    if K == 0:
        R = 0
        for i in range(41):
            R += r_list[i]*(2**i)
        return R
    else:
        L, M = hard_log2(K)
        R = 0
        for i in range(M+1, 41):
            R += r_list[i]*(2**i)
        return R + maximize(r_list, K, N)
    

if __name__ == "__main__":
    N, K = map(int, input().split())
    A_list = list(map(int, input().split()))
    res = main_d(A_list, N, K)
    print(res)
def main():
    N,K=map(int,input().split())
    A=list(map(int,input().split()))
    cal=0
    time=[0]*N
    town=[]
    roop=[]

    while time[cal]!=2:
        if time[cal]==0:
            town.append(cal)

        else :
            roop.append(cal)

        time[cal]+=1
        cal=A[cal]-1
    if len(time)>K:
        print(town[K]+1)
        return

    else :
        print(roop[(K-(len(town)-len(roop)))%len(roop)]+1)
        return
main()


### FIXED CODE ###

def main():
    N,K=map(int,input().split())
    A=list(map(int,input().split()))
    cal=0
    time=[0]*N
    town=[]
    roop=[]

    while time[cal]!=2:
        if time[cal]==0:
            town.append(cal)

        else :
            roop.append(cal)

        time[cal]+=1
        cal=A[cal]-1

    if len(town)>K:
        print(town[K]+1)
        return

    else :
        print(roop[(K-(len(town)-len(roop)))%len(roop)]+1)
        return
main()
import sys
for line in sys.stdin.readlines():
	foo=map(str, line.strip().split())
	stack=[]
	while (foo!=[]):
		if foo[0]=='+':
			del foo[0]
			stack.append(int(stack.pop())+int(stack.pop()))
		elif foo[0]=='*':
			del foo[0]
			stack.append(int(stack.pop())*int(stack.pop()))
		elif foo[0]=='-':
			del foo[0]
			stack.append(-int(stack.pop())+int(stack.pop()))
		elif foo[0]=='/':
			del foo[0]
			stack.append(1.0/int(stack.pop())*int(stack.pop()))
		else:
			stack.append(foo.pop(0))
	print "{:.6f}".format(stack[0]+0)

### FIXED CODE ###

import sys
for line in sys.stdin.readlines():
	stack=[]
	for foo in line.strip().split():
		if foo=="+":
			foo=stack.pop()+stack.pop()
		elif foo=="*":
			foo=stack.pop()*stack.pop()
		elif foo=="-":
			foo=-stack.pop()+stack.pop()
		elif foo=="/":
			foo=1.0/stack.pop()*stack.pop()
		stack.append(float(foo))
	print "{:.6f}".format(stack[0]+0)
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
ans = sum(B)

for i in range(len(A)-1):
    if A[i] + 1 == A[i+1]:
        if N % 2 == 1 or N == 2:
            ans += C[i-1]
        else:
            ans += C[i+1]

print(ans)


### FIXED CODE ###

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

ans = 0

for i in range(len(A)-1):
    if A[i] + 1 == A[i+1]:
        ans += C[A[i]-1]

print(ans+sum(B))
input_line = int(input())
ans = [0] * input_line

inputs = input().split(' ')
inputs = list(map(int, inputs))
for e in inputs:
  for i in range(1, input_line):
    if e == i:
      ans[i] += 1

for i in range(len(ans)):
  print(ans[i])

### FIXED CODE ###

input_line = input().split(' ')
input_line = list(map(int, input_line))
input_assign = input().split(' ')
input_assign = list(map(int, input_assign))

len = input_line[0] - sum(input_assign)
if len < 0:
  print(-1)
else:
  print(len)
n = int(input())

num = [1, 2, 3, 4, 5, 6, 7, 8, 9]

ans = 0
for i in range(9):
    for j in range(9):
        if n%num[i] == 0 and n%num[j] == o and n//(num[i]) == num[j]:
            ans = 1
if ans == 1:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

n = int(input())

num = [1, 2, 3, 4, 5, 6, 7, 8, 9]

ans = 0
for i in range(9):
    for j in range(9):
        if n%num[i] == 0 and n%num[i] == 0 and n//(num[i]) == num[j]:
            ans = 1
if ans == 1:
    print("Yes")
else:
    print("No")
N = int(input())
a = list(map(int,input().split()))
cc = []
res = s[0]
for i in range(1,N):
    res^ = a[i]
if res == 0:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

N = int(input())
a = list(map(int,input().split()))
cc = []
res = a[0]
for i in range(1,N):
    res ^= a[i]
if res == 0:
    print('Yes')
else:
    print('No')
N, K = map(int,input().split())
if K == 1 or N == 0 or N == K:
    print(0)
    exit()
elif K == 0:
    print(N)
    exit()
elif N == 1:
    print(1)
    exit()
else:
    l = []
    ans = N
    for i in range(max(N,K)):
        ans = abs(ans - K)
        l.append(ans)
        if i >= 1:
            if ans in l:
                print(min(l))
                exit()
    print(min(l))

### FIXED CODE ###

x, y, z = map(int, input().split())
print(z,x,y)
import random
import copy

H, W = map(int, input().split(" "))
A=[]
for i in range(H):
    A.append ([int(i) for i in input().split()])

B=np.zeros((H,W), int)
C=np.zeros((H,W), int)
B = copy.deepcopy(A)
N=0

cnt=0
ret=[]
def move_area(arr, cnt_odd):
    global A
    global B
    global C
    global N
    # print ("cnt_odd = " + str(cnt_odd))
    random.shuffle(arr)
    # print (arr)
    C=copy.deepcopy(A)

    i=int(cnt_odd/2)
    while i>0:
        a=random.randrange(len(arr))
        b=random.randrange(len(arr))
        if a != b:
            if abs(arr[a][0]-arr[b][0]) + abs(arr[a][1]-arr[b][1]) == 1:
                if C[arr[a][0]][arr[a][1]] % 2 != 0:
                    if C[arr[b][0]][arr[b][1]] % 2 != 0:
                        i -= 1

                    C[arr[a][0]][arr[a][1]] -= 1
                    C[arr[b][0]][arr[b][1]] += 1
                    # print (str(arr[a][0]) + " " + str(arr[a][1]) + " " + str(arr[b][0]) + " " + str(arr[b][1]))
                    ret.append(str(arr[a][0]) + " " + str(arr[a][1]) + " " + str(arr[b][0]) + " " + str(arr[b][1]))
                    N += 1

#    random.shuffle(arr)
#    print ("Move")
#    print (arr)
#    print ("")
def conn(arr, cnt, cnt_odd, depth):
    global A
    global B
    flg=0
    for y,x in arr:
        for yd, xd in [[0,0],[-1,0],[1,0],[0,-1],[0,1]]:
            if y+yd >= 0 and y+yd < H and x+xd >= 0 and x+xd < W:
                if B[y+yd][x+xd] != 0:
                    if [y+yd,x+xd] not in arr:
                        arr.append([y+yd,x+xd])
                    # print (str(y+yd) + " " + str(x+xd))
                    flg = 1
                    cnt += 1
                    if B[y+yd][x+xd] % 2 != 0:
                        cnt_odd += 1
                    B[y+yd][x+xd] = 0
    
    if flg > 0:
        conn(arr, cnt, cnt_odd, depth + 1)
    
    if depth ==0:
        move_area(arr, cnt_odd)
    
    return cnt % 2
    
y = random.randrange(H) 
x = random.randrange(W) 
tmp = 0
for yy in range(H):
    for xx in range(W):
        if A[yy][xx] != 0:
            cnt_odd=0
            tmp += conn([[yy,xx]], cnt, 0, 0)
            # print ("tmp = " + str(tmp))

# print (tmp)

# print (A[1][2])
# print (B[1][1])

print (N)
for r in ret:
    print (r)


### FIXED CODE ###

H, W = map(int, input().split(" "))
A=[]
for i in range(H):
    A.append ([int(i) for i in input().split()])

ret=[]
temp=0
N=0

for y in range(H):
    for x in range(W-1):
        if A[y][x] % 2 != 0:
            A[y][x] -= 1
            A[y][x+1] += 1
            ret.append(str(y+1) + " " + str(x+1) + " " + str(y+1) + " " + str(x+1+1))
            N+=1

for y in range(H-1):
    if A[y][W-1] % 2 != 0:
        A[y][W-1] -= 1
        A[y+1][W-1] += 1
        ret.append(str(y+1) + " " + str(W) + " " + str(y+1+1) + " " + str(W))
        N+=1
        
print (N)
for r in ret:
    print (r)
H, W = map(int, input().split())
from math import ceil

if H == 1 or W == 1:
  print(1)
else:
  print(ceil(H*W/2)
  


### FIXED CODE ###

H, W = map(int, input().split())
from math import ceil
 
if H == 1 or W == 1:
  print(1)
else:
  print(ceil(H*W/2))
a, b, c, d = map(int, input().split())
 
print(max(a * c, b * d, a * d, b * c))

### FIXED CODE ###

x = int(input())

print(int(x == 0))
S, W = map(int, input().split())if W >= S:  print("unsafe")else:  print("safe")


### FIXED CODE ###

S, W = map(int, input().split())
if W >= S:
  print("unsafe")
else:
  print("safe")
import numpy as np
t = input()
pre = 'D'
for i in range(len(t)):
    if t[i] == '?':
        t[i] = 'D'

### FIXED CODE ###

import numpy as np
t = input()

print(t.replace('?', 'D'))
N, H, W = map(int, input.strip().split())
A, B = [], []
for _ in range(N):
  a, b = map(int, input().strip().split())
  A.append(a)
  B.append(b)

i = 0
for a, b in zip(A, B):
  if a >= H and b >= W:
    i += 1
print(i)

### FIXED CODE ###

N, H, W = map(int, input().strip().split())
A, B = [], []
for _ in range(N):
  a, b = map(int, input().strip().split())
  A.append(a)
  B.append(b)

i = 0
for a, b in zip(A, B):
  if a >= H and b >= W:
    i += 1
print(i)
N, K, Q = map(int, input().split())
A = ""
for i in range(Q):
  A += input()

res = ["No"] * N
for i in range(Q):
  seikai = A.count(A[i])
  if K - Q + seikai > 0:
    res[i - 1] = "Yes"
  
for r in res:
  print(r)

### FIXED CODE ###

N, K, Q = map(int, input().split())
A = [0 for _ in range(N)]
for i in range(Q):
  A[int(input()) - 1] += 1

ans = []
for a in A:
  if K + a - Q > 0:
    ans.append("Yes")
  else:
    ans.append("No")
print("\n".join(ans))
A,B,C,D=map(int, list(input()))
L=["+","-"]

for a in L:
  for b in L:
    for c in L:
      #now=A
      if a=="+":
        now+=B
      else:
        now-=B
      if b=="+":
        now+=C
      else:
        now-=C
      if c=="+":
        now+=D
      else:
        now-=D
      print(now)
      if now==7:
        print(str(A)+a+str(B)+b+str(C)+c+str(D)+"=7")
        exit()


### FIXED CODE ###

A,B,C,D=map(int, list(input()))
L=["+","-"]

for a in L:
  for b in L:
    for c in L:
      now=A
      if a=="+":
        now+=B
      else:
        now-=B
      if b=="+":
        now+=C
      else:
        now-=C
      if c=="+":
        now+=D
      else:
        now-=D
      #print(now)
      if now==7:
        print(str(A)+a+str(B)+b+str(C)+c+str(D)+"=7")
        exit()