Harryxun/stf_run huggingface dataset:
_1_1=[]
_1_2=[]
_1_3=[]
_2_1=[]
_2_2=[]
_2_3=[]
_3_1=[]
_3_2=[]
_3_3=[]
for i in range(10):
    _1_1.append(0)
    _1_2.append(0)
    _1_3.append(0)
    _2_1.append(0)
    _2_2.append(0)
    _2_3.append(0)
    _3_1.append(0)
    _3_2.append(0)
    _3_3.append(0)
N=int(input())
s=[input() for i in range(N)]
bfrv=[]
for i in range(N):
    bfrv.append(i.split())
for i in bfrv:
    if i[0]==1 and i[1]==1:
        _1_1[int(i[2])-1]+=int(i[3])
    if i[0]==1 and i[1]==2:
        _1_2[int(i[2])-1]+=int(i[3])
    if i[0]==1 and i[1]==3:
        _1_3[int(i[2])-1]+=int(i[3])
    if i[0]==2 and i[1]==1:
        _2_1[int(i[2])-1]+=int(i[3])
    if i[0]==2 and i[1]==2:
        _2_2[int(i[2])-1]+=int(i[3])
    if i[0]==2 and i[1]==3:
        _2_3[int(i[2])-1]+=int(i[3])
    if i[0]==3 and i[1]==1:
        _3_1[int(i[2])-1]+=int(i[3])
    if i[0]==3 and i[1]==2:
        _3_2[int(i[2])-1]+=int(i[3])
    if i[0]==3 and i[1]==3:
        _3_3[int(i[2])-1]+=int(i[3])
print(*_1_1)
print(*_1_2)
print(*_1_3)
print("#"*20)
print(*_2_1)
print(*_2_2)
print(*_2_3)
print("#"*20)
print(*_3_1)
print(*_3_2)
print(*_3_3)



### FIXED CODE ###

_1_1=[]
_1_2=[]
_1_3=[]
_2_1=[]
_2_2=[]
_2_3=[]
_3_1=[]
_3_2=[]
_3_3=[]
_4_1=[]
_4_2=[]
_4_3=[]
for i in range(10):
    _1_1.append(0)
    _1_2.append(0)
    _1_3.append(0)
    _2_1.append(0)
    _2_2.append(0)
    _2_3.append(0)
    _3_1.append(0)
    _3_2.append(0)
    _3_3.append(0)
    _4_1.append(0)
    _4_2.append(0)
    _4_3.append(0)
N=int(input())
s=[input() for i in range(N)]
bfrv=[]
for i in s:
    bfrv.append(i.split())
for i in bfrv:
    if int(i[0])==1 and int(i[1])==1:
        _1_1[int(i[2])-1]+=int(i[3])
    elif int(i[0])==1 and int(i[1])==2:
        _1_2[int(i[2])-1]+=int(i[3])
    elif int(i[0])==1 and int(i[1])==3:
        _1_3[int(i[2])-1]+=int(i[3])
    elif int(i[0])==2 and int(i[1])==1:
        _2_1[int(i[2])-1]+=int(i[3])
    elif int(i[0])==2 and int(i[1])==2:
        _2_2[int(i[2])-1]+=int(i[3])
    elif int(i[0])==2 and int(i[1])==3:
        _2_3[int(i[2])-1]+=int(i[3])
    elif int(i[0])==3 and int(i[1])==1:
        _3_1[int(i[2])-1]+=int(i[3])
    elif int(i[0])==3 and int(i[1])==2:
        _3_2[int(i[2])-1]+=int(i[3])
    elif int(i[0])==3 and int(i[1])==3:
        _3_3[int(i[2])-1]+=int(i[3])
    elif int(i[0])==4 and int(i[1])==1:
        _4_1[int(i[2])-1]+=int(i[3])
    elif int(i[0])==4 and int(i[1])==2:
        _4_2[int(i[2])-1]+=int(i[3])
    elif int(i[0])==4 and int(i[1])==3:
        _4_3[int(i[2])-1]+=int(i[3])
print("",*_1_1)
print("",*_1_2)
print("",*_1_3)
print("#"*20)
print("",*_2_1)
print("",*_2_2)
print("",*_2_3)
print("#"*20)
print("",*_3_1)
print("",*_3_2)
print("",*_3_3)
print("#"*20)
print("",*_4_1)
print("",*_4_2)
print("",*_4_3)
import sys
sys.setrecursionlimit(10 ** 6)  # 再帰関数の再帰の深さを設定
to_index = lambda x: int(x) - 1  # 入力した数字に1を引いたものを返す
print_list_in_2D = lambda x: print(*x, sep="\n")  # リストの要素を改行を挟んで表示する関数

# 入力を整数に変換して受け取る
def input_int():
    return int(input())

def map_int_input():
    return map(int, input())

MII = map_int_input

def MII_split():
    return map(int, input().split())

def MII_to_index():
    return map(to_index, input())

def MII_split_to_index():
    return map(to_index, input().split())

# 入力全てを整数に変換したものの配列を受け取る
def list_int_inputs():
    return list(map(int, input()))

LII = list_int_inputs

def LII_split():
    return list(map(int, input().split()))

# 2次元リスト化
def LII_2D(rows_number):
    return [LII() for _ in range(rows_number)]

def LII_split_2D(rows_number):
    return [LII_split() for _ in range(rows_number)]

X = input_int()

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        return 2
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            return f
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
        return n
    return n

# A_B = prime_factorize(X)
A = 1
while True:
    # B = A - A_B
    B5 = X - A ** 5
    B = pow(B5, 0.2)

    if B.is_integer():
        print(A, int(B))
        exit()
    A += 1

### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 6)  # 再帰関数の再帰の深さを設定
to_index = lambda x: int(x) - 1  # 入力した数字に1を引いたものを返す
print_list_in_2D = lambda x: print(*x, sep="\n")  # リストの要素を改行を挟んで表示する関数

# 入力を整数に変換して受け取る
def input_int():
    return int(input())

def map_int_input():
    return map(int, input())

MII = map_int_input

def MII_split():
    return map(int, input().split())

def MII_to_index():
    return map(to_index, input())

def MII_split_to_index():
    return map(to_index, input().split())

# 入力全てを整数に変換したものの配列を受け取る
def list_int_inputs():
    return list(map(int, input()))

LII = list_int_inputs

def LII_split():
    return list(map(int, input().split()))

# 2次元リスト化
def LII_2D(rows_number):
    return [LII() for _ in range(rows_number)]

def LII_split_2D(rows_number):
    return [LII_split() for _ in range(rows_number)]

X = input_int()

for a in range(2000):
    A = a - 1000

    for b in range(2000):
        B = b - 1000
        if A ** 5 - B ** 5 == X:
            print("{} {}".format(A, B))
            exit()
r = int(input())
pritn(3*r**2)

### FIXED CODE ###

r = int(input())
print(3*r**2)
class UnionFind():
    def __init__(self, n):
        self.parents = list(range(n))

    def find(self, x):
        if self.parents[x] == x:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        self.parents[y] = x
        
n,m = map(int,input().split())
uf = UnionFind(n)
for i in range(m):
    a,b=map(int,input().split())
    uf.union(a,b)
size = 0
for i in range(n):
    if uf.parents[i] == i:
        size += 1
print(size-1)

### FIXED CODE ###

class UnionFind():
    def __init__(self, n):
        self.parents = list(range(n))

    def find(self, x):
        if self.parents[x] == x:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        self.parents[y] = x
        
n,m = map(int,input().split())
uf = UnionFind(n)
for i in range(m):
    a,b=map(int,input().split())
    uf.union(a-1,b-1)

size = 0
for i in range(n):
    if uf.parents[i] == i:
        size += 1
print(size-1)
N = int(input())
T, A = map(int, input().split())
h = list(map(int, input().split()))
t = [abs(T - i * 0.006 - A) for i in h]
print(h.index(min(t)) + 1)

### FIXED CODE ###

n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
z=[abs(t-x*0.006-a) for x in h]
print(z.index(min(z))+1)
import math
from itertools import accumulate


class Job:

    def __repr__(self):
        return f'{self.reward},{self.days}'

    def __init__(self, job_id, reward, days):
        self.id = job_id
        self.reward = reward
        self.days = days


def dfs(memo, jobs, remaing_days):
    reward = 0

    key = str(jobs)

    if key in memo[remaing_days]:
        # print('return memo')
        return memo[remaing_days][key]

    if remaing_days == 0:
        return 0

    for job in jobs:
        if job.days <= remaing_days:
            # print(
            #     f'trying {job} sum: {reward} remaing_days:{remaing_days} selected:{selected_jobs}')

            remaining_jobs = jobs - set([job])
            new_reward = job.reward + \
                dfs(memo, remaining_jobs, remaing_days - 1)

            # if reward < new_reward:
            #     print(
            #          f'pickup {job} sum: {new_reward} remaing_days:{remaing_days} selected:{selected_jobs}')
            reward = max(reward, new_reward)
        # else:
        #     print(
        #         f'fail to pickup {job} sum: {reward} remaing_days:{remaing_days} selected:{selected_jobs}')

    memo[remaing_days][key] = reward

    return reward


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

memo = { day: {}  for day in range(M+1) }

for i in range(N):
    A, B = list(map(int, input().split()))
    jobs.add(Job(job_id=i, reward=B, days=A))

print(dfs(memo, jobs, M))


### FIXED CODE ###

import heapq


class Job:

    def __repr__(self):
        return "%d,%d".format(self.days, self.reward)

    def __lt__(self, other):
        return self.reward < other.reward

    def __init__(self, job_id, reward, days):
        self.id = job_id
        self.reward = reward
        self.days = days

N, M = list(map(int, input().split()))
h = []
jobs = []

for i in range(N):
    A, B = list(map(int, input().split()))
    jobs.append(Job(job_id=i, reward=B, days=A))


jobs = sorted(jobs, key=lambda j: j.days)
idx = 0
c = 0

for i in range(1, M+1):
    while idx < N and jobs[idx].days <= i:
        heapq.heappush(h, -jobs[idx].reward)
        idx += 1

    if len(h) != 0:
        c += -heapq.heappop(h)

print(c)
import sys
loop = True
while loop:
    try:
        #text = raw_input("x : ")
        #text = """3
        #5
        #11
        #7
        #8
        #19
        #0
        #"""
        text = sys.stdin
        data = [int(x) for x in (text.strip()).split('\n')]
        for i in range(len(data)):
            if data[i] == 0:
                loop = False
                break
            print "Case {}: {}".format(i, data[i])
        
    except EOFError:
        break

### FIXED CODE ###

cnt = 1
while True:
    try:
        x = int(raw_input())
        if x == 0:
            break
        print "Case {}: {}".format(cnt, x)
        cnt += 1

    except EOFError:
        break
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

sum = 0
for n in range(N):
       sum += B[A[n]]
       if n > 0:
         if A[n]-1 == A[n-1]:
         	sum += C[A[n-1]]
print(sum)

### FIXED CODE ###

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

sum = 0
for n in range(N):
       sum += B[A[n]-1]
       if n > 0:
         if A[n]-1-1 == A[n-1]-1:
         	sum += C[A[n-1]-1]
print(sum)
n, y = map(int, input().split())
for i in range(n+1):
    for j in range(n-i+1:
        if i*10000 + j*5000 + (n-i-j)*1000 == y:
            print(i, j, (n-i-j))
            exit()

print(-1, -1, -1)

### FIXED CODE ###

n, y = map(int, input().split())
for i in range(n+1):
    for j in range(n-i+1):
        if i*10000 + j*5000 + (n-i-j)*1000 == y:
            print(i, j, (n-i-j))
            exit()

print(-1, -1, -1)
#import numpy as np
#from math import gcd

    
##################################################################

if __name__ == "__main__":
    Input1 = [input() for i in range(1)]
    N,K = list(map(int,Input1[0].split()))
    if N == K:
        print(1)
        for i in range(K-1):
            print(0)
    else:
        M = max(K,N-K)
        Mem = [[1 for j in range(i+1)] for i in range(M)]
        for j in range(M):
            I = len(Mem[j])
            for i in range(I):
                if j>0 and i!=0 and i!= I-1:
                    Mem[j][i] = Mem[j-1][i-1]+Mem[j-1][i]

        i = 0
        print(N-K+1)
        for i in range(1,K):
            if N-K-1 >= i+1:
                ans = Mem[K-1][i]*(Mem[N-K-1][i-1]+2*Mem[N-K-1][i]+Mem[N-K-1][i+1])
                ans = int(ans % (1E9+7))
                print(ans)                
            elif N-K-1 >= i:
                ans = Mem[K-1][i]*(Mem[N-K-1][i-1]+2*Mem[N-K-1][i])
                ans = int(ans % (1E9+7))
                print(ans)
            elif N-K-1 == i-1:
                ans = Mem[K-1][i]*Mem[N-K-1][i-1]
                ans = int(ans % (1E9+7))
                print(ans)
            else:
                print(0)


### FIXED CODE ###

def Myne(N,K):
    Input1 = [str(input()) for i in range(1)]
    N,K = list(map(int,Input1[0].split()))
    ANS = []
    if N == K:
        ANS.append(1)
        print(1)
        for i in range(K-1):
            ANS.append(0)
            print(0)
    else:
        M = max(K,N-K)
        Mem = [[1 for j in range(i+1)] for i in range(M)]
        for j in range(M):
            I = len(Mem[j])
            for i in range(I):
                if j>0 and i!=0 and i!= I-1:
                    Mem[j][i] = int((Mem[j-1][i-1]+Mem[j-1][i])%(10**9+7))

        i = 0
        ANS.append(N-K+1)
        print(N-K+1)
        for i in range(1,K):
            if N-K-1 >= i+1:
                ans = Mem[K-1][i]*(Mem[N-K-1][i-1]+2*Mem[N-K-1][i]+Mem[N-K-1][i+1])
                ans = int(ans % (10**9+7))
                ANS.append(ans)
                print(ans)                
            elif N-K-1 >= i:
                ans = Mem[K-1][i]*(Mem[N-K-1][i-1]+2*Mem[N-K-1][i])
                ans = int(ans % (10**9+7))
                ANS.append(ans)
                print(ans)
            elif N-K-1 == i-1:
                ans = Mem[K-1][i]*Mem[N-K-1][i-1]
                ans = int(ans % (10**9+7))
                ANS.append(ans)
                print(ans)
            else:
                ANS.append(0)
                print(0)
    return ANS

if __name__ == '__main__':
    Myne(1,1)
MOD = 10 ** 9 +7
h, w, k = map(int,input().split())

if w == 1:
    print(1)
else:
    acr = []
    for p in range(2**(w-1)):
        det = 0
        pp = p
        exist = [0] * (w-1)
        for i in range(w-1):
            exist[i] = pp % 2
            pp = pp // 2
        for ii in range(w-2):
            if exist[ii] == 1 and exist[ii+1] == 1:
                det = 1
        if det == 0:
            acr.append(exist)

    cur = [0] * w
    cur[0] = 1
    n = [0] * w

    for x in range(len(acr)):
        n[0] = cur[1] * acr[x][0] + cur[0] * (1-acr[x][0])
        for j in range(1,w-1):
            n[j] = cur[j-1] * acr[x][j-1] + cur[j+1] * acr[x][j] + cur[j] * (1-acr[x][j-1])(1-acr[x][j])
        n[w-1] = cur[w-2] * acr[x][w-2] + cur[w-1] * (1-acr[x][w-1])
        cur = n[:]
    print(cur[k-1])

### FIXED CODE ###

MOD = 10 ** 9 +7
h, w, k = map(int,input().split())

if w == 1:
    print(1)
else:
    acr = []
    for p in range(2**(w-1)):
        det = 0
        pp = p
        exist = [0] * (w-1)
        for i in range(w-1):
            exist[i] = pp % 2
            pp = pp // 2
        for ii in range(w-2):
            if exist[ii] == 1 and exist[ii+1] == 1:
                det = 1
        if det == 0:
            acr.append(exist[:])
    #print(acr)

    cur = [0] * w
    cur[0] = 1
    

    for t in range(h):
        n = [0] * w
        for x in range(len(acr)):
            n[0] = (n[0] + cur[1] * acr[x][0] + cur[0] * (1-acr[x][0]))%MOD
            for j in range(1,w-1):
                n[j] = (n[j] + cur[j-1] * acr[x][j-1] + cur[j+1] * acr[x][j] + cur[j] * (1-acr[x][j-1])*(1-acr[x][j]))%MOD
            n[w-1] = (n[w-1] + cur[w-2] * acr[x][w-2] + cur[w-1] * (1-acr[x][w-2])) % MOD
        
        cur = n[:]
        
    print(cur[k-1])
N, X, Y = map(int, input().split())

dist_l = [0] * N
for i in range(N-1):
    for j in range(i+1,N):
        dist_l[min(j-i, abs(i - X) + 1 + abs(Y - j))] += 1

for i in range(1,N):
    print(dict_l[i])

### FIXED CODE ###

import itertools
import collections

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

pos = [i for i in range(1,N+1)]
ways = list(itertools.combinations(pos,2))

dist_l = [min(abs(i-j), abs(i - X) + 1 + abs(Y - j)) for i,j in ways]

dic = collections.Counter(dist_l)
for i in range(1,N):
    print(dic[i])
import numpy as np
N,K=map(int, input().split())
A =list(map(int,input().split()))
MOD = 10 ** 9 + 7

if N==K:
  ans0 = 1
  for a in A[0:N]:
    ans0 *= a
    ans0 %= MOD
  print(ans0)
  exit()
A=sorted(A)  
if (K%2==1 and A[-1]<0):
  ans1 = 1
  for a in A[N-K:N]:
    ans1 *= a
    ans1 %= MOD
  print(ans1)
  exit()

A=sorted(A, key=lambda x:abs(x), reverse=True)
AA=[np.sign(i) for i in A]

ansA = 1
for a in A[0:K]:
  ansA *= a
  ansA %= MOD
ansAA = AA[0:K].count(-1)%2
if ansA==0 or ansAA==0:
  print(ansA)
  exit()

while ansA>0:
  ansA-=MOD
B1=A[0:K]
B2=sorted(A[K:N])
Bp=[i for i in A[0:K] if i>0]
Bm=[i for i in A[0:K] if i<0]
if B2[0]>0:B2.insert(0,0)
if B2[-1]<0:B2.insert(-1,0)


B1.remove(Bp[-1])
B1.append(B2[0])

ansB = 1
for a in B1[0:K]:
  ansB *= a
  ansB %= MOD

C1=A[0:K]
C1.remove(Bm[-1])
C1.append(B2[-1])

ansC = 1
for a in C1[0:K]:
  ansC *= a
  ansC %= MOD



print(max(ansB,ansC)%MOD)

### FIXED CODE ###

import numpy as np
N,K=map(int, input().split())
A =list(map(int,input().split()))
MOD = 10 ** 9 + 7
if N==K:
  ans0 = 1
  for a in A[0:N]:
    ans0 *= a
    ans0 %= MOD
  print(ans0)
  exit()
A=sorted(A)  
if (K%2==1 and A[-1]<0):
  ans1 = 1
  for a in A[N-K:N]:
    ans1 *= a
    ans1 %= MOD
  print(ans1)
  exit()
 
A=sorted(A, key=lambda x:abs(x), reverse=True)
AA=[np.sign(i) for i in A]
 
ansA = 1
for a in A[0:K]:
  ansA *= a
  ansA %= MOD
ansAA = AA[0:K].count(-1)%2
if ansA==0 or ansAA==0:
  print(ansA)
  exit()

while ansA>0:
  ansA-=MOD

B1=A[0:K]
C1=A[0:K]
B2=sorted(A[K:N])
Bp=[i for i in A[0:K] if i>0]
Bm=[i for i in A[0:K] if i<0]
 
if B2[0]>0:B2.insert(0,0)
if B2[-1]<0:B2.insert(-1,0)
if not Bp:Bp.insert(0,B1[-1])
if not Bm:Bm.insert(0,B1[0])
  
#print(Bp,Bm,B2)
#print(Bp[-1],B2[0])
B1.remove(Bp[-1])
B1.append(min(B2[0],0))
#print(B1)
ansB = 1
for a in B1[0:K]:
  ansB *= a
  ansB %= MOD
#print(Bm[-1],B2[-1])
C1.remove(Bm[-1])
C1.append(max(B2[-1],0))
 
ansC = 1
for a in C1[0:K]:
  ansC *= a
  ansC %= MOD
#print(B1,C1)
#print(ansB,ansC)
BB1=[np.sign(i) for i in B1]
ansBB1 = BB1[0:K].count(-1)%2
BB2=[np.sign(i) for i in C1]
ansBB2 = BB2[0:K].count(-1)%2
#print(ansBB1,ansBB2)
if ansBB1==1:
  print(ansC)
  exit()
if ansBB2==1:
  print(ansB)
  exit()
#print(B2[0]/Bp[-1],B2[-1]/Bm[-1])
#print(Bp[-1]*B2[-1],Bm[0]*B2[0])

#print(abs(Bp[-1]*B2[-1])-abs(Bm[-1]*B2[0]))
#print(ansB,ansC)
if abs(Bp[-1]*B2[-1])-abs(Bm[-1]*B2[0])>=0:
  print(ansC)
else: print(ansB)
if A < 10 and B < 10 :
    print(A*B)
else :
    print(-1)

### FIXED CODE ###

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

if A < 10 and B < 10 :
    print(A*B)
else :
    print(-1)
N,K=map(int,input().split())
A=[int(i) for i in input().split()]
k=[1]
a=1
for i in range(N):
    a=A[a-1]
    k.append(a)
    if i+2!=len(set(k)):
        del k[-1]
        Y=k[0:k.index(a)]
        Z=k[k.index(a):]
        break
    else:
        continue
if K<=len(Y):
    print(Z[K])
else:
    S=(K-len(Y))%(len(Z)) 
    print(Z[S])

### FIXED CODE ###

N,K=map(int,input().split())
A=[int(i)-1 for i in input().split()]

if K<=N:
    p=0
    for i in range (K):
        p=A[p]
    print(p+1)
else:
    p=0
    t=[-1]*N #言ってない場所は-1、行った場所は-1で示す
    t[0]=0
    for i in range(1,N):
        p=A[p] #今いる場所の番号が次のテレポート先
        if t[p]!=-1: #もし次のテレポート先が行ったことある場所ならループの始まりの証拠
            break
        t[p]=i
    d=i-t[p] #今の番号（i）がループまでの数で、t[p]は１回目に来たときの回数を表すからその差分がループに必要な回数
    K-=i #ループの前までの部分は省く
    K%=d #ループを繰り返した後の余りだけ考える
    
    for i in range(K):
        p=A[p]
    print(p+1)
import fractions
from functools import reduce

def gcd(numbers):
    return reduce(fractions.gcd, numbers, 1)

n = int(input())
print(gcd(list(map(int, input().split()))))

### FIXED CODE ###

n, m = map(int, input().split())
temp = list(map(int, input().split()))
temp = set(temp[1:])
for i in range(n-1):
	temp2 = list(map(int, input().split()))
	temp2 = set(temp2[1:])
	temp = temp.intersection(temp2)
print(len(temp))
# ABC157b


def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**6)
    # 再帰関数を使わない限りPypyで出すこと
    bing = [list(map(int, input().split())) for _ in range(3)]
    n = int(input())
    b = [int(input()) for _ in range(n)]
    for num in b:
        for i in bing:
            try:
                while True:
                    t = i.index(num)
                    i[t] = -1
            except:
                continue
    # print(bing)

    naname = [((0, 0), (1, 1), (2, 2)), (2, 0), (1, 1), (0, 2)]
    if sum(bing[0]) == -3 or sum(bing[1]) == -3 or sum(bing[2]) == -3 or bing[0][0]+bing[1][0]+bing[2][0] == -3 or bing[0][1]+bing[1][1]+bing[2][1] == -3 or bing[0][2]+bing[0][2]+bing[0][2] == -3 or bing[0][0]+bing[1][1]+bing[2][2] == -3 or bing[0][2]+bing[1][1]+bing[2][0] == -3:
        print('Yes')
        exit(0)

    print('No')

    d = [(1, 0), (1, 1), (0, 1)]
    for i in range(3):
        if sum(bing[i]) == -3:
            


if __name__ == '__main__':
    main()


### FIXED CODE ###

# ABC157b


def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**6)
    # 再帰関数を使わない限りPypyで出すこと
    bing = [list(map(int, input().split())) for _ in range(3)]
    n = int(input())
    b = [int(input()) for _ in range(n)]
    for num in b:
        for i in bing:
            try:
                while True:
                    t = i.index(num)
                    i[t] = -1
            except:
                continue
    # print(bing)

    naname = [((0, 0), (1, 1), (2, 2)), (2, 0), (1, 1), (0, 2)]
    if sum(bing[0]) == -3 or sum(bing[1]) == -3 or sum(bing[2]) == -3 or bing[0][0]+bing[1][0]+bing[2][0] == -3 or bing[0][1]+bing[1][1]+bing[2][1] == -3 or bing[0][2]+bing[1][2]+bing[2][2] == -3 or bing[0][0]+bing[1][1]+bing[2][2] == -3 or bing[0][2]+bing[1][1]+bing[2][0] == -3:
        print('Yes')
        exit(0)

    print('No')


if __name__ == '__main__':
    main()
N, M = map(int, raw_input().split())

if M - 2*N < 0:
  print N
else:
  print N + int((M - 2*N)/4)


### FIXED CODE ###

n = input()

print 800*n - 200*(int(n/15))
a,b=input().split()
a=int(a)
b=int(b)
y=[10**18]
f=0
for i in range (10**18):
    x=a-b
    if x<0:
        y.append(x*(-1))
        a=x*(-1)
    else :
        y.append(x)
        a=x
    if y[i]<=y[i+1]:
        f=y[i]
        break

print(f)

### FIXED CODE ###

a,b,c=input().split()
print(c+" "+a+" "+b)
import bisect
def prime(n):
    max_=int(n**0.5)
    li=[i for i in range(2,n+1)]
    primes=[]
    while li[0]<=max_:
        primes.append(li[0])
        tmp=li[0]
        li=[i for i in li if i%tmp!=0]
    primes.extend(li)
    return primes
Q=int(input())
arr=prime(100000)
likenum=[]
n=len(arr)
for i in range(n):
    lik=(arr[i]+1)//2
    x=bisect.bisect_left(arr,lik)
    if(x<n and arr[x]==(lik)):
        likenum.append(arr[i])
for i in range(Q):
    L,R=map(int,input().split())
    r=bisect.bisect_left(likenum,R)
    l=bisect.bisect_left(likenum,L)
    if(likenum[r]==R):
        r+=1
    print(r-l)

### FIXED CODE ###

import math
import bisect
def era(n):
    data=[i for i in range(2,n+1)]
    for d in data:
        data=[x for x in data if(x==d or x%d != 0)]
    return data
    
def prime(n):
    max=int(math.sqrt(n))
    li=[i for i in range(2,n+1)]
    primes=[]
    while li[0]<=max:
        primes.append(li[0])
        tmp=li[0]
        li=[i for i in li if i%tmp!=0]
    primes.extend(li)
    return primes

Q=int(input())
l=[]
r=[]
up=0
for i in range(Q):
    a,b=map(int,input().split())
    up=max([up,a,b])
    
    l.append(a)
    r.append(b)
s=prime(up)
like=[]

for i in range(len(s)):#O(10000*log(10000))
    if((s[i]+1)/2==s[bisect.bisect_left(s,(s[i]+1)/2)]):
        like.append(s[i])
        
sumli=[0]*100001
tmp=0
for i in range(2,100001):#O(100000)
    if(i==like[tmp]):
        sumli[i]=sumli[i-1]+1
        if(tmp<(len(like)-1)):
            tmp+=1
    else:
        sumli[i]=sumli[i-1]

for i in range(Q):
    print(sumli[r[i]]-sumli[l[i]-1])
n = [int(input()) for i in range(5)]
t=input()

m = min(n)

if t < m:
    t = m

tmp = t//m

if t % m != 0:
    tmp += 1

print(tmp+4)


### FIXED CODE ###

t = int(input())
n = [int(input()) for i in range(5)]


m = min(n)

if t < m:
    t = m

tmp = t//m

if t % m != 0:
    tmp += 1

print(tmp+4)
n, y = map(int, input().split())
for i in range(n + 1):
    for j in range(n - i + 1):
        if i * 10000 + j * 5000 + (n - i - j) * 1000 == y:
            print(i, j, n - i - j)
            exit()
print("-1 -1 -1")

### FIXED CODE ###

s = str(input())
l = s.replace("2017", "2018")
print(l)