Harryxun/stf_run huggingface dataset:
from numba import njit

MOD = 10 ** 9 + 7

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

@njit
def solve(N, M, S, T):
    dp = [[1] * (M+1) for _ in range(N+1)]
    for i, s in enumerate(S):
        for j, t in enumerate(T):
            dp[i+1][j+1] = dp[i+1][j] + dp[i][j+1]
            if s != t:
                dp[i+1][j+1] -= dp[i][j]
            dp[i+1][j+1] %= MOD
    return dp[M][N]
    
print(solve(N, M, S, T))

### FIXED CODE ###

MOD = 10 ** 9 + 7

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

dp = [[1] * (M+1) for _ in range(N+1)]

for i, s in enumerate(S):
    for j, t in enumerate(T):
        dp[i+1][j+1] = dp[i+1][j] + dp[i][j+1]
        if s != t:
            dp[i+1][j+1] -= dp[i][j]
        dp[i+1][j+1] %= MOD

print(dp[N][M])
import sys, re, os
    from collections import deque, defaultdict, Counter
    from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
    from itertools import permutations, combinations, product, accumulate
    from operator import itemgetter, mul
    from copy import deepcopy
    from string import ascii_lowercase, ascii_uppercase, digits
    from fractions import gcd
    def input(): return sys.stdin.readline().strip()
    def STR(): return input()
    def INT(): return int(input())
    def MAP(): return map(int, input().split())
    def S_MAP(): return map(str, input().split())
    def LIST(): return list(map(int, input().split()))
    def S_LIST(): return list(map(str, input().split()))
    sys.setrecursionlimit(10 ** 9)
    inf = sys.maxsize
    mod = 10 ** 9 + 7
     
    n, m = MAP()
    red = [False for _ in range(n)]
    bal = [1 for _ in range(n)]
    red[0] = 1
    for i in range(m):
        x, y = MAP()
        if red[x - 1]:
            red[y - 1] = True
            if bal[x - 1] == 1:
                red[x - 1] = False
        bal[x - 1] -= 1
        bal[y - 1] += 1
    print(sum(red))

### FIXED CODE ###

import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
def input(): return sys.stdin.readline().strip()
def STR(): return input()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
sys.setrecursionlimit(10 ** 9)
inf = sys.maxsize
mod = 10 ** 9 + 7

n, m = MAP()
red = [False for _ in range(n)]
bal = [1 for _ in range(n)]
red[0] = 1
for i in range(m):
    x, y = MAP()
    if red[x - 1]:
        red[y - 1] = True
        if bal[x - 1] == 1:
            red[x - 1] = False
    bal[x - 1] -= 1
    bal[y - 1] += 1
print(sum(red))
from intertools import chain
from collections import deque
H, W = map(int,input().split())
S = [list(input()) for _ in range(H)]
dhw = [[0,1],[0,-1],[1,0],[-1,0]]

ans = 0
for h in range(H):
  for w in range(W):
    d = deque([h,w])
    maze = [[-1] * W for _ in range(H)]
    if S[h][w] == '#':
      continue
    maze[h][w] = 0
    while d:
      ht , wt = d.popleft()
      for dh, dw in dhw:
        nh = ht + dh
        nw = wt + dw
        if not(0 <= nh < H and 0 <= nw < W):
          continue
        S[nh][nw] == '#':
          continue
        if maze[nh][nw] == -1:
          d.append([nh,nw])
          maze[nh][nw] = maze[ht][wt] + 1
    ans = max(ans,max[max(l) for l in maze])

print(ans)


### FIXED CODE ###

from collections import deque

def main():
    H, W = map(int, input().split())
    maze = [list(input()) for _ in range(H)]
    directions = [[0, 1], [0, -1], [1, 0], [-1, 0]]

    ans = 0
    for h in range(H):
        for w in range(W):
            if maze[h][w] == '#':
                continue

            goal_dists = [[-1] * W for _ in range(H)]
            goal_dists[h][w] = 0
            d = deque([[h, w]])

            while d:
                ht, wt = d.popleft()
                for dh, dw in directions:
                    if not (0 <= ht+dh < H and 0 <= wt+dw < W):
                        continue
                    if maze[ht+dh][wt+dw] == '#':
                        continue
                    if goal_dists[ht+dh][wt+dw] == -1:
                        goal_dists[ht+dh][wt+dw] = goal_dists[ht][wt] + 1
                        d.append([ht+dh, wt+dw])
            
            ans = max(ans, max([max(l) for l in goal_dists]))

    print(ans)

if __name__ == "__main__":
    main()
N = int(input())
seats = [""] * N

# 準備
print(0)
seats[0] = input()
print(N - 1)
seats[N - 1] = input()

l = 0
r = N - 1
while True:
    m = (l + r) // 2
    print("l,r =", l, r)
    print(m)
    s = input()
    if s == "Vacant":
        exit()

    if seats[l] == seats[m]:
        if (r-l) % 2 == 0:
            l = m + 1
        else:
            r = m -1
    else:
        if (r-l) % 2 == 1:
            r = m - 1
        else:
            l = m + 1





### FIXED CODE ###

N = int(input())
seats = [""] * N

# 準備
print(0)
seats[0] = input()
if seats[0] == "Vacant":
    exit()
print(N - 1)
seats[N - 1] = input()
if seats[N - 1] == "Vacant":
    exit()

l = 0
r = N - 1
while True:
    m = (l + r) // 2
    print(m)

    s = input()
    if s == "Vacant":
        exit()
    seats[m] = s

    if (seats[l] == seats[m]) & ((m - l) % 2 == 1):
        r = m
    elif (seats[l] != seats[m]) & ((m-l) % 2 == 0):
        r = m
    else:
        l = m
N,M=map(int,input().split())
x=[0 for i in range(M)]
y=[0 for i in range(M)]
for i in range(M):
    x[i],y[i]=map(int,input().split())
    x[i]-=1
    y[i]-=1
a=[0 for i in range(N)]
a[0]=N**N
c=[0 for i in range(N)]
c[0]=1
b=[1 for i in range(N)]
for i in range(M):
    b[x[i]]-=1
    b[y[i]]+=1
    t=a[x[i]]
    a[x[i]]-=t/(b[x[i]]+1)
    a[y[i]]+=t/(b[x[i]]+1)
    if b[x[i]]!=0:
        c[x[i]]=1
    else:
        c[x[i]]=0
    if t!=0:
        c[y[i]]=1
print(sum(c))


### FIXED CODE ###

N,M=map(int,input().split())
x=[0 for i in range(M)]
y=[0 for i in range(M)]
for i in range(M):
    x[i],y[i]=map(int,input().split())
    x[i]-=1
    y[i]-=1
a=[0 for i in range(N)]
a[0]=1
b=[1 for i in range(N)]
for i in range(M):
    b[x[i]]-=1
    b[y[i]]+=1
    if a[x[i]]==1:
        a[y[i]]=1
    if b[x[i]]==0:
        a[x[i]]=0
print(sum(a))
n, a, b = map(int, input().split())
cnt = 0
ans = 0
if n//(a+b) <= 10**100:
    ans += a * n//(a+b)
    cnt += (n//(a+b))*(a+b)
else:
    ans += a * (10**100//(a+b))
    cnt += (10**100//(a+b))*(a+b)

if n - cnt >= a:
    ans += a:
else:
    ans += n - cnt
print(ans)

### FIXED CODE ###

n, a, b = map(int, input().split())
cnt = 0
ans = 0
l = (a+b)
if n//l <= 10**100:
    ans += a * (n//l)
    cnt += (n//l)*l
    if n - cnt >= a:
        ans += a
    else:
        ans += max(n - cnt, 0)
else:
    ans += a * 10**100
    cnt += 10**100

print(ans)
# -*- coding: utf-8 -*-
x,y,z,k = map(int, input().split())

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

v = []
count = 0


for i in range(x):
    for j in range(y):
        v.append(a[i]+b[j])

v = sorted(v, reverse=True)
c = sorted(c, reverse=True)

vv = []
l = len(v)
if k > l: l=k
for i in range(l):
    for j in range(z):
        vv.append(v[i]+c[j])

vv = sorted(vv, reverse=True)

for i in vv[0:k]:
    print(i)


### FIXED CODE ###

# -*- coding: utf-8 -*-
x,y,z,k = map(int, input().split())

a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))
a.sort(reverse=True)
b.sort(reverse=True)
c.sort(reverse=True)


d = [e1+e2 for e1 in a for e2 in b]
d.sort(reverse=True)
d = d[:k]

e = [e1+e2 for e1 in d for e2 in c]
e.sort(reverse=True)


for i in range(k):
    print(e[i])
import math
N, K = map(int,input().split())
A = sorted(list(map(int,input().split())))

if K in A:
    print("POSSIBLE")
    exit(0)
if K > max(A) or N == 1:
    print("IMPOSSIBLE")
    exit(0)

t = abs(A[1]-A[0])
if K%t==0:
    print("POSSIBLE")
    exit(0)

g = 1000000000
for k in range(1,N):
    g = min(g,math.gcd(A[k-1],A[k]))

if K%g == 0:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

### FIXED CODE ###

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

def gcd(x, y):
    if y == 0:
        return x
    else:
        return gcd(y, x % y)

if K in A:
    print("POSSIBLE")
    exit(0)
if K > max(A) or N == 1:
    print("IMPOSSIBLE")
    exit(0)

g = 1000000000
for k in range(1,N):
    g = min(g,gcd(A[k-1],A[k]))

if K%g == 0:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")
l1 = list(map(int, input().split()))
def attack2(l1):
    H, N= l1[0], l1[1]
    v = 0
    for i in range(2, N):
        v += l1[i]
    result = H - v
    if result >0:
        return "no"
    else:
        return "yes"
print(attack2(l1))

### FIXED CODE ###

l1 = list(map(int, input().split()))
l2 = list(map(int, input().split()))
 
H = int(l1[0])
A = int(sum(l2))
result = H - A
if result <= 0:
    print("Yes")
else:
    print("No")
import sys
input = sys.stdin.readline
N = int(input())
A = [int(input()) for _ in range(N)]
B = sorted(A, reversed = True)

for i in range(N):
    if A[i] == B[0]:
        print(B[1])
    else:
        print(B[0])


### FIXED CODE ###

N = int(input())
A = []
for i in range(N):
    A.append(int(input()))
B = sorted(A, reverse = True)

for i in range(N):
    if A[i] == B[0]:
        print(B[1])
    else:
        print(B[0])
N = int(input())
R = [int(input()) for i in range(N)]

maxv = R[1] - R[0]
minv = R[0]
for i in n:
    maxv = max(maxv,i-minv)
    minv = min(minv,i)

print (maxv)

### FIXED CODE ###

N = int(input())
R = [int(input()) for i in range(N)]

maxv = R[1] - R[0]
minv = R[0]
for i in range(1,len(R)):
    maxv = max(maxv,R[i]-minv)
    minv = min(minv,R[i])

print (maxv)
import sys
stdin = sys.stdin

sys.setrecursionlimit(10 ** 7)

def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x) - 1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())


from heapq import heappush, heappop

n = ni()
a = list(li())
b = list(li())

que = []

for i, bi in enumerate(b):
    heappush(que, (-bi, i))

ans = 0
while que:
    cur, position = heappop(que)
    cur = -cur

    if cur - b[(position-1)%n] - b[(position+1)%n] < a[position]:
        continue

    ope = cur // (b[(position-1)%n] + b[(position+1)%n])
    ans += ope
    b[position] -= ope * (b[(position-1)%n] + b[(position+1)%n])
    heappush(que, (-b[position], position))

ok = True
for ai, bi in zip(a, b):
    if ai != bi:
        ok = False

if ok:
    print(ans)
else:
    print(-1)

### FIXED CODE ###

import sys
stdin = sys.stdin

sys.setrecursionlimit(10 ** 7)

def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x) - 1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())


from heapq import heappush, heappop

n = ni()
a = list(li())
b = list(li())

# n = 10**5
# a = [1]*(10**5)
# b = [5] + [1]*(10**5-2) + [7]

que = []

for i, bi in enumerate(b):
    heappush(que, (-bi, i))

ans = 0
while que:

    cur, position = heappop(que)
    cur = -cur

    if cur - b[(position-1)%n] - b[(position+1)%n] < a[position]:
        continue

    ope = (cur - a[position]) // (b[(position-1)%n] + b[(position+1)%n])

    ans += ope
    b[position] -= ope * (b[(position-1)%n] + b[(position+1)%n])
    heappush(que, (-b[position], position))

ok = True
for ai, bi in zip(a, b):
    if ai != bi:
        ok = False

if ok:
    print(ans)
else:
    print(-1)
N, K = map(int, input().split())
V = list(map(int, input().split()))
l = [0]
for i in range(1, K + 1): #左に何回操作するか
    #print("i=",i)
    b = 0
    for j in range(i // 2 + 1): #いくつ捨てるか
        #print("j=",j)
        a = V[0:i - j]
        a.sort()
        s = 0
        for m in range(i - j):
            if m >= j or a[m] >= 0:
                s += a[m]
        b = max(b, s)
    #print("b=",b)
    l.append(max(b, l[-1]))
#print(l)
r = [0]
for i in range(1, K + 1): #右に何回操作するか
    #print("i=",i)
    b = 0
    for j in range(i // 2 + 1): #いくつ捨てるか
        #print("j=",j)
        a = V[N - i + j:N]
        s = sum(a)
        #print("s=",s)
        a.sort()
        a.sort()
        s = 0
        for m in range(i - j):
            if m >= j or a[m] >= 0:
                s += a[m]
        b = max(b, s)
    #print("b=",b)
    r.append(max(b, r[-1]))
#print(r)
ans = 0
for i in range(K + 1):
    ans = max(ans, l[i] + r[K - i])
print(ans)


### FIXED CODE ###

N, K = map(int, input().split())
V = list(map(int, input().split()))
ans = 0
for i in range(N + 1):#左から何個とるか
    if i > K:
        break
    for j in range(N + 1):#右から何個とるか
        if i + j > N or i + j > K:
            break
        for l in range(N + 1):#何個捨てるか
            if i + j + l > K:
                break
            a = V[:i] + V[N-j:]
            a.sort()
            s = sum(a[l:])
            ans = max(ans, s)
print(ans)
x=input()
result = x**3
print(result)


### FIXED CODE ###

x=int(input())
result = x**3
print(result)
C = []
D = []
for i in range(n):
    a, b = map(int, input().split())
    A.append(a)
    B.append(b)
for j in range(m):
    c, d = map(int, input().split())
    C.append(c)
    D.append(d)
for i in range(n):
    v_min = float('inf')
    for j in range(m):
        v = abs(A[i] - C[j]) + abs(B[i] - D[j])
        if v_min > v:
            v_min = v
            ans = j + 1
    print(ans)

### FIXED CODE ###

n, m = map(int, input().split())
A = []
B = []
C = []
D = []
for i in range(n):
    a, b = map(int, input().split())
    A.append(a)
    B.append(b)
for j in range(m):
    c, d = map(int, input().split())
    C.append(c)
    D.append(d)
for i in range(n):
    v_min = float('inf')
    for j in range(m):
        v = abs(A[i] - C[j]) + abs(B[i] - D[j])
        if v_min > v:
            v_min = v
            ans = j + 1
    print(ans)
N, C = map(int, input().split())
events = []
for i in range(N):
    events.append(list(map(int, input().split())))

dp = [[0]*201 for i in range(C+1)]
for j in range(C+1):
    for k in range(-1000, 1001):
        if k != 0:
            dp[j][k] = -10**18
for a, b, c in events:
    for j in range(C-c, -1, -1):
        for k in range(-1000, 1001):
            if k + (b-a) >= -100:
                dp[j+c][k+b-a] = max(dp[j+c][k+b-a], dp[j][k] + a)
            if k + (a-b) <= 100:
                dp[j+c][k+a-b] = max(dp[j+c][k+a-b], dp[j][k] + b)
ans = 0
for j in range(C+1):
    for k in range(-1000, 1001):
        ans = max(ans, min(dp[j][k] + k, dp[j][k]))
print(ans)

### FIXED CODE ###

N, C = map(int, input().split())
events = []
for i in range(N):
    events.append(list(map(int, input().split())))

def solve():
    L = 250
    dp = [[-10**18]*(L+1) for i in range(C+1)]
    for j in range(C+1):
        dp[j][0] = 0
    for a, b, c in events:
        for j in range(C-c, -1, -1):
            for k in range(L+1):
                if k + (b-a) <= 0:
                    dp[j+c][a-k-b] = max(dp[j+c][a-k-b], dp[j][k]+k+b)
                else:
                    dp[j+c][k+b-a] = max(dp[j+c][k+b-a], dp[j][k]+a)
                if k + (a-b) <= L:
                    dp[j+c][k+a-b] = max(dp[j+c][k+a-b], dp[j][k]+b)
    ans = 0
    for j in range(C+1):
        ans = max(ans, max(dp[j]))
    return ans
print(solve())
N = int(input())
s = str(input())
types = []
for i in range(len(s)-1):
    x = s[:i]
    y = s[i:]
    x.sort()
    y.sort()
    x_str = []
    y_str = []
    x_str.append(x[0])
    y_str.append(y[0])
    count = 0
    for j in range(len(x)):
        if j == 0:
            x_str.append(x[0])
        else:
            if x[j-1] != x[j]:
                x_str.append(x[j])
    for j in range(len(y)):
        if j == 0:
            y_str.append(y[0])
        else:
            if y[j-1] != y[j]:
                y_str.append(y[j])
    for j in range(len(x_str)):
        if x_str[j] in y_str:
            count += 1
    types.append(count)
print(max(types))

### FIXED CODE ###

N = int(input())
s = str(input())
types = []
for i in range(len(s)-1):
    x = list(s[:i+1])
    y = list(s[i+1:])
    x.sort()
    y.sort()
    x_str = []
    y_str = []
    count = 0
    for j in range(len(x)):
        if j == 0:
            x_str.append(x[0])
        else:
            if x[j-1] != x[j]:
                x_str.append(x[j])
    for j in range(len(y)):
        if j == 0:
            y_str.append(y[0])
        else:
            if y[j-1] != y[j]:
                y_str.append(y[j])
    for j in range(len(x_str)):
        if x_str[j] in y_str:
            count += 1
    types.append(count)
print(max(types))
a,b=map(int,input().split())
if a>b:
  print("GREATER")
elif a<b:
  print("LESS")
else:
  print("EQUAL")

### FIXED CODE ###

a,b=int(input()),int(input())
if a>b:
  print("GREATER")
elif a<b:
  print("LESS")
else:
  print("EQUAL")
input()
s=map(int,input().split(' '))
s=list(s)
s=sorted(s)
n=len(s)
print(s[n/2]-s[n/2-1])

### FIXED CODE ###

input()
s=map(int,input().split(' '))
s=list(s)
s=sorted(s)
n=len(s)
print(s[int(n/2)]-s[int(n/2-1)])
import math
from decimal import Decimal

a,b=map(float,input().split())

a=int(a)
x=math.floor(b)
y=decimal(b-x)

print(a*x+math.floor(a*y))


### FIXED CODE ###

import math
from decimal import Decimal

a,b=map(str,input().split())

#パソコンは数値は2進数で表現しますが、2進数では小数点を正確に表現することができないため
#10進数表記に変える
#小数点を文字列型で定義する
a=Decimal(a)
b=Decimal(b)

print(math.floor(a*b))
h,w=map(int,input().split())
A=[[["."] *w for j in range(h)] for i in range(10)]
A[0]=[list(input()) for _ in range(h)]


i=0
ans=0
while A[i]!=[["#"] *w for j in range(h)]:
  for takasa in range(h):
    for nanmojime in range(w):
      if A[i][takasa][nanmojime]=="#":
        if nanmojime==0 and takasa==0:
          A[i+1][0][1]="#"
          A[i+1][1][0]="#"
          A[i+1][0][0]="#"
        elif nanmojime==0 and takasa==h-1:
          A[i+1][h-2][0]="#"
          A[i+1][h-1][1]="#"
          A[i+1][h-1][0]="#"
        elif nanmojime==w-1 and takasa==0:
          A[i+1][0][w-2]="#"
          A[i+1][1][w-1]="#"
          A[i+1][0][w-1]="#"
        elif nanmojime==w-1 and takasa==h-1:
          A[i+1][h-1][w-2]="#"
          A[i+1][h-2][w-1]="#"
          A[i+1][h-1][w-1]="#"
        elif takasa==0:
          A[i+1][0][nanmojime-1]="#"
          A[i+1][0][nanmojime+1]="#"
          A[i+1][1][nanmojime]="#"
          A[i+1][0][nanmojime]="#"
        elif takasa==h-1:
          A[i+1][h-1][nanmojime-1]="#"
          A[i+1][h-1][nanmojime+1]="#"
          A[i+1][h-2][nanmojime]="#"
          A[i+1][h-1][nanmojime]="#"
        elif nanmojime==0:
          A[i+1][takasa-1][0]="#"
          A[i+1][takasa+1][0]="#"
          A[i+1][takasa][1]="#"
          A[i+1][takasa][nanmojime]="#"
        elif nanmojime==w-1:
          A[i+1][takasa-1][w-1]="#"
          A[i+1][takasa+1][w-1]="#"
          A[i+1][takasa][w-2]="#"
          A[i+1][takasa][nanmojime]="#"
        else:
          A[i+1][takasa-1][nanmojime]="#"
          A[i+1][takasa+1][nanmojime]="#"
          A[i+1][takasa][nanmojime-1]="#"
          A[i+1][takasa][nanmojime+1]="#"
          A[i+1][takasa][nanmojime]="#"

  i+=1
print(i)
print(A)

### FIXED CODE ###

h,w=map(int,input().split())
A=[list(input()) for i in range(h)]
import sys
mod=10**9+7 ; inf=float("inf")
from math import sqrt, ceil
from collections import deque, Counter, defaultdict #すべてのkeyが用意されてる defaultdict(int)で初期化
input=lambda: sys.stdin.readline().strip()
sys.setrecursionlimit(11451419)
from decimal import ROUND_HALF_UP,Decimal as D  #変換後の末尾桁を0や0.01で指定
  #Decimal((str(0.5)).quantize(Decimal('0'), rounding=ROUND_HALF_UP))
from functools import lru_cache
from bisect import bisect_left as bileft, bisect_right as biright
from fractions import Fraction as F  #F(a,b)で正確なa/b
#メモ化再帰defの冒頭に毎回 @lru_cache(maxsize=10**10)
#引数にlistはだめ
#######ここまでテンプレ#######
#ソート、"a"+"b"、再帰ならPython3の方がいい
#######ここから天ぷら########

queue=deque([])
seen=[[0]*w for i in range(h)]
for i in range(h):
    for j in range(w):
        if A[i][j]=="#":
            queue.append([i,j,0])
            seen[i][j]=1

dx=[1,0,-1,0];dy=[0,1,0,-1]
while queue:
    x,y,t=queue.pop()
    for i,j in zip(dx,dy):
        if 0<=x+i<h and 0<=y+j<w and seen[x+i][y+j]==0:
            queue.appendleft([x+i,y+j,t+1])
            seen[x+i][y+j]=1
print(t)
Copy
Copy
a=int(input())
s=input()
if a>=3200:
  print(s)
else:
  print('red')

### FIXED CODE ###

a=int(input())
s=input()
if a>=3200:
  print(s)
else:
  print('red')
import math
A, B ,C, D = list(map(int, input().split()))

lcm = C * D //math.gcd(C, D)
b =  B // C + B // D - B // lcm
b = B - b

A -= 1
a =  A // C + A // D - A // lcm
a = A - a

print(b - a)


### FIXED CODE ###

import fractions
A, B ,C, D = list(map(int, input().split()))

lcm = C * D //fractions.gcd(C, D)
b =  B // C + B // D - B // lcm
b = B - b

A -= 1
a =  A // C + A // D - A // lcm
a = A - a

print(b - a)
M = input()
D = input()

count = 0
for i in range(2,int(D)+1):
    if len(str(i)) == 2:
        x = str(i)
        y = x[0:1]
        z = x[1:2]
        for j in range(2,int(M) + 1):
            if int(y) * int(z) == j and int(z) != 1 and int(y) != 1:
                count += 1
print(count)

### FIXED CODE ###

#入力が横に一行並んでるときはこうする↓
M,D = input().split()
 
count = 0
for i in range(2,int(D)+1):
    if len(str(i)) == 2:
        x = str(i)
        y = x[0:1]
        z = x[1:2]
        for j in range(2,int(M) + 1):
            if int(y) * int(z) == j and int(z) != 1 and int(y) != 1:
                count += 1
print(count)
def ii(): return int(sys.stdin.readline())

M = ii()

print(48-M)

### FIXED CODE ###

import sys
def ii(): return int(sys.stdin.readline())

M = ii()

print(48-M)
import math

H,N = map(int,input().split())
Magic =[]
A =[]
E =[]
for i in range(N):
    a,b = map(int,input().split())
    Magic.append((a,b))
    A.append(a)
    E.append(a/b)
MAX_A = H+max(A)
E_MIN = min(E)
WORST = math.ceil(MAX_A/E_MIN) +1
#print(Magic)
#print(MAX_A)
#print(WORST)
DP = [[WORST] * (MAX_A+1) for i in range(N)]
for i in range(N):
    if i == 0:
        for j in range(1,MAX_A//Magic[0][0]+1):
            DP[0][j*Magic[0][0]] = Magic[0][1]*j
    else:
        for j in range(1,(MAX_A+1)):
            KARI = []
            KARI.append(DP[i-1][j])
            if j % Magic[i][0] == 0:
                KARI.append((j//Magic[i][0]) * Magic[i][1])
            r = j // Magic[i][0]
            for k in range(r):
                KARI.append(DP[i-1][j-k*Magic[i][0]]+k*Magic[i][1])
            DP[i][j] = min(KARI)
print(min(DP[N-1][H:MAX_A]))

                
            
        


### FIXED CODE ###

H,A = map(int,input().split())
X = int(H // A)
if (H%A)!=0:
    X += 1
print(X)
n, l = map(int, input().split())
strs=[]
for i in range(n):
	strs.push(input())
print("".join(sorted(strs)))

### FIXED CODE ###

abc = list(map(int,input().split()))
print("YES" if sum(abc) == 17 and abc.count(5) else "NO")