Harryxun/stf_run huggingface dataset:
from collections import deque

H,W = map(int,input().split())
_input = []
for i in range(H):
    row = list(map(str,input().split()))
    _input.append(list(row[0]))

sy,sx = 0,0
gy,gx = H-1,W-1

queue = deque([(sy,sx)])

dyx=((1,0),(-1,0),(0,1),(0,-1))

counted_map = [[-1]*W for _ in range(H)]
counted_map[sy][sx] = 0

while queue:
    y,x = queue.popleft()

    if (y,x) == (gy,gx):
        break

    for dy,dx in dyx:
        ny = y + dy
        nx = x + dx

        if ny < 0 or nx < 0 or ny >= H or nx >= W:
            continue

        # 空きマスかつ未訪問
        if _input[ny][nx] == '.' and counted_map[ny][nx] == -1:
            counted_map[ny][nx] = counted_map[y][x] + 1
            queue.append((ny,nx))

y,x = gy,gx
move_num = counted_map[gy][gx]
while move_num != 0:
    _input[y][x] = 'o'
    for dy,dx in dyx:
        ny = y + dy
        nx = x + dx

        if ny < 0 or nx < 0 or ny >= H or nx >= W:
            continue
        
        if _input[ny][nx] == '.':
            tmp_dist = counted_map[ny][nx]
            if tmp_dist < move_num:
                move_num = tmp_dist
                next_y,next_x = ny,nx
    
    y,x = next_y,next_x

_input[sy][sx] = 'o'

res = 0

for raw in _input:
    for i in raw:
        if i == '.':
            res += 1

print(res)

### FIXED CODE ###

from collections import deque

H,W = map(int,input().split())
_input = []
for i in range(H):
    row = list(map(str,input().split()))
    _input.append(list(row[0]))

sy,sx = 0,0
gy,gx = H-1,W-1

queue = deque([(sy,sx)])

dyx=((1,0),(-1,0),(0,1),(0,-1))

counted_map = [[-1]*W for _ in range(H)]
counted_map[sy][sx] = 0

reach = False

while queue:
    y,x = queue.popleft()

    if (y,x) == (gy,gx):
        reach = True
        break

    for dy,dx in dyx:
        ny = y + dy
        nx = x + dx

        if ny < 0 or nx < 0 or ny >= H or nx >= W:
            continue

        # 空きマスかつ未訪問
        if _input[ny][nx] == '.' and counted_map[ny][nx] == -1:
            counted_map[ny][nx] = counted_map[y][x] + 1
            queue.append((ny,nx))

if not reach:
    print(-1)
    exit()
'''
y,x = gy,gx
move_num = counted_map[gy][gx]
while move_num != 0:
    _input[y][x] = 'o'
    for dy,dx in dyx:
        ny = y + dy
        nx = x + dx

        if ny < 0 or nx < 0 or ny >= H or nx >= W:
            continue
        
        if _input[ny][nx] == '.':
            tmp_dist = counted_map[ny][nx]
            if tmp_dist < move_num:
                move_num = tmp_dist
                next_y,next_x = ny,nx
    
    y,x = next_y,next_x

_input[sy][sx] = 'o'
'''

res = 0

for raw in _input:
    for i in raw:
        if i == '.':
            res += 1

print(res-counted_map[gy][gx]-1)
N, K = map(int, input().split())

if K == 0:
    print(N*N)
    exit()

ans = 0
for b in range(N+1):
    ans += max(0, b-K)*(N//b) + max(0, N%b-K+1)
print(ans)

### FIXED CODE ###

N, K = map(int, input().split())

if K == 0:
    print(N*N)
    exit()

ans = 0
for b in range(1, N+1):
    ans += max(0, b-K)*(N//b) + max(0, N%b-K+1)
print(ans)
a,b=map(int,input().split())

if 1<=a<=9 and 1<=b<=9:
  return a*b
else:
  return -1

### FIXED CODE ###

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

if 1<=a<=9 and 1<=b<=9:
  print(a*b)
else:
  print(-1)
N,L=map(int, input().split())  #複数数値入力　「A B」みたいなスペース空いた入力のとき

aji=0
eat=99999

for i in range(1,N+1):
    aji=aji+i+L-1
    if abs(aji) < abs(eat):
        eat = aji
        
print(aji)

### FIXED CODE ###

S=input()

hantei="Good"

for i in range(3):
    if S[i] == S[i+1]:
        hantei="Bad"
        
print(hantei)
if __name__=='__main__':
    S = input()
    if S[2]==S[3] and S[4]==S[5]:\
      print(Yes)
    else:
      print(No)

### FIXED CODE ###

if __name__=='__main__':
    S = input()
    if S[2]==S[3] and S[4]==S[5]:\
      print('Yes')
    else:
      print('No')
def factorial(n):
    if n == 1:
        return 1
    else:
        return n * factorial(n-1)
a,b=map(int, input().split())
cnt=0
if a>0:
    cnt=(factorial(a)/((factorial(a-2))*2))
if b>0:
    cnt=(factorial(b)/((factorial(b-2))*2))+cnt
print(int(cnt))

### FIXED CODE ###

def factorial(n):
    if n == 1:
        return 1
    else:
        return n * factorial(n-1)
a,b=map(int, input().split())
cnt=0
if a==2:
    cnt=1
elif a>1:
    cnt=(factorial(a)/((factorial(a-2))*2))
if b==2:
    cnt=cnt+1
elif b>1:
    cnt=(factorial(b)/((factorial(b-2))*2))+cnt
print(int(cnt))
# coding: utf-8
#-------------------------------------------------------------------
#-------------------------------------------------------------------
import sys
def p(*a):
  s=" ".join(map(str,a))
  #print(s)
  sys.stderr.write(s+"\n")
#-------------------------------------------------------------------
import math
def prm(n, r):
	return math.factorial(n)//math.factorial(n-r)

def cmb(n, r):
	return prm(n, r)//math.factorial(r)
#-------------------------------------------------------------------
def v(k):
	#p("B-1, k-1, cmb", B-1, k-1, cmb(B-1, k-1))
	p("R, k, cmb(R, k)",R, k, cmb(R, k))
#-------------------------------------------------------------------
MOD = 10**9+7
#-------------------------------------------------------------------


N, K = map(int, input().split())			# "5 7" -> ["5", "7"] -> 5, 7 => N=5,K=7

B=K
R=N-K


def calc(i):
	r = cmb(R+1, i)
	b = cmb(B-1, i-1)
	return r * b % MOD

for i in range(1,K+1):
	print( calc(i) )




### FIXED CODE ###

# coding: utf-8
#-------------------------------------------------------------------
#-------------------------------------------------------------------
import sys
def p(*a):
  s=" ".join(map(str,a))
  #print(s)
  sys.stderr.write(s+"\n")
#-------------------------------------------------------------------
import math
def prm(n, r):
	return math.factorial(n)//math.factorial(n-r)

def cmb(n, r):
	return prm(n, r)//math.factorial(r)
#-------------------------------------------------------------------
def v(k):
	#p("B-1, k-1, cmb", B-1, k-1, cmb(B-1, k-1))
	p("R, k, cmb(R, k)",R, k, cmb(R, k))
#-------------------------------------------------------------------
MOD = 10**9+7
#-------------------------------------------------------------------


N, K = map(int, input().split())			# "5 7" -> ["5", "7"] -> 5, 7 => N=5,K=7

B=K
R=N-K


def calc(i):
	r = cmb(R+1, i) % MOD
	b = cmb(B-1, i-1) % MOD
	return (r * b) % MOD

for i in range(1,K+1):
	if R+1>=i:
		print( calc(i) )
	else:
		print(0)
from functools import lru_cache

import sys
sys.setrecursionlimit(10**9)

N, K = map(int, input().split())

M = 10 ** 9 + 7

@lru_cache(maxsize=10*9)
def combinations(n, r):
    if n == 0 or r == 0: return 1
    return int(combinations(n, r-1) * (n-r+1) / r)

def f(i):
    return (combinations(N - K + 1, i) % M) * (combinations(K - 1, i - 1) % M)

for i in range(1, K + 1):
    print(f(i) % M


### FIXED CODE ###

from functools import lru_cache

import sys
sys.setrecursionlimit(10**9)

N, K = map(int, input().split())

M = 10 ** 9 + 7

@lru_cache(maxsize=10**9)
def combinations(n, r):
    if n == 0 or r == 0: return 1
    return int((combinations(n, r-1) * (n-r+1)) // r)

def f(i):
    return (combinations(N - K + 1, i) % M) * (combinations(K - 1, i - 1) % M)

for i in range(1, K + 1):
    print(f(i) % M)
di ={}
n = int(input())
di = {}
for i in range(n):
    sl = tuple(sorted(list(input()))
    if sl in di:
      di[sl] += 1
    else:
      di[sl] = 1
def nc2(n):
    a = 1
    for i in range(1,n):
        a *= i
    return int(a / 2)
ls = di.items()
cnt = 0
for i in ls:
    cnt += nc2(i[1])
print(cnt)


### FIXED CODE ###

n = int(input())
di = {}
for i in range(n):
    sl = "".join(sorted(list(input())))
    if sl in di:
      di[sl] += 1
    else:
      di[sl] = 1
def nc2(n):
    a = n * (n-1) /2
    return int(a) #1c2 =0
ls = di.items()
cnt = 0
for i in ls:
    cnt += nc2(i[1])
print(cnt)
n = input()
inf = 1000000000
M = [[inf for i in range(n)] for i in range(n)]
str = [0 for i in range(1000)]
for i in range(n):
  str = map(int, raw_input().split())
  u = str[0]
  k = str[1]
  for j in range(k):
    v = str[2+j]
    c = str[3+j]
    M[u][v] = c
d = [inf for i in range(n)]
color = [0 for i in range(n)]
 
d[0] = 0
color[0] = 1
 
while 1:
  minv = inf
  u = -1
  for i in range(n):
    if minv>d[i] and color[i]!=2:
      u = i
      minv = d[i]
    print minv
  if u == -1:
    break
  color[u] = 2
  for v in range(n):
    if color[v]!=2 and M[u][v]!=inf:
      if d[v]>d[u]+M[u][v]:
        d[v] = d[u] + M[u][v]
        color[v] = 1
for i in range(n):
  if d[i]==inf:
    print '%d -1' % i
  else:
    print '%d %d' % (i, d[i])

### FIXED CODE ###

n = input()
inf = 1000000000
M = [[inf for i in range(n)] for i in range(n)]
for i in range(n):
  str = map(int, raw_input().split())
  u = str[0]
  k = str[1]
  for j in range(k):
    v = str[2+2*j]
    c = str[3+2*j]
    M[u][v] = c
d = [inf for i in range(n)]
color = [0 for i in range(n)]
 
d[0] = 0
color[0] = 1
 
while 1:
  minv = inf
  u = -1
  for i in range(n):
    if minv>d[i] and color[i]!=2:
      u = i
      minv = d[i]
  if u == -1:
    break
  color[u] = 2
  for v in range(n):
    if color[v]!=2 and M[u][v]!=inf:
      if d[v]>d[u]+M[u][v]:
        d[v] = d[u] + M[u][v]
        color[v] = 1
for i in range(n):
  if d[i]==inf:
    print '%d -1' % i
  else:
    print '%d %d' % (i, d[i])
# n個からr個を選ぶ組合せ
def comb(n, r):
    r = min(r, n - r)
    if r == 0:
        return 1
    if r == 1:
        return n
    numerator = [n - r + i + 1 for i in range(r)]
    denominator  = [i + 1 for i in range(r)]
    for p in range(2, r + 1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p - 1, r, p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot
    result = 1
    for k in range(r):
        if numerator[k] > 1: 
            result *= numerator[k]
    return result

# n種類からr個を選ぶ重複組合せ
def homo(n, r):
    if n == 0:
        return 0
    elif n == 1:
        return 1
    else:
        return comb(n + r - 1, r)

def main(n, k, i):
    # 青玉k個のうち、まずi箇所に1個ずつ配置
    # 残りの(k - i)個を、ゼロを許容してi箇所に配置 => i種類から(k - i)個を選ぶ重複組合せ
    result = homo(i, k - i) % (10**9 + 7)
    # 赤玉(n - k)個のうち、まず(i - 1)個は青玉を区切るために配置
    # 残りの(n - k - i + 1)個を、ゼロを許容して(i + 1)箇所に配置 => (i + 1)種類から(n - k - i + 1)個を選ぶ重複組合せ
    # ただし、そもそも赤玉が(n - 1)個未満の場合は、論外
    if (n - k) < (i - 1):
        return 0
    result *= homo(i + 1, n - k - i + 1) % (10**9 + 7)
    result = result % (10**9 + 7)
    return int(result)

N, K = [int(x) for x in input().split()]
for i in range(K):
    print(main(N, K, i + 1))

### FIXED CODE ###

# パスカルの三角形
def pascal_triangle(n):
    pascal =[[]]
    pascal[0].append(1)
    for i in range(1, n + 1):
        pascal[i - 1].append(0)
        pascal.append([])
        for j in range(i + 1):
            pascal[i].append((pascal[i - 1][j - 1] + pascal[i - 1][j]) % (10**9 + 7))
    return pascal

# n個からr個を選ぶ組合せ
def comb(n, r, pascal_triangle):
    r = min(r, n - r)
    if r == 0:
        return 1
    if r == 1:
        return n
    result = pascal_triangle[n][r]
    return result

# n種類からr個を選ぶ重複組合せ
def homo(n, r, pascal_triangle):
    if n == 0:
        return 0
    elif n == 1:
        return 1
    else:
        return comb(n + r - 1, r, pascal_triangle)

def main(n, k, i, pascal_triangle):
    # 青玉k個のうち、まずi箇所に1個ずつ配置
    # 残りの(k - i)個を、ゼロを許容してi箇所に配置 => i種類から(k - i)個を選ぶ重複組合せ
    result = homo(i, k - i, pascal_triangle)
    # 赤玉(n - k)個のうち、まず(i - 1)個は青玉を区切るために配置
    # 残りの(n - k - i + 1)個を、ゼロを許容して(i + 1)箇所に配置 => (i + 1)種類から(n - k - i + 1)個を選ぶ重複組合せ
    # ただし、そもそも赤玉が(i - 1)個未満の場合は、論外
    if (n - k) < (i - 1):
        return 0
    result *= homo(i + 1, n - k - i + 1, pascal_triangle)
    result = result % (10**9 + 7)
    return int(result)

N, K = [int(x) for x in input().split()]
pascal_triangle = pascal_triangle(N)
for i in range(K):
    print(main(N, K, i + 1, pascal_triangle))
X, A, B = input().split()

if A-B>=0:
	print('delicious')
elif X+A-B>=0:
	print('safe')
else:
	print('dangerous')

### FIXED CODE ###

X, A, B = list(map(int, input().split()))
if A-B>=0:
	print('delicious')
elif X+A-B>=0:
	print('safe')
else:
	print('dangerous')
N = int(input())
  return "Yes" if N % 9 == 0 else "No"

### FIXED CODE ###

def main():
    N = map(int, input())
    if sum(N) % 9 == 0:
        return "Yes"
    else:
        return "No"

if __name__ == '__main__':
    print(main())
import collections
def solve(n, a_list):

    count = collections.Counter()
    for i in a_list:
        count[i // 400] += 1

    min_value = len([i for i in count.keys() if i != 8])
    max_value = min_value + count[8]
    return "{0} {1}".format(min_value, max_value)

if __name__ == "__main__":
    n = int(input())
    a_list = sorted([int(input()) for i in range(n)])
    print(solve(n, s_list))


### FIXED CODE ###

import collections
def solve(n, a_list):

    count = collections.Counter()
    for i in a_list:
        no = 8 if i // 400 >= 8 else i // 400
        count[no] += 1

    tmp = len([i for i in count.keys() if i != 8])
    max_value = tmp + count[8]
    min_value = 1 if tmp == 0 else tmp

    return "{0} {1}".format(min_value, max_value)

if __name__ == "__main__":
    n = int(input())
    a_list = [int(i) for i in input().split()]
    print(solve(n, a_list))
#! /usr/bin/env python
# -*- coding: utf-8 -*-

import pdb
import sys
F = sys.stdin

D, G = map(int,F.readline().split())
p = []
c = []
all_score = []
maisu = 0
ans = 0
sum = 0
all_selected = [0]*D
for k in range(D):
    p1, c1 = map(int,F.readline().split())
    p.append(p1)
    c.append(c1)
    all_score.append(100 * k * p1 + c1)

for bit in range(1<<D):
    for i in range(D):
        if bit & (1<<i):
            all_selected[i] = 1
            sum += all_score[i]
            maisu += p[i]

    nokori = G - sum
    if nokori <= 0:
        if ans == 0:
            ans = maisu
        else:
            ans = min(ans, maisu)
        continue
    for j in range(D)[::-1]:
        if all_selected[j] == 0:
            nokorimaisu = (nokori // (100 * j)) + 1
            if nokorimaisu <= p[j]:
                maisu += nokorimaisu
                if ans == 0:
                    ans = maisu
                else:
                    ans = min(ans, maisu)
            break



    all_selected = [0]*D
    maisu = 0
    sum = 0

print(ans)


### FIXED CODE ###

#! /usr/bin/env python
# -*- coding: utf-8 -*-

import pdb
import sys
import math
F = sys.stdin

D, G = map(int,F.readline().split())
p = []
c = []
all_score = []
maisu = 0
ans = 0
sum = 0
all_selected = [0]*D
for k in range(D):
    p1, c1 = map(int,F.readline().split())
    p.append(p1)
    c.append(c1)
    all_score.append(100 * (k+1) * p1 + c1)

for bit in range(1<<D):
    for i in range(D):
        if bit & (1<<i):
            all_selected[i] = 1
            sum += all_score[i]
            maisu += p[i]

    nokori = G - sum
    if nokori <= 0:
        if ans == 0:
            ans = maisu
        else:
            ans = min(ans, maisu)
        all_selected = [0]*D
        maisu = 0
        sum = 0
        continue

    for j in range(D)[::-1]:
        if all_selected[j] == 0:
            nokorimaisu = math.ceil(nokori / (100 * (j+1)))
            if nokorimaisu <= p[j]:
                maisu += nokorimaisu
                if ans == 0:
                    ans = maisu
                else:
                    ans = min(ans, maisu)
            break

    all_selected = [0]*D
    maisu = 0
    sum = 0

print(ans)
class Cube:
    def __init__(self, u, s, e, w, n, d):
        self.u = u
        self.s = s
        self.e = e
        self.w = w
        self.n = n
        self.d = d

    def rotate(self, dic):
        if dic == "N":
            tmp = self.u
            self.u = self.s
            self.s = self.d
            self.d = self.n
            self.n = tmp
        elif dic == "E":
            tmp = self.u
            self.u = self.w
            self.w = self.d
            self.d = self.e
            self.e = tmp
        elif dic == "W":
            tmp = self.u
            self.u = self.e
            self.e = self.d
            self.d = self.w
            self.w = tmp
        else:
            tmp = self.u
            self.u = self.n
            self.n = self.d
            self.d = self.s
            self.s = tmp


def main():
    u, s, e, w, n, d = map(int, input().split())
    O = input()

    cube = Cube(u, s, e, w, n, d)
    for i in range(len(O)):
        cube.rotate(O[i])
    print(cube.u)


if __name__ == '__main__':
    main(


### FIXED CODE ###

class Cube:
    def __init__(self, u, s, e, w, n, d):
        self.u = u
        self.s = s
        self.e = e
        self.w = w
        self.n = n
        self.d = d

    def rotate(self, dic):
        if dic == "N":
            tmp = self.u
            self.u = self.s
            self.s = self.d
            self.d = self.n
            self.n = tmp
        elif dic == "E":
            tmp = self.u
            self.u = self.w
            self.w = self.d
            self.d = self.e
            self.e = tmp
        elif dic == "W":
            tmp = self.u
            self.u = self.e
            self.e = self.d
            self.d = self.w
            self.w = tmp
        else:
            tmp = self.u
            self.u = self.n
            self.n = self.d
            self.d = self.s
            self.s = tmp


def main():
    u, s, e, w, n, d = map(int, input().split())
    O = input()

    cube = Cube(u, s, e, w, n, d)
    for i in range(len(O)):
        cube.rotate(O[i])
    print(cube.u)


if __name__ == '__main__':
    main()
from collections import deque
import sys

sys.setrecursionlimit(2000000000)
 
n = int(input())
nodes = []
done = [0 for _ in range(n)]
par = {}
for _ in range(n):
    x, y = map(int,input().split())
    nodes.append((x,y))
    par[(x,y)]=(x,y)
nodesx = sorted(nodes)
nodesy = sorted(nodes,key=lambda z:z[1])
s = []
 
for i in range(n-1):
    xcost =nodesx[i+1][0]-nodesx[i][0]
    ycost =nodesy[i+1][1]-nodesy[i][1]
    s.append((xcost,(nodesx[i+1],nodesx[i])))
    s.append((ycost,(nodesy[i+1],nodesy[i])))
s.sort()
s = deque(s)
def root(node,par):
    if node == par[node]:
        return node
    else:
        par[node] =root(par[node],par)
        return par[node]
def unite(node1,node2,par):
    par[root(node1,par)] = root(node2,par)
ans = 0
count =0
while count < n-1 :
    cost,(node1,node2) = s.popleft()
    root1 =root(node1,par)
    root2 =root(node2,par)
    if root1 != root2:
        unite(node1,node2,par)
        ans +=cost
        count += 1
print(ans)


### FIXED CODE ###

from collections import deque
import sys
 
sys.setrecursionlimit(2000000000)
 
n = int(input())
nodes = []
done = [0 for _ in range(n)]
par = {}
for _ in range(n):
    x, y = map(int,input().split())
    nodes.append((x,y))
    par[(x,y)]=(x,y)
nodesx = sorted(nodes)
nodesy = sorted(nodes,key=lambda z:z[1])
s = []
m = len(set(nodes))
for i in range(n-1):
    xcost =nodesx[i+1][0]-nodesx[i][0]
    ycost =nodesy[i+1][1]-nodesy[i][1]
    s.append((xcost,(nodesx[i+1],nodesx[i])))
    s.append((ycost,(nodesy[i+1],nodesy[i])))
s.sort()
s = deque(s)
def root(node,par):
    if node == par[node]:
        return node
    else:
        par[node] =root(par[node],par)
        return par[node]
def unite(node1,node2,par):
    par[root(node1,par)] = root(node2,par)
ans = 0
count =0
while count < m-1 :
    cost,(node1,node2) = s.popleft()
    root1 =root(node1,par)
    root2 =root(node2,par)
    if root1 != root2:
        unite(node1,node2,par)
        ans +=cost
        count += 1
print(ans)
s=input()
X,Y=map(int,input().split())
import copy
def solve(a,G):
    amax=0
    for i in a:
        amax+=abs(i)

    dp=[[0]*2*amax for _ in range(len(a))]
    dp[0][a[0]]=1
    for i in range(1,len(a)):
        p=a[i]
        for j in range(-amax,amax):
            dp[i][j-p]+=dp[i-1][j]
            dp[i][j+p]+=dp[i-1][j]
            #print(dp)
        if dp[i][G]>=1:
            return True
    return False
    """#print(a)
    dp=set()
    dp.add(a[0])
    dp2=set()
    for i in range(1,len(a)):
        for j in dp:
            dp2.add(j-a[i])
            dp2.add(j+a[i])
        dp=copy.deepcopy(dp2)
    #print(dp)
    if G in dp:
        return True
    return False"""

x=[]
y=[0]
flg=1
cnt=0
"""if s[0]=="T":
    x.append(0)"""
for i in range(len(s)):
    if s[i]=="F":
        cnt+=1
    else:
        if flg==1:
            x.append(cnt)
            flg*= -1
            cnt=0
        else:
            y.append(cnt)
            flg*= -1
            cnt=0
if flg==1:
    x.append(cnt)
else:
    y.append(cnt)
#print(x)
#print(y)

if solve(x,X) and solve(y,Y):
    print("Yes")
else:
    print("No")


### FIXED CODE ###

s=input()
X,Y=map(int,input().split())
from collections import defaultdict
def solve(da,dp,G):
    for i in range(len(da)):
        tmp=set()
        for j in dp:
            tmp.add(j-da[i])
            tmp.add(j+da[i])
        dp=tmp
    if G in dp:
        return True
    else:
        return False
    """amax=0
    for i in a:
        amax+=abs(i)
    if amax==0:
        if G==0:
            return True
        else:
            return False
    if a[0]==G:
        return True
    dp=[[0]*2*amax for _ in range(3)]
    dp[0][a[0]]=1
    for i in range(1,len(a)):
        p=a[i]
        for j in range(-amax,amax):
            dp[i%3][j-p]+=dp[(i-1)%3][j]
            dp[i%3][j+p]+=dp[(i-1)%3][j]
            #print(dp)
        if dp[i%3][G]>=1:
            return True
    return False"""
    """#print(a)
    dp=set()
    dp.add(a[0])
    dp2=set()
    for i in range(1,len(a)):
        for j in dp:
            dp2.add(j-a[i])
            dp2.add(j+a[i])
        dp=copy.deepcopy(dp2)
    #print(dp)
    if G in dp:
        return True
    return False"""

d=[len(x) for x in s.split("T")]

dx=d[2::2]
dy=d[1::2]

if solve(dx,{d[0]},X) and solve(dy,{0},Y):
    print("Yes")
else:
    print("No")
N, M = map(int, input().split())
  
broken_step = []
for _ in range(M):
    broken_step.append(int(input()))
      
import sys
sys.setrecursionlimit(10000000)

mod = 1000000007

memo = [-1] * (N+1)

if N == 0 and N not in broken_step:
    memo[N] = 1
elif N == 0 and N in broken_step:
    memo[N] = 0

if N == 1 and N not in broken_step:
    memo[N] = 1
    
elif N == 1 and N in broken_step:
    memo[N] = 0

def step_memo(N):
    
    if N in broken_step:
        return 0
        
    if memo[N] != -1:
        return memo[N]
    
    memo[N] =  (a * step_memo(N-1) + b * step_memo(N-2)) % mod
    return (a * step_memo(N-1) + b * step_memo(N-2)) % mod

print(step_memo(N))


### FIXED CODE ###

N, M = map(int, input().split())
import sys
sys.setrecursionlimit(10000000)

mod = 1000000007

memo = [-1] * (N+1)

for _ in range(M):
    broken_step = int(input())
    memo[broken_step] = 0
    
memo[0] = 1
if memo[1] == -1:
    memo[1] = 1

def step_memo(N):
    
    if memo[N] != -1:
        return memo[N]
    
    memo[N] =  (step_memo(N-1) + step_memo(N-2)) % mod
    return (step_memo(N-1) + step_memo(N-2)) % mod
  
print(step_memo(N))
X,A=map(int,input().split)
if(X<A):
  print("0")
else:
  print("10")

### FIXED CODE ###

X,A=map(int,input().split())
if(X<A):
  print("0")
else:
  print("10")