Harryxun/stf_run huggingface dataset:
n = int(input())
a = list(map(int, input().split()))

flag = [False]*8
t = 0
for i in a:
  if i < 400: flag[0] = True
  elif i < 800: flag[1] = True
  elif i < 1200: flag[2] = True
  elif i < 1600: flag[3] = True
  elif i < 2000: flag[4] = True
  elif i < 2400: flag[5] = True
  elif i < 2800: flag[6] = True
  elif i < 3200: flag[7] = True
  elif 3200 <= i: t += 1
    
minNum = 0
p = flag.count(True)
if p > 0: minNum = p
elif p == 0 and t > 0:
  minNum = 1
  t -= 1
  
maxNum = 0
if minNum < 8:
  maxNum = min(8, minNum + t)
else: maxNum = minNUm

print(minNum,maxNum)

### FIXED CODE ###

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

flag = [False]*8
t = 0
for i in a:
  if i < 400: flag[0] = True
  elif i < 800: flag[1] = True
  elif i < 1200: flag[2] = True
  elif i < 1600: flag[3] = True
  elif i < 2000: flag[4] = True
  elif i < 2400: flag[5] = True
  elif i < 2800: flag[6] = True
  elif i < 3200: flag[7] = True
  elif 3200 <= i: t += 1
    
minNum = 0
p = flag.count(True)
if p > 0: minNum = p
elif p == 0 and t > 0:
  minNum = 1
  
maxNum = p + t

print(minNum,maxNum)
from itertools import permutations

n,m=map(int,input().split())
tree=[[] for i in range(m)]
for i in range(m):
    a,b=map(int,input().split())
    tree[a-1].append(b-1)
    tree[b-1].append(a-1)

cnt=0
for i in permutations(range(1,n)):
    if i[0] in tree[0]:
        t_cnt=1
        for j in range(1,len(i)):
            if i[j] in tree[i[j-1]]:
                t_cnt+=1
            else:
                break
        if t_cnt==n-1:
            cnt+=1
print(cnt)

### FIXED CODE ###

from itertools import permutations

n,m=map(int,input().split())
tree=[[] for i in range(m+1)]
for i in range(m):
    a,b=map(int,input().split())
    tree[a-1].append(b-1)
    tree[b-1].append(a-1)

cnt=0
for i in permutations(range(1,n)):
    if i[0] in tree[0]:
        t_cnt=1
        for j in range(1,len(i)):
            if i[j] in tree[i[j-1]]:
                t_cnt+=1
            else:
                break
        if t_cnt==n-1:
            cnt+=1
print(cnt)
nums1=[int(e) for e in input().split()]
nums2=[int(t) for t in input().split()]
all_vote = 0
sum = nums1[0]
for num in nums2:
  all_vote += num
for k in nums2:
  if (k/(all_vote) < 1/(4*nums1[1])):
    sum-=1
if(nums1[1]<=sum):
  print(Yes)
else:
  print(No)

### FIXED CODE ###

nums1=[int(e) for e in input().split()]
nums2=[int(t) for t in input().split()]
all_vote = 0
sums = nums1[0]
for num in nums2:
  all_vote += num
for k in nums2:
  if (k/(all_vote) < 1/(4*nums1[1])):
    sums-=1
if(nums1[1]<=sums):
  print('Yes')
else:
  print('No')
a, b, c, d = map(int, input().split(' '))
r = a + b
l = c + d

if l > r:
  print('left')
elsif l = r:
  print('Balanced')
else:
  print('Right')

### FIXED CODE ###

a, b, c, d = map(int, input().split(' '))
l = a + b
r = c + d

if l > r:
  print('Left')
elif l == r:
  print('Balanced')
else:
  print('Right')
n,a = map(int, input().split())

print(n**2-a)

### FIXED CODE ###

n=int(input())
a=int(input())

print(n**2-a)
h,w = map(int,input().split())
Array = [list(map(int,input().split())) for _ in range(h)]
dx = [1,1,0,-1,-1,-1,0,1]
dy = [0,1,1,1,0,-1,-1,-1]
for i in range(h):
  for j in range(w):
    if Array[i][j]='#':
      continue
    num=0
    for d in range(8):
      ni = i+dy[d]
      nj = j+dx[d]
      if ni<0 or h<=ni:
        continue
      if nj<0 or w<=nj:
        continue
      if Array[ni][nj]=='#':
        num=num+1
    Array[i][j]=char(num)
    
for i in Array:
  print(*i)

### FIXED CODE ###

h,w = map(int,input().split())
Array = [list(map(str,input())) for _ in range(h)]
dx = [1,1,0,-1,-1,-1,0,1]
dy = [0,1,1,1,0,-1,-1,-1]
for i in range(h):
  for j in range(w):
    if Array[i][j]=='#':
      continue
    num=0
    for d in range(8):
      ni = i+dy[d]
      nj = j+dx[d]
      if ni<0 or h<=ni:
        continue
      if nj<0 or w<=nj:
        continue
      if Array[ni][nj]=='#':
        num=num+1
    Array[i][j]=str(num)
    
for i in Array:
  print(*i, sep='')
import sys


def fill_balls(a):
    b = [0]
    c = [0]
    for ball in a:
        if b[-1] == 0:
            b.append(ball)
        elif b[-1] < ball and c[-1] < ball:
            if b[-1] < c[-1]:
                c.append(ball)
            else:
                b.append(ball)
        elif b[-1] < ball:
            b.append(ball)
        elif c[-1] < ball:
            c.append(ball)
        else:
            return 'NO'
    return 'YES'


sys.stdin.readline()

for line in sys.stdin:
    a = map(int, line.split(' '))
    print fill_balls(a)

### FIXED CODE ###


import sys


def fill_balls(a):
    b = [0]
    c = [0]
    for ball in a:
        if b[-1] == 0:
            b.append(ball)
        elif b[-1] < ball and c[-1] < ball:
            if b[-1] < c[-1]:
                c.append(ball)
            else:
                b.append(ball)
        elif b[-1] < ball:
            b.append(ball)
        elif c[-1] < ball:
            c.append(ball)
        else:
            return 'NO'
    return 'YES'



for i in range(input()):
    a = map(int, raw_input().split(' '))
    print fill_balls(a)
n = int(input())
m=int(1e9+7)
print(((pow(10,n,m)+pow(8,n,m)-2*pow(9,n,m))%m)

### FIXED CODE ###

n = int(input())
m=int(1e9+7)
print((pow(10,n,m)+pow(8,n,m)-2*pow(9,n,m))%m)
while True:
     x,y=[int (i) for i in input().split()]
    if x==0 and y==0:
        break
    if  x >= y:
        print (y,x)
    elif x < y :
        print (x,y)


### FIXED CODE ###

while True:
    x,y=[int (i) for i in input().split()]
    if x==0 and y==0:
        break
    if  x >= y:
        print (y,x)
    elif x < y:
        print (x,y)
N=int(input())
A =list(map(int,input().split()))
for i in range(N):
  print(A.count(i+1))
  


### FIXED CODE ###

import math
a=int(input())
print(2* math.pi *a)
from collections import deque
N=int(input())
A=list(map(int,input().split()))
B=[]
for i in range(N):
  B.append(A[i])
  B=reversed(B)
print("".join(B))

### FIXED CODE ###

from collections import deque
N=int(input())
A=list(map(int,input().split()))
l=[]
r=[]
for i in range(N):
  if i%2==0:
    r.append(A[i])
  else:
    l.append(A[i])
if N%2==0:
  print(*(list(reversed(l))+r))
else:
  print(*(list(reversed(r))+l))
def fib(n):
  if F[n] != 0:
    return F[n]
  elif n==0 or n==1:
    F[n] = 1
  else:
    F[n] = fib(n-1) + fib(n-2)

  return F[n]



n = input()
print fib(n)

### FIXED CODE ###

def fib(n):
  if F[n] != 0:
    return F[n]
  elif n==0 or n==1:
    F[n] = 1
  else:
    F[n] = fib(n-1) + fib(n-2)

  return F[n]



n = input()
F = [0 for row in range(n+1)]
print fib(n)
N,M=map(int,input().split())
s=[0]*M
c=[0]*M
a=0
for i in range(M):
	s[i],c[i]=map(int,input().split())
ans=-1
if max(s)>N:
	print(ans)
	exit()
for j in range(0,1000):
	value=str(j)
	if len(value)==N:
		for S,C in zip(s,c):
			if int(value[S-1])==C:
				a+=1
		if a==M:
			ans=int(j)
			break
		else:
			a=0
	else:
		continue
print(ans)

### FIXED CODE ###

N,M=map(int,input().split())
s=[0]*M
c=[0]*M
a=0
for i in range(M):
	s[i],c[i]=map(int,input().split())
ans=-1
if M==0:
	ans=1*(10**(N-1))
	if ans==1:
		ans=0
	print(ans)
	exit()
if max(s)>N:
	print(ans)
	exit()
for j in range(0,1000):
	value=str(j)
	if len(value)==N:
		for S,C in zip(s,c):
			if int(value[S-1])==C:
				a+=1
		if a==M:
			ans=int(j)
			break
		else:
			a=0
	else:
		continue
print(ans)
def linearSearch(key, list):
    for e in list:
        if key == e:
            return 1
    return 0
    
    
N1 = int(input())
arr1 = [int(n) or n in input().split()]
N2 = int(input())
arr2 = [int(n) or n in input().split()]

print(sum([linearSearch(key, arr2) for key in arr])


### FIXED CODE ###

def linearSearch(key, list):
    for e in list:
        if key == e:
            return 1
    return 0


N1 = int(input())
arr1 = [int(n) for n in input().split()]
N2 = int(input())
arr2 = [int(n) for n in input().split()]

print(sum([linearSearch(key, arr1) for key in arr2]))
X, Y, Z, K = map(int, input().split())
A = [int(i) for i in input().split()]
B = [int(i) for i in input().split()]
C = [int(i) for i in input().split()]

A.sort()
A.reverse()
B.sort()
B.reverse()
C.sort()
C.reverse()

if X * Y * Z > 3000:
    X = 3000
    Y = 3000
    Z = 3000

ans_list = []
for i in range(X):
    for j in range(Y):
        for k in range(Z):
            sum = A[i]+B[j]+C[k]
            ans_list.append(sum)        
ans_list.sort()
ans_list.reverse()
for i in range(K):
    print(ans_list[i])

### FIXED CODE ###

from itertools import product

X, Y, Z, K = map(int, input().split())
A = [int(i) for i in input().split()]
B = [int(i) for i in input().split()]
C = [int(i) for i in input().split()]

A.sort(reverse=True)
B.sort(reverse=True)
C.sort(reverse=True)

a = []
count = 0
for i in range(X):
    for j in range(Y):
        if (i+1)*(j+1) > K:
            break
        for k in range(Z):
            if (i+1)*(j+1)*(k+1) > K:
                break
            a.append(A[i] + B[j] + C[k])

a.sort(reverse=True)

for i in range(K):
    print(a[i])
s=input()
if s="ABC":
  print("ARC")
else:
  print("ABC")


### FIXED CODE ###

s=input()
if s=="ABC":
  print("ARC")
else:
  print("ABC")
a = int(input())
x  = 0
lists = []
ass =[]
#bが気温c、standardが平均気温の基準
b,standard = map(int,input().split())
#標高
elev = list(map(int,input().split()))

for i in range(a):
    lists.append(abs(b - elev[i] * 0.006 - standard))
    print(lists)

m = min(lists)
mindex = lists.index(1.0)
print(mindex + 1)


### FIXED CODE ###

a = int(input())
x  = 0
lists = []
ass =[]
#bが気温c、standardが平均気温の基準
b,standard = map(int,input().split())
#標高
elev = list(map(int,input().split()))

for i in range(a):
    lists.append(abs(b - elev[i] * 0.006 - standard))

m = min(lists)
mindex = lists.index(m)
print(mindex + 1)
from sys import stdin
from math import factorial
from operator import mul
from functools import reduce

def permutations_count(n, r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

N,K = map(int,stdin.readline().split())
mod = pow(10,9)+7

frame = N-K+1
for i in range(1,K+1):
  select=permutations_count(frame, i) % mod
  pattern=permutations_count(K-1, i-1) % mod
  print((select * pattern) % mod )

### FIXED CODE ###

from sys import stdin
from math import factorial

def permutations_count(n, r):
  return factorial(n) // factorial(r) // factorial(n - r)

N,K = map(int,stdin.readline().split())
mod = pow(10,9)+7

frame = N-K+1
for i in range(1,K+1):
  if K == N:
    if i == 1:
      print("1")
    else:
      print("0")
  else:
    if i > frame:
      print("0")
    else:
      select=permutations_count(frame, i) % mod
      pattern=permutations_count(K-1, i-1) % mod
      print((select * pattern) % mod )
n,q=map(int,input().split())
s=list(input())
li=[0]*n
cnt=0
ans=0

for i in range(n):
  if i==0:
    continue
  if s[i-1]=="A" and s[i]=="C":
    cnt+=1  
  li[i]=cnt
    
for i in range(q):
  l,r=map(int,input().split())
  ans=li[r]-li[l]
  print(ans)


### FIXED CODE ###

n,q=map(int,input().split())
s=list(input())
li=[0]*n
cnt=0
ans=0

for i in range(n):
  if i==0:
    continue
  if s[i-1]=="A" and s[i]=="C":
    cnt+=1  
  li[i]=cnt
    
for i in range(q):
  l,r=map(int,input().split())
  ans=li[r-1]-li[l-1]
  print(ans)
A, B, C, K = map(int, input().split())
ABC_total = 0
A_list = [1,] * A
B_list = [0,] * B
C_list = [-1,] * C
ABC_list = A_list + B_list + C_list
for i in range(K):
  ABC_total += ABC_list[i]
print(ABC_total)


### FIXED CODE ###

A, B, C, K = map(int, input().split())
if A >= K:
  print(K)
elif A + B >= K:
  print(A)
else:
  print(A - (K - A - B))
# coding: utf-8

import sys
import math
import collections
import itertools
INF = 10 ** 13
MOD = 10 ** 9 + 7
def input() : return sys.stdin.readline().strip()
def gcd(x, y) : return y if x % y == 0 else gcd(y, x % y)
def lcm(x, y) : return (x * y) // gcd(x, y)
def I() : return int(input())
def LI() : return [int(x) for x in input().split()]
def RI(N) : return [int(input()) for _ in range(N)]
def LRI(N) : return [[int(x) for x in input().split()] for _ in range(N)]
def LS() : return input().split()
def RS(N) : return [input() for _ in range(N)]
def LRS(N) : return [input().split() for _ in range(N)]
def PL(L) : print(*L, sep="\n")

H, W = LI()
S = RS(H)

def dfs(x, y, ok, dist):
    if not(0 <= x < W) or not(0 <= y < H) or S[y][x] == "#":
        return ok - 1

    if dist == 1:
        return dfs(x, y-1, ok+1, 1)
    elif dist == 2:
        return dfs(x+1, y, ok+1, 2)
    elif dist == 3:
        return dfs(x, y+1, ok+1, 3)
    else:
        return dfs(x-1, y, ok+1, 4)

ans = 0
for x in range(W):
    for y in range(H):
        if S[y][x] == ".":
            ans = max(ans, 1 + dfs(x, y-1, 1, 1) + dfs(x+1, y, 1, 2) + dfs(x, y+1, 1, 3) + dfs(x-1, y, 1, 4))

print(ans)


### FIXED CODE ###

# coding: utf-8

import sys
import math
import collections
import itertools
from functools import lru_cache
INF = 10 ** 13
MOD = 10 ** 9 + 7
def input() : return sys.stdin.readline().strip()
def gcd(x, y) : return y if x % y == 0 else gcd(y, x % y)
def lcm(x, y) : return (x * y) // gcd(x, y)
def I() : return int(input())
def LI() : return [int(x) for x in input().split()]
def RI(N) : return [int(input()) for _ in range(N)]
def LRI(N) : return [[int(x) for x in input().split()] for _ in range(N)]
def LS() : return input().split()
def RS(N) : return [input() for _ in range(N)]
def LRS(N) : return [input().split() for _ in range(N)]
def PL(L) : print(*L, sep="\n")

H, W = LI()
S = RS(H)

L = [[0] * W for _ in range(H)]
R = [[0] * W for _ in range(H)]
U = [[0] * W for _ in range(H)]
D = [[0] * W for _ in range(H)]

for i in range(H):
    lf = 0
    rf = 0
    for j in range(W):
        if S[i][j] == ".":
            lf += 1
            L[i][j] = lf
        else:
            lf = 0

        if S[i][W-1-j] == ".":
            rf += 1
            R[i][W-1-j] = rf
        else:
            rf = 0

for i in range(W):
    uf = 0
    df = 0
    for j in range(H):
        if S[j][i] == ".":
            df += 1
            D[j][i] = df
        else:
            df = 0

        if S[H-1-j][i] == ".":
            uf += 1
            U[H-1-j][i] = uf
        else:
            uf = 0

ans = 0
for i in range(H):
    for j in range(W):
        if S[i][j] == ".":
            ans = max(ans, U[i][j]+D[i][j]+L[i][j]+R[i][j]-3)

print(ans)
W,H,x,y,r=map(int,input().split())
W=-r;H=-r;
if min(x,y)>=r and x<=W and y<=H:
    print(Yes)
else:
    print(No)


### FIXED CODE ###

W,H,x,y,r=map(int,input().split())
if min([x,y])>=r and x<=(W-r) and y<=(H-r):
    print("Yes")
else:
    print("No")
import sys
input = sys.stdin.readline

def main():
    N = int(input())
    s = input().strip().split()
    for i in range(N):
        print(f"{s[0][i]}{s[1][i]}", end="")
    print()


if __name__ == "__main__":
    main()

### FIXED CODE ###

import sys
input = sys.stdin.readline

def main():
    N = int(input())
    s = input().strip().split()
    for i in range(N):
        print(s[0][i], end="")
        print(s[1][i], end="")
    print()


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

G = dict()
N, M = map(int, input().split())
color = [0]*(N+1)
for n in range(1, N+1):
    G[n] = []
for _ in range(M):
    a, b = map(int, input().split())
    G[a].append(b)
    G[b].append(a)
Q = int(input())




data = [list(map(int, input().split())) for _ in range(Q)]
data.reverse()
color_d = [-1]*(N+1)

for v, d, c in data:
    if color_d[v] >= d:
        pass
    # BFS
    deq = deque([v])
    if color[v] == 0:
        color[v] = c
    color_d[v] = d
    while len(deq) > 0:
        s = deq.popleft()
        for t in G[s]:
            if color_d[t] >= color_d[s] - 1:
                pass
            else:
                color_d[t] = color_d[s] - 1
                if color[t] == 0:
                    color[t] = c
                if color_d[t] > 0:
                    deq.append(t)
                
for n in range(1, N+1):
    print(color[n])
                



### FIXED CODE ###

import numpy as np
N = int(input())
a = np.array(list(map(int, input().split())))
a.sort()
print(a[N:(3*N):2].sum())
N = list(int, input().split())
N.sort()
print(N[0]*N[1]//2)


### FIXED CODE ###

N = list(map(int, input().split()))
N.sort()
print(N[0]*N[1]//2)
N, M = map(int,input().split())

michi = [[] for i in range(N)]
for i in range(M):
  tempa, tempb = map(int,input().split())
  michi[tempa-1].append(tempb-1)
  michi[tempb-1].append(tempa-1)
#print(michi)
  
colors = [0 for i in range(N)]

def dfs(v,color):
  colors[v] = color
  for to in michi[v]:
    if colors[to] == color:
      return False
    if colors[to] == 0 and not dfs(to,-color):
      return False
  return True

if dfs(0,1):
  a = colors.count(1)
  b = colors.count(-1)
  #print(colors)
  print(a*b-M)
else:
  print(N*(N-1)//2 - M)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)

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

michi = [[] for i in range(N)]
for i in range(M):
  tempa, tempb = map(int,input().split())
  michi[tempa-1].append(tempb-1)
  michi[tempb-1].append(tempa-1)
#print(michi)
  
colors = [0 for i in range(N)]

def dfs(v,color):
  colors[v] = color
  for to in michi[v]:
    if colors[to] == color:
      return False
    if colors[to] == 0 and not dfs(to,-color):
      return False
  return True

if dfs(0,1):
  a = colors.count(1)
  b = colors.count(-1)
  #print(colors)
  print(a*b-M)
else:
  print(N*(N-1)//2 - M)
#include <iostream>
#include <vector>
#include <algorithm>
#include <utility>
#include <string>
#include <queue>
#include <stack>

using namespace std;

typedef long long int ll;
typedef pair<int, int> Pii;

const ll mod = 1000000007;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);

  vector<int> n(4);
  for (auto &x: n) cin >> x;

  sort(n.begin(), n.end());
  if (n[0] == 1 && n[1] == 4 && n[2] == 7 && n[3] == 9) {
    cout << "YES" << endl;
  }
  else {
    cout << "NO" << endl;
  }

  return 0;
}


### FIXED CODE ###


def main():
    buf = input()
    buflist = buf.split()
    N = list(map(int, buflist))
    if 1 in N and 9 in N and 7 in N and 4 in N:
        print("YES")
    else:
        print("NO")

if __name__ == '__main__':
    main()
data = input().split()

a = data[0]
b = data[1]

ans = min(a, b) * max(a, b)

print(ans)


### FIXED CODE ###

data = input().split()
 
a = data[0]
b = data[1]
 
ans = min(a, b) * int(max(a, b))
 
print(ans)
a, b = map(int,raw_input().split())
if a > b:
    print 'a > b'
elif a == b:
    print 'a == b'
else
    print 'a < b'

### FIXED CODE ###

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

if a>b:
  print "a > b"
if a<b:
  print "a < b"
if a==b:
  print "a == b"
a,b=map(int,input().split())
    if a>9  | b>9:
      print(-1)
    else:
      print(a*b)
      

### FIXED CODE ###

a,b=map(int,input().split())
if a >= 10 or b >= 10:
  print(-1)
else:
  print(a*b)
s, w = map(int, input())
if w >= s:
    print('unsafe')
else:
    print('safe')

### FIXED CODE ###

s, w = map(int, input().split())
if w >= s:
    print('unsafe')
else:
    print('safe')
from sys import stdin
import sys
import math
from functools import reduce
import functools
import itertools
from collections import deque,Counter
from operator import mul
import copy
# ! /usr/bin/env python
# -*- coding: utf-8 -*-
import heapq

n = int(input())
h = [0] + list(map(int, input().split()))+[0]

INF = 10**15

dp = [INF]*(n+5)
dp[0] = 0
dp[1] = 0

@functools.lru_cache(None)
def cost(n):
    if n == 1:
        return 0
    elif n == 2:
        return(abs(h[2]-h[1]))
    else:
        ans = min([cost(n-1) + abs(h[n]-h[n-1]), cost(n-2) + abs(h[n]-h[n-2])])
        return ans

print(cost(n))

### FIXED CODE ###

from sys import stdin
import sys
import math
from functools import reduce
import functools
import itertools
from collections import deque,Counter
from operator import mul
import copy
# ! /usr/bin/env python
# -*- coding: utf-8 -*-
import heapq

n = int(input())
h = [0] + list(map(int, input().split()))

INF = 10**15

dp = [INF]*(n+5)
dp[0] = 0
dp[1] = 0
dp[2] = abs(h[2]-h[1])

for i in range(3,n+1):
    dp[i] = min([dp[i-2] + abs(h[i] - h[i-2]),dp[i-1] + abs(h[i] - h[i-1]) ])

print(dp[n])
N=int(input())
G=[[] for _ in range(N)]
for _ in range(N-1):
    a,b,c=map(int,input().split())
    a-=1
    b-=1
    G[a].append([b,c])
    G[b].append([a,c])
Q,K=map(int,input().split())
K-=1
dist=[-1 for _ in range(N)]
dist[K]=0
def dfs(G,x,dist):
    for p in G[x]:
        if dist[p[0]]!=-1:
            continue
        dist[p[0]]=dist[x]+p[1]
        dfs(G,p[0],dist)

dfs(G,K,dist)
for _ in range(Q):
    x,y=map(int,input().split())
    print(dist[x-1]+dist[y-1])


### FIXED CODE ###

N=int(input())
G=[[] for _ in range(N)]
for _ in range(N-1):
    a,b,c=map(int,input().split())
    a-=1
    b-=1
    G[a].append([b,c])
    G[b].append([a,c])
Q,K=map(int,input().split())
K-=1
dist=[-1 for _ in range(N)]
dist[K]=0
q=[K]
while len(q)>0:
    v=q.pop()
    for p in G[v]:
        nv=p[0]
        if dist[nv]!=-1:
            continue
        dist[nv]=dist[v]+p[1]
        q.append(nv)
for _ in range(Q):
    x,y=map(int,input().split())
    print(dist[x-1]+dist[y-1])
N = int(input())
S = input()
ans = 0
for i in range(N-2):
    if S[i] == "A" and S[i+1] == "B" and S[i+2] == "C":
        ans += 1
print(ans)

### FIXED CODE ###

k,x = map(int,input().split())

if k*500 >= x:
    print("Yes")
else:
    print("No")
n = int(input())
a = list(map(int,input().strip().split())
for i in range(n):
    key = a[i]
    j = i -1
    while j > 0 and a[j] > key:
        a[j+1] = a[j]
        j -= 1
    a[j+1] = key
    print(' '.join(map(str,a)))

### FIXED CODE ###

n = int(input())
lst = list(map(int,input().split()))
for i in range(n):
    key = lst[i]
    j = i-1
    while j >= 0 and lst[j] > key:
        lst[j+1] = lst[j]
        j -= 1
    lst[j+1] = key
    print(' '.join(map(str,lst)))
x, y=map(int, input().split())

res=100**x*y

if y=100:
	res=100**x*(y+1)

print(res)

### FIXED CODE ###

x, y=map(int, input().split())

res=100**x*y

if y==100:
	res=100**x*(y+1)

print(res)
#N = int( input() )
N, K = map(int, input().split())
#A = list(map(int, input().split()))

mod = 1000000000+7

z=0
for x = range(K, N+2):
  for y = range(x):
    z += (N-y) - y + 1
    z %= mod
#
print(z)


### FIXED CODE ###

N, K = map(int, input().split())
mod = 1000000000+7

z=0

zz = ((N-K+1)+N)*K//2 - (0+(K-1))*K//2 + 1
zz = zz % mod

for x in range(K+1, N+3):
#  print(zz)
  z = (z + zz) % mod
  zz += (N-x+1) - (x-1)
  zz = zz % mod
#
print(z)
x,y = input().split()
if x < y:
    print("<")
elif x > y:
    print(">")
else x == y:
    print("=")

### FIXED CODE ###

x,y = input().split(" ")
if x < y:
    print("<")
elif x > y:
    print(">")
else:
    print("=")
import numpy as np

xy = [list(map(int, input().split())) for _ in range(3)]
n = int(input())
num = [list(map(int, input().split())) for _ in range(n)]

def input_b(xy:list, num:int, result:list):
    for i in range(3):
        if num in xy[i]:
            for j in range(3):
                if num==xy[i][j]:
                    result[i][j]=1
    return result
  
def check_result(result:list):

    # 縦判定
    for i in range(3):
        if 3 == np.array(result[0]).sum():
            return "Yes" 

    if 3 in np.array(result[0]) + np.array(result[1]) + np.array(result[2]):
        return "Yes"

    if 3 == result[0][0] + result[1][1] + result[2][2]:
        return"Yes"
    
    return "No"

for i in num:
    result=input_b(xy,i[0],result)

print(check_result(result))

### FIXED CODE ###

import numpy as np
 
xy = [list(map(int, input().split())) for _ in range(3)]
n = int(input())
num = [list(map(int, input().split())) for _ in range(n)] 
result = [[0,0,0],[0,0,0],[0,0,0]]
 
def input_b(xy:list, num:int, result:list):
    for i in range(3):
        if num in xy[i]:
            for j in range(3):
                if num==xy[i][j]:
                    result[i][j]=1
    return result
  
def check_result(result:list):
    for i in range(3):
        if 3 == np.array(result[i]).sum():
            return "Yes" 
    if 3 in np.array(result[0]) + np.array(result[1]) + np.array(result[2]):
        return "Yes"
    if 3 == result[0][0] + result[1][1] + result[2][2]:
        return"Yes"
    if 3 == result[0][2] + result[1][1] + result[2][0]:
        return"Yes"
    return "No"
 
for k in num:
    result=input_b(xy,k[0],result)
 
print(check_result(result))