Harryxun/stf_run huggingface dataset:
# -*- coding: utf-8 -*-
N = int(input())
a_list = []
for i in range(N):
    a_list.append(int(input()))
color_counter = 0
while len(a_list) > 0:
    color_counter += 1
    compare_a = a_list.pop(0)
    for idx, ite in enumerate(a_list[:]):
        if compare_a < ite:
            compare_a = a_list.pop(idx)
    
print(color_counter)

### FIXED CODE ###

# -*- coding: utf-8 -*-
from bisect import bisect_right, bisect_left
N = int(input())
a_list = [int(input()) for _ in range(N)]

color_list = [1]
for a in a_list:
    a *= -1
    index = bisect_right(color_list, a)
    if index < len(color_list):
        color_list[index] = a
    else:
        color_list.append(a)
#     print(color_list, a)
print(len(color_list))
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
A.sort()
B.sort()
C.sort()
#A < B < C
def sarch(i, left, right, x, y):
    mid = (right + left) // 2
    if right - left < 10:
        return left, right
    elif x[i] <= y[mid]:
        sarch(i, left, mid, x, y)
    elif y[mid] <= x[i]:
        sarch(i, mid, right, x, y)
cnt_a = [0 for i in range(N)]
cnt_b = [0 for i in range(N)]


for i in range(N):
    sg = sarch(i, 0, N - 1, B, C)
    s = sg[0]
    g = sg[1]
    ans = -1
    for j in range(s, g + 1):
        if B[i] < C[j]:
            ans = 1
            break
    if ans == -1:
        j = N
    cnt_b[i] = N - j
ans_2 = 0    
for i in range(N):
    sg = sarch(i, 0, N - 1, A, B)
    s = sg[0]
    g = sg[1]
    ans = -1
    for j in range(s, g + 1):
        if A[i] < B[j]:
            ans = 1
            break
    if ans == 1:
        for k in range(j, N):
            ans_2 += cnt_b[k]
    cnt_a[i] = N - j
print(ans_2)


### FIXED CODE ###

import bisect

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

cnt = 0
cnt_b = []
for i_b in range(n):
    # if max(c) < b[i_b]:
    #     cnt_b.append(0)
    #     continue
    i_a = bisect.bisect_left(a, b[i_b]) - 1
    i_c = bisect.bisect_right(c, b[i_b])
    if i_a < 0 or n <= i_c:
        continue
    cnt += (i_a + 1) * (n - i_c)
    # print(i_a, i_b, i_c)

print(cnt)
import sys

input=sys.stdin.buffer.readline


#sys.setrecursionlimit(10**9)
#from functools import lru_cache

def RD(): return sys.stdin.read()


def II(): return int(input())


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


def MF(): return map(float,input().split())


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


def LF(): return list(map(float,input().split()))


def TI(): return tuple(map(int,input().split()))


# rstrip().decode('utf-8')

import numpy as np

def main():
	n,m,x=MI()
	C=[]
	A=[]
	for _ in range(n):
		c_,*A_=LI()
		C.append(c_)
		A.append(A_)
	A=np.array(A)
	
	ans=10**10
	
	for i in range(1<<n):
		B=np.zeros(m)
		cnt=0
		for j in range(n):
			if 1<<j&i:
				cnt+=C[j]
				B+=A[j]
		if np.min(B)>=x:
			ans=min(ans,cnt)
	print(ans if ans!=10**10 else -1)
	





if __name__=="__main__":
	main()


### FIXED CODE ###

import sys

input=sys.stdin.buffer.readline


#sys.setrecursionlimit(10**9)
#from functools import lru_cache

def RD(): return sys.stdin.read()


def II(): return int(input())


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


def MF(): return map(float,input().split())


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


def LF(): return list(map(float,input().split()))


def TI(): return tuple(map(int,input().split()))


# rstrip().decode('utf-8')

import numpy as np

def main():
	n,m,x=MI()
	C=[]
	A=[]
	for _ in range(n):
		c_,*A_=LI()
		C.append(c_)
		A.append(A_)
	A=np.array(A)
	
	ans=10**10
	
	for i in range(1<<n):
		B=np.zeros(m)
		cnt=0
		for j in range(n):
			if 1<<j&i:
				cnt+=C[j]
				B+=A[j]
		if np.min(B)>=x:
			ans=min(ans,cnt)
	print(ans if ans!=10**10 else -1)
	





if __name__=="__main__":
	main()
(n, m) = [int(i) for i in input().split()]

A = [[]]
b = []


for i in range(n):
    A.append([int(j) for j in input().split()])

for i in range(m):
    b.append(int(input())


for i in range(n):
    c = 0
    for j in range(m):
         c += A[i][j] * b[j]
    print(c)

### FIXED CODE ###

(n, m) = [int(i) for i in input().split()]

A = []
b = []


for i in range(n):
    A.append([int(j) for j in input().split()])

for i in range(m):
    b.append(int(input()))


for i in range(n):
    c = 0

    for j in range(m):
         c += A[i][j] * b[j]

    print(c)
n = int(input())

total = 0
for i in range(1, n+1):
  if i%2==0: continue
  cnt = 0
  for j in range(1, j+1):
    if i%j ==0: cnt+=1
  
  if cnt==8:
    total += 1

print(total)

### FIXED CODE ###

n = int(input())
 
total = 0
for i in range(1, n+1):
  if i%2==0: continue
  cnt = 0
  for j in range(1, n+1):
    if i%j ==0: cnt+=1
  
  if cnt==8:
    total += 1
 
print(total)
nums =  list(map(int, input().split()))
 
max_num = max(nums)
min_num = max(nums)
two = [max_num, min_num]
mid_num = list(set(nums) - set(two))
 
two_num = str(max_num) + str(mid_num[0])
print(int(two_num) + min_num)

### FIXED CODE ###

num = list(map(int, input().split()))
num.sort(reverse=True)
print(num[0] * 10 + num[1] + num[2])
a=0
S=input()
T=input()
for i in 3:
	if S[i]==T[i]:
    	a=a+1
	else:
    	a=a
        
print(a)

### FIXED CODE ###

S=input()
T=input()
a=0
for i in range(3):
    if S[i]==T[i]:
        a=a+1
    else:
        a=a+0
print(a)
import numpy as np
n = int(input())
SP=[]
SPs=[]
for i in range(n):
    SP=[i]
    for j in input().split():
        SP.append(j)
    SPs.append(SP)

SPs=np.array(SPs)
SPs2=SPs[SPs[:,2].astype(int).argsort()[::-1],:]
SPs3=SPs2[SPs2[:,1].argsort(),:][:,0]

for i in range(n):
    print(int(SPs3[i])+1)


### FIXED CODE ###

import numpy as np
n = int(input())
SP=[]
SPs=[]
for i in range(n):
    SP=[i]
    for j in input().split():
        SP.append(j)
    SPs.append(SP)
SPs=np.array(SPs)

SPs2=SPs[SPs[:,2].astype(int).argsort(kind="mergesort")[::-1],:]
SPs3=SPs2[SPs2[:,1].argsort(kind="mergesort"),:][:,0]

for i in range(n):
    print(int(SPs3[i])+1)
def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k 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 *= int(numerator[k])

    return result

nCr = {}
def combination(n, r):
    if r == 0 or r == n: return 1
    if r == 1: return n
    if (n,r) in nCr: return nCr[(n,r)]
    nCr[(n,r)] = cmb(n-1,r) + cmb(n-1,r-1)
    return nCr[(n,r)]

N, K = map(int, input().split())
# D = 0
# for i in range(K+1)[1::]:
#     if i == 1:
#         A = combination(N-K+1, 1)
#         print(A % (10**9+7))
#         D += A
#     else:
#         A = combination(N-K+i, i)
#         P = combination(K-1, i-1)
#         B = (A - D) * P
#         print(B % (10**9+7))
#         D += B
for i in range(K+1)[1::]:
    if i == 1:
        A = combination(N-K+1, 1)
        print(A % (10**9+7))
    else:
        A = combination(N-K+1, i)
        P = combination(K-1, i-1)
        B = A * P
        if B > 10*9 + 7:
			print(B % (10**9+7))
		else:
			print(B)


### FIXED CODE ###

import sys
sys.setrecursionlimit(10000)

nCr = {}
def combination(n, r):
    if r == 0 or r == n: return 1
    if r == 1: return n
    if (n,r) in nCr: return nCr[(n,r)]
    nCr[(n,r)] = combination(n-1,r) + combination(n-1,r-1)
    return nCr[(n,r)]

N, K = map(int, input().split())
for i in range(1, K+1):
	if i <= N-K+1:
		A = combination(N-K+1, i)
		P = combination(K-1, i-1)
		B = A * P
		print(B % (10**9+7))
	else:
		print(0)
a,b = map(int(input().split()))

a = 14 if a == 1 else a
b = 14 if b == 1 else b

if a > b:
    print("Alice")
elif a < b:
    print("Bob")
else:
    print("Draw")

### FIXED CODE ###

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

a = 14 if a == 1 else a
b = 14 if b == 1 else b

if a > b:
    print("Alice")
elif a < b:
    print("Bob")
else:
    print("Draw")
import math

n, k = map(int, input().split(' '))
l = map(int, input().split(' '))
pos = []
neg = []


for i in l:
	if i >= 0:
		pos.append(i)
	else:
		neg.append(i)

p = 0
n = 0
pos = sorted(pos)[::-1]
neg = sorted(neg)

answer = []
placeholder = -1

if k % 2 == 1:
	if len(pos) > 0:
		placeholder = pos.pop()
	else:
		placeholder = -2
		neg = neg[::-1]
	k -= 1

pos.append(0)
pos.append(0)
neg.append(0)
neg.append(0)

for i in range(k//2):
	if pos[p+0] * pos[p+1] > neg[n+0] * neg[n+1]:
		answer.append(pos[p+0])
		answer.append(pos[p+1])
		p += 2
	else:
		answer.append(neg[n+0])
		answer.append(neg[n+1])
		n += 2

if placeholder == -2:
	answer.append(neg[n])
elif placeholder != -1:
	if pos[p] > n:
		placeholder = pos[p]
	answer.append(placeholder)

s = 1
for i in answer:
	s *= i
print(s % 1000000007)

### FIXED CODE ###

n, k = map(int, input().split(' '))
l = map(int, input().split(' '))

s = 1
if n == k:
	for i in l:
		s *= i
		s %= 1000000007
	print(s)
else:
	pos = []
	neg = []

	for i in l:
		if i >= 0:
			pos.append(i)
		else:
			neg.append(i)

	pos.sort()
	neg.sort(reverse=True)
	answer = []

	if k % 2 == 1 and not pos:
		for i in range(k):
			s *= neg[i]
			s %= 1000000007
		print(s)

	else:
		if k % 2 == 1:
			s = pos.pop()
		for i in range(k//2):
			if len(pos) >= 2:
				answer.append(pos.pop()*pos.pop())
			else:
				break
		for i in range(k//2):
			if len(neg) >= 2:
				answer.append(neg.pop()*neg.pop())
			else:
				break
		answer.sort(reverse=True)
		for i in range(k//2):
			s *= answer[i]
			s %= 1000000007
		print(s)
n = input()
a = []
for i in range(n):
  M.append(map(int, raw_input().split()))
for i in range(n):
  for j in range(n):
    if M[i][j]==-1:
      M[i][j] = 1000000000
d = [1000000000 for i range(n)]
p = [-1 for i in range(n)]
color = [0 for i in range(n)]

d[0] = 0

while 1:
  minv = 1000000000
  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]!=1000000000:
      if d[v]>M[u][v]:
        d[v] = M[u][v]
        p[v] = u
        color[v] = 1

sum = 0
for i in range(n):
  if p[i]!=-1:
    sum += M[i][p[1]]
print sum

### FIXED CODE ###

n = input()
M = []
inf = 1000000000
for i in range(n):
  M.append(map(int, raw_input().split()))
for i in range(n):
  for j in range(n):
    if M[i][j]==-1:
      M[i][j] = inf
d = [inf for i in range(n)]
p = [-1 for i in range(n)]
color = [0 for i in range(n)]

d[0] = 0

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]>M[u][v]:
        d[v] = M[u][v]
        p[v] = u
        color[v] = 1

sum = 0
for i in range(n):
  if p[i]!=-1:
    sum += M[i][p[i]]
print sum
num = input()
num = int(num)

#2の2乗から順番に見ていく
#入力を超えたらその時点の値をマックスとして保持
#更新していく
max = 0
if num < 4:
    print("1")
else:
    for i in range(2,num):
        beki = 2
        cou = i**beki
        while i**beki <= num:
            beki += 1
        if max < i ** (beki-1):
            if beki > 2:
                max = i ** (beki-1)
    print(max)

### FIXED CODE ###

import math
line = input()
line1 = line.split(" ")

#for i in line1:
  #  line1[i] = int(i)

adis = line1[0]
bdis = line1[1]
cdis = line1[2]
count = line1[3]

AB = abs(abs(int(bdis)) - abs(int(adis)))
BC = abs(abs(int(cdis)) - abs(int(bdis)))
#AB = abs(AB)


if int(AB) <= int(count) and int(BC) <= int(count):
    print("Yes")
elif abs(abs(int(cdis)) - abs(int(adis))) <= int(count):
    print("Yes")
else:
    print("No")
import sys
import itertools
 
 
N, K = map(int, input().split())

nums = [ ]
for _ in range(N):
    _ =  int(input())
    nums.extend([int(x.strip()) for x in input().split(' ') ])

print(N - len(set(nums)))

### FIXED CODE ###


import sys
import itertools
 
 
N, K = map(int, input().split())

nums = [ ]
for _ in range(K):
    _ =  int(input())
    nums.extend([int(x.strip()) for x in input().split(' ') ])

print(N - len(set(nums)))
num_array = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51
]
print(num_array[int(input() - 1])

### FIXED CODE ###

num_array = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51
]
print(num_array[int(input()) - 1])
import math

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

A=sorted(A)
maxA=max(A)
limit=math.ceil(maxA/2)
comb=min(A)
for i in range(N):
    if(limit<A[i]):
        if(abs(limit-A[i+1])<abs(limit-A[i])):
            comb=A[i+1]
    comb=A[i]

print(maxA,comb)

### FIXED CODE ###

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

A=sorted(A)
maxA=max(A)
limit=maxA/2
tmp=10**9
for i in range(N):
    if(abs(limit-A[i])<tmp):
        tmp=abs(limit-A[i])
        comb=A[i]
    else:
        break

print(maxA,comb)
a,b,c,d = map(int,input().split())
import fractions
s1 = b//c
s2 = (a-1)//c
p1 = b//d
p2 = (a-1)//d
e = c*d//math.gcd(c,d)
q1 = b//e
q2 = (a-1)//e
print(b-a+1-(s1+p1-s2-p2-q1+q2))

### FIXED CODE ###

a,b,c,d = map(int,input().split())
import fractions
s1 = b//c
s2 = (a-1)//c
p1 = b//d
p2 = (a-1)//d
e = c*d//fractions.gcd(c,d)
q1 = b//e
q2 = (a-1)//e
print(b-a+1-(s1+p1-s2-p2-q1+q2))
# input
N = int(input())
a = [int(input()) for _ in range(N)]

# 4の倍数, 奇数の数
i, j = 0, 0

for i in range(N):
    if a[i] % 4 == 0:
        i += 1
    elif a[i] % 2 == 1:
        j += 1

if j >= i + 2:
    print('No')
else:
    print('Yes')

### FIXED CODE ###

# input
N = int(input())
a = list(map(int, input().split()))

# 4の倍数, 4の倍数でない偶数, 奇数の数
i, j, k = 0, 0, 0

for n in range(N):
    if a[n] % 4 == 0:
        i += 1
    elif a[n] % 2 == 0:
        j += 1
    else:
        k += 1

if k >= i + 2:
    print('No')
elif k == i + 1 and j >= 1:
    print('No')
else:
    print('Yes')
import math

n = int(input())
s = input()
S = [ord(i) - 97 for i in s]
q = int(input())
HEIGHT = math.ceil(math.log(n) / math.log(2))
SIZE = 1 << HEIGHT

def build_tree_for_letter(letter):
    tree = [False for _ in range(2 << HEIGHT)]
    for i in range(1 << HEIGHT):
        tree[i + (1 << HEIGHT)] = True if i < n and s[i] == chr(97 + letter) else False

    for i in range(HEIGHT - 1, -1, -1):
        for x in range(1<<i, 2<<i):
            tree[x] = any((tree[x<<1], tree[(x<<1)+1]))

    return tree


def build():
    return [build_tree_for_letter(letter) for letter in range(26)]



def update(x, letter, positive=True):
    trees[letter][x] = (positive == True)
    while x > 1:
        x >>= 1
        trees[letter][x] = any((trees[letter][x << 1], trees[letter][(x << 1) + 1]))


def query(ll, rr):

    # print("query: ", l, r)
    total = 0
    for letter in range(26):
        l, r = ll, rr
        is_letter = False
        while l < r:
            if l%(2) != 0:
                is_letter = any((is_letter, trees[letter][l]))
                l += 1
            l >>= 1
            if r%(2) != 0:
                r -= 1
                is_letter = any((is_letter, trees[letter][r]))
            r >>= 1
        total += is_letter
    return total



trees = build()

for i in range(q):
    a, b, c = input().split()
    b = int(b) - 1 + SIZE
    if int(a) == 1:
        c = ord(c) - 97
        update(b, S[b], positive=False)
        S[b] = c
        update(b, c, positive=True)
    else:
        print(query(b, int(c)+SIZE))








### FIXED CODE ###

import math

n = int(input())
s = input()
S = [ord(i) - 97 for i in s]
q = int(input())
HEIGHT = math.ceil(math.log(n) / math.log(2))
SIZE = 1 << HEIGHT

def build_tree():
    tree = [0 for _ in range(SIZE<<1)]

    for i, letter in enumerate(s):
        tree[i+SIZE] = 1<<(ord(letter)-97)

    for i in range(HEIGHT - 1, -1, -1):
        for x in range(1<<i, 2<<i):
            tree[x] = tree[x<<1] | tree[(x<<1)+1]

    return tree




def update(x, number):
    tree[x] = number
    while x > 1:
        x >>= 1
        tree[x] = tree[x << 1] | tree[(x << 1) + 1]


def query(l, r):
    total = 0
    while l < r:
        if l&1:
            total |= tree[l]
            l += 1
        l >>= 1
        if r&1:
            r -= 1
            total |= tree[r]
        r >>= 1
    return bin(total).count('1')



tree = build_tree()

for i in range(q):
    a, b, c = input().split()
    b = int(b) - 1
    if int(a) == 1:
        update(b + SIZE, S[b])
        c = 1 << (ord(c) - 97)
        S[b] = c
        update(b + SIZE, c)
    else:
        print(query(b + SIZE, int(c)+SIZE))
li = list(map(int,input().split()))
a = li[0]
e = li[4]
k = li[5]

if e - a < k:
    print("Yay!")
else:
    print(":(")

### FIXED CODE ###

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

if e - a <= k:
    print("Yay!")
else:
    print(":(")
import sys
inputs = sys.stdin.readlines()

n = int(inputs[1])
Y = []
for s in inputs[1:]:
    x, l = map(int, s.split())
    Y.append((x-l, x+l))
Y.sort(key=lambda x: x[0])

cnt = 1
_, r0 = Y[0]
for i in range(1, n):
    l, r = Y[i]
    if r0 <= l:
        cnt += 1
        r0 = r
    
print(cnt)

### FIXED CODE ###

import sys
inputs = sys.stdin.readlines()

n = int(inputs[0])
Y = []
for s in inputs[1:]:
    x, l = map(int, s.split())
    Y.append((x-l, x+l))
Y.sort(key=lambda x: x[1])

cnt = 1
_, r0 = Y[0]
for i in range(1, n):
    l, r = Y[i]
    if r0 <= l:
        cnt += 1
        r0 = r
    
print(cnt)
N = int(input())
A = list(map(int,input().split()))
A.sort()

flag = 0
i = 1
while flag == 0:
    if A[i] % A[0] != 0:
        A[i] = A[i] % A[0]
        A.sort()
        i = 1
    else:
        i += 1
    if i == N-1:
        flag = 1
        print(A[0])

### FIXED CODE ###

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

flag = 0
i = 1
while flag == 0:
    if A[i] % A[0] != 0:
        A[i] = A[i] % A[0]
        A[i],A[0] = A[0],A[i]
        i = 1
    else:
        i += 1
        if i == N:
            flag = 1
            print(A[0])
            exit()
#!/usr/bin/env python3

import collections

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

c = collections.Counter(A)
values, counts = c.keys(), c.values()

ans = 0
for i in range(len(values)):
    tmp = counts[i]
    ans += (tmp * (tmp-1))//2

for i in range(N):
    num = A[i]
    index = values.index(num)
    print(ans - counts[index] + 1)


### FIXED CODE ###

#!/usr/bin/env python3

import collections

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

c = collections.Counter(A)
values = c.keys()
counts = c.values()

subs = {}
a_sum = 0
for v, c in zip(values, counts):
    subs[v] = c
    a_sum += (c * (c-1)) // 2

for i in range(N):
    print(a_sum - subs[A[i]] + 1)
N=int(input())
lamps=[]
for a in range(N):
    _=int(input())
    lamps.append(_)
lamps.insert(0,"aaa")

PressedButtons=[False]*N

a=1
count=0

while True:
    if PressedButtons[a]==False:
        PressedButtons[a]=True
        count+=1
        a=lamps[a]
        if a==2:
            print(count)
            exit()
    # elif PressedButtons[a]==True:
    #     print("-1")
    #     exit()
    # else:
    #     print("-1")
    #     exit()
print("-1")

### FIXED CODE ###

N=int(input())
lamps=[]
for a in range(N):
    _=int(input())
    lamps.append(_)
lamps.insert(0,"aaa")

PressedButtons=[False]*int(N+1)

a=1
count=0

if lamps.count(2)==0:
    print("-1")
    exit()

while PressedButtons[a]==False :
    PressedButtons[a]=True
    count+=1
    a=lamps[a]
    if a==2:
        print(count)
        exit()
print('-1')
n = int(input())
lis = list(map(int,input().split()))
li = lis[::2]
l = lis[1::2]

if n % 2 == 0:
  l = l[::-1]
  ans = l+li
  print(" ".join(ans))
else:
  li = li[::-1]
  ans = li+l
  print(" ".join(ans))

### FIXED CODE ###

n = int(input())
lis = []
li = list(map(str,input().split()))
if n % 2 == 0:
    b = li[1::2]
    for m in range(n//2):lis.append(b[-(m + 1)])
    print(" ".join(lis[::] + li[::2]))
else:
    b = li[::2]
    for m in range((n//2)+1):lis.append(b[-(m + 1)])
    print(" ".join(lis[::]+li[1::2]))
s = input().split()

if s.find("5") == 2 and s.find("7") == 1:
  print("YES")
else:
  print("NO")

### FIXED CODE ###

s = input().split()

if s.count("5") == 2 and s.count("7") == 1:
  print("YES")
else:
  print("NO")
N, Q = map(int, input().split())
2 S = input()
3 t = [0] * (N + 1)
4 for i in range(N):
5 t[i + 1] = t[i] + (1 if S[i : i + 2] == 'AC' else 0)
6 for i in range(Q):
7 l, r = map(int, input().split())
8 print(t[r-1] - t[l-1])

### FIXED CODE ###

N, Q = map(int, input().split())
S = input()
t = [0] * (N + 1)
for i in range(N):
    t[i + 1] = t[i] + (1 if S[i : i + 2] == 'AC' else 0)
for i in range(Q):
    l, r = map(int, input().split())
    print(t[r-1] - t[l-1])
k = int(input())
i = 1 #数回す用
c = 0 #ルンルン数カウント

if k > 13000:
    i = 34454557
    c = 13000

while c < k:
  j = str(i)
  if i < 13: #13未満なら
    c = c + 1 #ルンルン数
    #print(c, i)
  else: #それ以外なら
    x = 0
    for n in range(len(j)-1): #ルンルン数判定を行う
      if abs(int(j[n]) - int(j[n+1])) > 1:#桁の差が1より大きかったら
        x = 1
        break
    if x == 0:
      c = c + 1
      #print(c, i)
  i = i + 1 #iに1を足す

print(i-1)

### FIXED CODE ###

x, y ,z = map(int,input().split())
 
print(z, x, y)
import numpy as np
n, k = map(int, input().split())
a = [int(input()) for x in range(n)]
a.sort()
a = np.array(a)
print(np.min(a[k - 1:] - a[:k]))


### FIXED CODE ###

import numpy as np
n, k = map(int, input().split())
a = [int(input()) for x in range(n)]
a.sort()
a = np.array(a)
print(np.min(a[k - 1:] - a[:n - k + 1]))
from collections import deque

s = deque(list(input()))
q = int(input())

for i in range(q):
    que = input().split()
    if que[0] == 1:
        S.reverse()
        
    else:
        if que[1]==1:
            S.appendleft(que[-1])
        else: S.append(que[-1])
        
ans = "".join(S)
print(ans)


### FIXED CODE ###

# import bisect
# import heapq
# from copy import deepcopy
from collections import deque
# from collections import Counter
# from itertools import accumulate
# from itertools import permutations
# import numpy as np
# import math

# n, k = map(int, input().split())
# a = list(map(int, input().split()))
s = deque(input())
q = int(input())
rev = False
for i in range(q):
    que = input()
    if que[0] == '1':
        rev = not rev
    else:
        que = list(que.split())
        if (int(que[1])==1 and not rev) or (int(que[1])==2 and rev):
            s.appendleft(que[2])
        else:
            s.append(que[2])

if rev: ans = ''.join(reversed(s))
else: ans = ''.join(s)
print(ans)
n=int(input())
nums=[]
for i in range(n):
    nums.append(int(input()))
count=0
for i in range(n):
    for j in range(2,int(sqrt(nums[i])+1)):
        if nums[i]%j==0:
            break
    count+=1
print(count)


### FIXED CODE ###

from math import sqrt
n = int(input())
ans = 0
for i in range(n):
    x = int(input())
    ok = 1
    for z in range(2, int(sqrt(x))+1):
        if x % z == 0:
            ok = 0
            break
    ans += ok
print(ans)
for i in range(107, 200, 2):
    divisors = []
    for j in range(1, 201):
        if i%j == 0:
            divisors.append(j)
    if len(divisors) == 8:
        divisors_8.append(i)

n = int(input())

divisors_8.append(n)
divisors_8.sort()
result = divisors_8.index(n)

if n not in divisors_8:
    print(result)
else:
    print(result+1)

### FIXED CODE ###

divisors_8 = [105]

for i in range(107, 200, 2):
    divisors = []
    for j in range(1, 201):
        if i%j == 0:
            divisors.append(j)
    if len(divisors) == 8:
        divisors_8.append(i)

n = int(input())

divisors_8.append(n)
divisors_8.sort()
result = divisors_8.index(n)
divisors_8.remove(n)

if n not in divisors_8:
    print(result)
else:
    print(result+1)