peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
if input().count('9'):
  print('Yes')
else:
  print('No')
# Judge status: Wrong Answer
s=input()
t=input()
slist=[]
tlist=[]
for i in s:
  slist.append(i)
slist.sort()
for i in t:
  tlist.append(i)
tlist.sort()
if slist==tlist:
  print('Yes')
else:
  print('No')
# Judge status: Wrong Answer
n, r = list(map(int, input().split()))
if n >= 10:
    print(r)
else:
    print(r - 100 * (10 - n))
# Judge status: Accepted
n=int(input())
if n%2==0:
    print(n//2)
else:
    print(n//2 + 1)
# Judge status: Accepted
n,k=map(int,input().split())
a=list(map(int,input().split()))

for i in range(1,10**5+1):
  if i>=n:
    p=str(i)
    ch=0
    for y in range(len(p)):
      if int(p[y]) in a:
        ch+=1
    if ch==0:
      print(i)
      break
# Judge status: Accepted
# Written by Shagoto

s = input()
s = s.replace(s[0], "")

if(len(s) == 2):
    s = s.replace(s[0], "")
    if(len(s) == 0):
        print("Yes")
    else:
        print("No")
else:
    print("No")
# Judge status: Accepted
import random
d = int(input()) #365
c = list(map(int, input().split())) # 26個
s = [list(map(int, input().split())) for _ in range(d)]

#output
t = [random.randint(1,26) for _ in range(d)]
for i in range(d):
    print(t[i])
# Judge status: Accepted
N = int(input())
ls = list(map(int,input().split()))
import collections
c = collections.Counter(ls)
unique_ls = list(reversed(sorted(([i[0] for i in c.items() if i[1] >= 2]))))

if len(unique_ls) >=2:
  if ls.count(unique_ls[0]) >=4:
    print(unique_ls[0]**2)
  else:
    print(unique_ls[0]*unique_ls[1])
elif len(unique_ls) ==1:
  if ls.count(unique_ls[0]) >=4:
    print(unique_ls[0]**2)
  else:
    print(0)
else:
  print(0)
# Judge status: Wrong Answer
import math
S = int(input())
n = S // 3
ans = -1
for k in range(1, n + 1):
  ans = ans + math.factorial(S - 2 * k + 1)/(math.factorial(k - 1) * math.factorial(S - k + 2))
print(ans)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

max_count = sum(B) - sum(A)

count1, count2 = 0, 0

for i in range(N):
  if A[i] > B[i]:
    count1 += A[i] - B[i]
  else:
    count2 += (B[i] - A[i]) // 2
    if (B[i] - A[i]) % 2 == 1:
      count2 += 1
      
if count1 <= max_count:
  if count2 <= max_count:
    print("Yes")
    quit()
print("No")
# Judge status: Accepted
import math
a,b,x=map(int,input().split())
Q=x/a
if Q>a*b/2:
    s=a*b-Q
    Ans=math.degrees(math.atan2(2*s,a**2))
else:
    Ans=90-math.degrees(math.atan2(2*Q,b**2))
print(Ans)
# Judge status: Wrong Answer
numbers = [int(s) for s in input().split()] #0:赤, 1:緑, 2:青
K = int(input())
for i in range(K):
    if(numbers[2] < numbers[0]):
        numbers[2] *= 2
        
    elif(numbers[1] < numbers[0]):
        numbers[1] *= 2
        
    elif(numbers[2] < numbers[1]):
        numbers[2] *= 2
        
    else:
        break
if(numbers[1] > numbers[0] and numbers[2] > numbers[1]):
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
w =str(input())

length = len(w)
z = sorted(w)
i=1
m=0
   
if length%2 == 1:
    m = 1
    pass
else:
    while i < length:        
        if z[i]==z[i-1]:
            i += 2
        else:
            m = 1
            break
        
if m == 1:
    print("NO")
else:
    print("YES")
# Judge status: Accepted

def main():
    n = int(input())
    c = input()
    r = c.count('R')
    w = c.count('W')
    ropt = c[:r].count('R')
    wopt = c[r:].count('W')

    rnot = r - ropt
    wnot = w - wopt

    return min(rnot,wnot)
    
 
if __name__ == '__main__':
    print(main())
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
mod=1000000007
sum_a=sum(a)

ans=0
for i in range(n):
    temp=(sum_a-a[i])*a[i]

    ans+=temp
print((ans//2)%mod)
# Judge status: Accepted
N, K = map(int, input().split())

i = 0
while True:
    if N < K**i:
        print(i)
        exit()
    i += 1
# Judge status: Accepted
N = int(input())
cards = 0
pairs = 0
for _ in range(N):
	A = int(input())
	if A:
		cards += A
	else:
		pairs += cards//2
		cards = 0
pairs += cards//2
print(pairs)
# Judge status: Wrong Answer
from bisect import bisect
from itertools import accumulate
n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
a = list(accumulate(a))
b = list(accumulate(b))
ans = 0
for i in range(n):
    if a[i] > k:
        break
    ans = max(ans, i+1+bisect(b, k-a[i]))
print(ans)
# Judge status: Accepted
from math import factorial


def cmb(n,r):
    return factorial(n)//(factorial(n-r)*factorial(r))


n,p=map(int,input().split())
A=list(map(int,input().split()))
A=[A[i]%2 for i in range(n)]

cnt=A.count(0)
ans=0
for i in range(p,n-cnt+1,2):
    ans +=cmb(n-cnt,i)
print(ans*(2**cnt))
# Judge status: Accepted
N, K = map(int, input().split())
digits = 0
while(N > 0):
    N = N//K
    digits = digits+1
print(digits)
# Judge status: Accepted
from itertools import accumulate
from bisect import bisect

n, m, k = map(int, input().split())
a = [*accumulate(map(int, input().split()), initial=0)]
b = [*accumulate(map(int, input().split()), initial=0)]
print(max(i - 1 + bisect(b, k - x) for i, x in enumerate(a) if x <= k))
# Judge status: Accepted
import sys
stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

n = ni()
a = na()

import numpy as np
a = list(np.cumsum(a))

ans = 100000000000000000

for i in range(n-1):
    ans = min(ans, abs(a[-1]-a[i]*2))

print(ans)
# Judge status: Wrong Answer
import itertools
N,M,Q = map(int,input().split())
T=[tuple(map(int,input().split())) for _ in range(Q)]
ans=0
for v in itertools.combinations(range(1,M+1),N):
  tmp=0
  for a,b,c,d in T:
    if v[b-1]-v[a-1]==c:
      tmp+=d
  ans=max(ans,tmp)
print(ans)
# Judge status: Wrong Answer
a,b=map(int,input().split())
product=a*b
if product%2==0:
  print("even")
else:
  print("odd")
# Judge status: Accepted
N = int(input())
L = list(map(int,input().split()))

l = max(L)
L.remove(l)
if l < sum(L):
    print("Yes")
else:
    print("No")
# Judge status: Accepted
N,  K = map(int, input().split())
if N % K == 0:
  print(0)
else:
  print(1)
# Judge status: Accepted
X = int(input())
res = [3, 5, 7]
print('YES' if X in res else 'NO')
# Judge status: Accepted
a,b,c=map(int, input().split())
if b-a==c-b:
    print('YES')
else:
    print('NO')
# Judge status: Accepted
n = int(input())

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

ans = 0

for j in range(61):
    one = 0
    zero = 0
    for i in a:
        if (i >> j) & 1 == 1:
            one += 1
        else:
            zero += 1
    ans += one*zero*2**j
    ans %= 10**9 + 7

print(ans)
# Judge status: Accepted
S = input()
ans = 10**10
for i in range(len(S)-2):
  n = int(S[i:i+3])
  ans = min(ans, abs(n-753))
print(ans)
# Judge status: Accepted
a, b, c = map(int, input().split())
abc = sorted([a, b, c])
even = 0
for i in abc:
    if i % 2 == 0:
        even += 1
ans = 0
if even == 0 or even == 3:
    ans = (abc[2] - abc[0]) // 2 + (abc[2] - abc[1]) // 2
elif even == 1:
    abc = [i + 1 if i % 2 == 1 else i for i in abc]
    ans = (abc[2] - abc[0]) // 2 + (abc[2] - abc[1]) // 2 + 1
else:
    abc = [i + 1 if i % 2 == 0 else i for i in abc]
    ans = (abc[2] - abc[0]) // 2 + (abc[2] - abc[1]) // 2 + 1

print(ans)
# Judge status: Accepted
def resolve():
    N, x = [int(i) for i in input().split()]
    A = sorted([int(i) for i in input().split()])
    sumA = 0
    cnt = 0
    for i in range(N):
        if A[i] <= (x - sumA):
            sumA += A[i]
            cnt += 1
        else:
            break
    else:
        if sumA != x:
            cnt -= 1
    print(cnt)


resolve()
# Judge status: Wrong Answer
A, B, C = map(int, input().split())
for i in range(1, 10000):
    if ((B*i)+C)%A==0:
        count=1
        break
    else:
        count=0
print("No" if count==0 else "Yes")
# Judge status: Accepted
s = input()
ans = 1
l = s[0]
cnt = 0
l_cnt = 0
for char in s[1:]:
    if (char == l and cnt == 0 and l_cnt== 0):
        cnt += 1
        continue
    else:
        l_cnt = cnt
        cnt = 0
        l = char
        ans += 1
print(ans)
# Judge status: Accepted
N,M = map(int,input().split())


if N ==1 and M == 1:
  print(1)
elif N == 1 or M == 1:
  print((N -2)*(M -2)*(-1))
else:
  print((N-2)*(M-2))
# Judge status: Accepted
N,Q = (int(X) for X in input().split())
S = input()
T = [0]*(N+1)
for I in range(0,N):
     T[I+1] = T[I] + (S[I:I+2]=='AC')
for J in range(0,Q):
    L,R = (int(X)-1 for X in input().split())
    print(T[R]-T[L])
# Judge status: Accepted
X,Y = map(int,input().split())
M = 10**9+7
if X%3 == Y%3 == 1 or X%3 == Y%3 == 2:
    Answer = 0
else:
    dif = abs(X-Y)
    W =  (min(X,Y) - dif)//3
    X1 = W + dif
    Y1 = W
    Answer = 1
    N = X1+Y1
    for i in range(1,X1+1):
        Answer = (Answer*(N)*pow(i,-1,M))%M
        N -= 1
    for j in range(1,Y1+1):
        Answer = (Answer*(N)*pow(j,-1,M))%M
        N -= 1
print(Answer)
# Judge status: Wrong Answer
n = int(input())
 
x = []
y = []
distance = []
 
for i in range(n):
  x1, y1 = input().split()
  x1 = int(x1)
  y1 = int(y1)
  x.append(x1)
  y.append(y1)
 
for i in range(len(x)-1):
  temp = abs(x[i] - x[1+i]) + abs(y[i] - y[1+i])
  distance.append(temp)

max = distance[0]
 
for i in range(1,len(distance)-1):
  if distance[i] >= max:
    max = distance[i]
 
print(max)
# Judge status: Accepted
a = [list(map(int, input().split())) for _ in range(3)]
n = int(input())
b = [int(input()) for _ in range(n)]

bingo = 'No'

for t in zip(*a):
    a.append(list(t))

a.append([a[i][i] for i in range(3)])
a.append([a[i][2-i]for i in range(3)])

for line in a:
    if all(item in b for item in line):
        bingo = 'Yes'
        break

print(bingo)
# Judge status: Wrong Answer
S = int(input())
x3 = 0
y3 = 0
a = int(S**0.5)
if S<=10**9:
    x1 = S
    y1 = 0
    x2 = 0
    y2 = 1
elif S==10**18:
    x1 = 10**9
    y1 = 0
    x2 = 0
    y2 = 10**9
else:
    x1 = a+1
    y2 = a
    y1 = 1
    x2 = S-x1*y2
print(x1,y1,x2,y2,x3,y3)
# Judge status: Accepted
n,m = map(int, input().split())
set_a = set()
set_b = set()
AB = [list(int(x) for x in input().split()) for _ in range(m)]


for a,b in AB:
  if a > b:
    a,b = b,a
  
  if a == 1:
    set_a.add(b)
  if b == n:
    set_b.add(a)

se = set_a & set_b
print('POSSIBLE' if se else 'IMPOSSIBLE')
# Judge status: Accepted
import numpy as np
X = int(input())
ans = 1
for b in range(2, 1+int(np.ceil(np.sqrt(X)))):
    p = 0
    while np.power(b, p) <= X:
        p += 1
    p -= 1
    ans = max(ans, np.power(b, p))
print(ans)
# Judge status: Accepted
N,K=map(int,input().split())
ans=1
a=K

while N>=a:
    ans+=1
    a=a*K
print(ans)
# Judge status: Wrong Answer
t = list(input())
if t[0] == "?":
    t[0] = "P"
for i in range(1, len(t)):
    if t[i] =="?":
        if t[i-1] == "D":
            t[i] = "P"
        else:
            t[i] = "D"

print("".join(t))
# Judge status: Wrong Answer
s = input()
x = 0
y = 0
for i in range(len(s)):
  if i % 2 != int(s[i]):
    x += 1
for j in range(len(s)):
  if i % 2 == int(s[j]):
    y += 1
print(min(x, y))
# Judge status: Accepted
a = input()
b = input()
cnt = 0
for i in range(len(a)):
    cnt += a[i] != b[i]
print(cnt)
# Judge status: Accepted
N, K = [int(v) for v in input().strip().split()]

cnt = 0
while True:
    cnt += 1
    N = N // K
    if N == 0:
        break
print(cnt)
# Judge status: Wrong Answer
import fractions
import functools

N, X = map(int, input().split())
cities = []
for city in list(map(int, input().split())):
    cities.append(city - X)
print(functools.reduce(fractions.gcd, cities))
# Judge status: Accepted
n,m = map(int,input().split())

if n == 1 and m == 1:
    print(1)
elif n == 1 and m != 1:
    print(m-2)
elif n != 1 and m == 1:
    print(n-2)
else:
    print((n-2) * (m-2))
# Judge status: Accepted
N,K=map(int,input().split())
s=''.join(list(map(str,input().split())))
while True:
    t=str(N)
    for l in t:
        if l in s:
            N+=1
            break
    if(N==int(t)):
        print(t)
        exit()
# Judge status: Accepted
r,g,b = map(str,input().split())

rgb = int( r + g + b )
print( 'YES' if rgb % 4 == 0 else 'NO' )
# Judge status: Accepted
import sys
input = sys.stdin.readline

N = int(input())
A = list(map(int,input().split()))
B = []
for i in range(1,N):
    if A[i] - A[i-1] != 0:
        B.append(A[i] - A[i-1])
cnt = 0
for i in range(1,len(B)):
    if i >1:
        if B[i-1]*B[i-2] < 0 :
            continue
    if B[i]*B[i-1]<0:
        cnt += 1
        B[i]=0
        
print(cnt+1)
# Judge status: Accepted
weekday = input()

list = ['SUN','MON','TUE','WED','THU','FRI','SAT']

next = 7 - list.index(weekday)

print(next)
# Judge status: Accepted
import fractions
a,b=map(int,input().split())
c=a*b//(fractions.gcd(a,b))
print(c)
# Judge status: Accepted
import sys
from collections import Counter,defaultdict
imput = sys.stdin.readline

N = int(input())
A = list(map(int,input().split()))
Q = int(input())
ans = sum(A)
A = Counter(A)
for i in range(Q):
    b,c = map(int,input().split())
    tmp = A.pop(b,None)
    if tmp:
        ans += (c-b)*tmp
        print(ans)
        if c in A:
            A[c] += tmp
        else:
            A[c] = tmp

    else:
        print(ans)
# Judge status: Wrong Answer
import sys
from bisect import bisect_right

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60


def main():
    N, *A = map(int, read().split())

    vec = [INF] * N
    for a in reversed(A[:-1]):
        vec[bisect_right(vec, a)] = a

    print(N - vec.count(INF))
    return


if __name__ == '__main__':
    main()
# Judge status: Accepted
x, y = map(int,input().split())
ex = y//x

#print("ex",ex)

counter = 1
exCount = 1
while True:
  if exCount * 2 > ex:
    break
  else:
    counter += 1
    exCount *= 2

print(counter)
# Judge status: Accepted
n = int(input())
p = list(map(int, input().split()))
min = p[0]
ans = 1
for i in range(1, n):
    if p[i] <= min:
        ans += 1
        min = p[i]
print(ans)
# Judge status: Wrong Answer
x,y=map(int,input().split())
n=(2*y-x)//3
m=(2*x-y)//3
t=min(m,n)
T=1
for i in range(t):
  T*=m+n-i
S=1
for i in range(1,t+1):
  S*=i
print(T//S)
# Judge status: Accepted
n=int(input())
a = [0]*(n+1)
a[0] = [0, 0, 0]
for i in range(n):
    a[i+1]=list(map(int,input().split()))

flag = True
for i in range(n):
    if abs(a[i+1][1]-a[i][1])+abs(a[i+1][2]-a[i][2]) > (a[i+1][0]-a[i][0]):
        flag=False
    elif (abs(a[i+1][1]-a[i][1])+abs(a[i+1][2]-a[i][2])-(a[i+1][0]-a[i][0]))%2==1:
        flag=False

if flag:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
num = [int(s) for s in input().split()]

com = 1
tes = 2
if max(num)%min(num) == 0:
  print(max(num))
else:
  while tes < min(num)**0.5:
    if min(num)%tes == 0 and max(num)%tes == 0:
      com *= tes
      num = [int(n/tes) for n in num]
    else:
      tes += 1

print(com*min(num)*max(num))
# Judge status: Accepted
ans = 0
m = 0
for _ in range(5):
    a = int(input())
    for i in range(10):
        if (a+i)%10 == 0:
            ans += a+i
            if i != 0:
                m = max(m,i)
print(ans-m)
# Judge status: Accepted

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

T = []

for i in range(N):
  a, b = map(int, input().split())
  T.append((a, b))

T.sort()
heap = []
heapq.heapify(T)
i = 0
ans = 0

for limit in range(1, M+1):
  while (i < N) and (T[i][0] <= limit):
    cost, value = T[i]
    heapq.heappush(heap, -value)
    i += 1
  
  if heap:
    ans += -heapq.heappop(heap)

print(ans)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
B = [0]*N
for i in range(N):
    B[i] = A[i] - i
B.sort()

res = 0
x = B[N//2]

for i in range(N):
    res += max(x - B[i], -x + B[i])

print(res)
# Judge status: Accepted
import sys
N = int(input())
s = input()
t = input()
for i in range(N):
    flg = True
    for j in range(N - i):
        if s[i + j] != t[j]:
            flg = False
            break
    if flg:
        print(N + i)
        sys.exit()
print(2 * N)
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
a.sort(reverse=True)
ans=a[0]
del a[0]

num=0
n-=2

while n>0:
  if n==1:
    ans+=a[num]
    n-=1
    
  else:
    ans+=a[num]*2
    n-=2
    num+=1
    
print(ans)
# Judge status: Wrong Answer
x, y = map(int, input().split())

if x == y:
    print(0)
elif abs(x) == abs(y):
    print(1)
else:
    if x <= y:
        print(y-x)
    else:
        print(x-y+2)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))

a.sort(reverse=True)
print(sum(max(a[n:2*n], [a[2*i+1] for i in range(n)])))
# Judge status: Accepted
def LI():
	return [ int(s) for s in input().split() ]

N,X,Y = LI()
dist = [0]*(N-1)

for i in range(1,N):
  for j in range(i+1,N+1):
    d = min(abs(i-j), abs(i-X)+abs(j-Y)+1)
    dist[d-1]+=1
    
[print(d) for d in dist]
# Judge status: Accepted
sx,sy,tx,ty=map(int,input().split())
print('U'*(ty-sy)+'R'*(tx-sx)+'D'*(ty-sy)+'L'*(tx-sx)+'LU'+'U'*(ty-sy)+'R'*(tx-sx)+'RDRD'+'D'*(ty-sy)+'L'*(tx-sx)+'LU')
# Judge status: Wrong Answer
N, A, B = map(int, input().split())
if B-A%2 == 0:
    print((B-A)//2)
else:
    print((B-A-1)//2+min(A-1, N-B)+1)
# Judge status: Wrong Answer
s = input()
n = len(s)
a = [0]*(n+1)
for i in range(n):
    if s[i] == '<':
        a[i+1] = a[i] + 1
for i in range(-1, -n, -1):
    if s[i] == '>':
        a[i-1] = a[i] + 1
print(sum(a))
# Judge status: Wrong Answer
s = input()
n = len(s)
count = 0
ans = True
while count <= n and ans == True:
  for i in range(1,n+1):
    if s[i-1]!=s[-i]:
      ans = False
    
  for i in range(1,int((n-1)/2)+1):
    if s[i-1]!=s[-i]:
      ans = False
      
  count += 1
 
if ans:
  print('Yes')
else:
  print('No')
# Judge status: Wrong Answer
from itertools import product
def score_check(A,L):
    point = 0
    for a, b, c, score in L:
        temp = A[b - 1] - A[a - 1]
        if temp == c:point += score

    return point

n, m, q = map(int,input().split())
l = [list(map(int,input().split())) for i in range(q)]

num = 0
for i in product(list(range(1, m + 1)), repeat = n):
    #print(i)
    temp = score_check(i, l)
    if num < temp:num = temp
print(num)
# Judge status: Accepted
def resolve():
    #n=int(input())
    #a,b=map(int,input().split())
    #x=list(map(int,input().split()))
    #a=[list(map(lambda x:int(x)%2,input().split())) for _ in range(h)]
    x=int(input())
    if x==0:
      print(1)
    else:
      print(0
      )

if __name__ == '__main__':
    resolve()
# Judge status: Accepted
s=''
x=input()
for i in range(len(x)):
    if x[i]=='B' and len(s)!=0:s = s[:-1]
    elif x[i]=='B' and len(s)==0:pass
    else:s += x[i]
print(s)
# Judge status: Accepted
if __name__ == "__main__":
    N = int(input())

    result = 0
    for i in range(1, N+1):
        if i % 3 == 0 or i % 5 == 0:
            continue
        result += i

    print(result)
# Judge status: Accepted
from collections import Counter
n=int(input())
S=[input() for i in range(n)]

nes=set(S[0])
for i in range(1,n):
    nes=nes&set(S[i])
nes=list(nes)

words={}
for i in range(n):
    for chr,cnt in Counter(S[i]).items():
        if chr in nes:
            if chr not in words:words[chr]=cnt
            else:words[chr]=min(words[chr],cnt)

ans=""
for i,j in sorted(words.items()):
    ans +=i*j
print(ans)
# Judge status: Wrong Answer
a,b=map(int,input().split())

if a<9 and b<9:
  print("yay!")
else :
  print(":(")
# Judge status: Accepted
a,b,x=map(int,input().split())
print(b//x-(a+x-1)//x+1)
# Judge status: Accepted
# coding: utf-8
import re
import math
#import numpy as np


#main
n,m=map(int,input().split())
MAP={}
PS=[]
for a in range(m):
    s,t=input().split()
    if(not s in MAP):MAP[s]=[]
    MAP[s].append(t)
ac=0
wa=0
for a,b in MAP.items():
    if(not "AC" in MAP[a]):continue
    for c in b:
        if(c=="WA"):
            wa+=1
        else:
            ac+=1
            break
print(ac,wa)
# Judge status: Accepted
N = int(input())
T = 0
t = 0
ans = []
for i in range(N-1):
    C, S, F = map(int, input().split())
    for j in range(len(ans)):
        if ans[j] <= S:
            ans[j] = S+C
        elif ans[j]%F != 0:
            ans[j] = ans[j]+F-(ans[j] % F)+C
        else:
            ans[j] += C
    ans.append(S+C)
for a in ans:
    print(a)
print(0)
# Judge status: Accepted
a = int(input())
s = input()
if a >=3200:
  print(s)
else:
  print('red')
# Judge status: Wrong Answer
n=int(input())
a=[0]*n
b=[0]*n
for i in range(n):
    a[i],b[i]=map(int, input().split())

a=sorted(a)
b=sorted(b)

if n%2!=0:
    ans=b[(n-1)//2]-a[(n-1)//2]+1
else:
    ans=(b[(n)//2-1]-a[(n)//2-1])*2+1

print(ans)
# Judge status: Accepted
a,b,c = sorted(map(int,input().split()),reverse=True)
print("Yes") if a==b+c else print("No")
# Judge status: Accepted
def T(N,A):
    t = 1
    for i in range(N):
        if A[i]%2 == 1:
            t = 0
    return t

def W(b):
    return b/2

N = int(input())
A = list(map(int,input().split()))
count = 0
t = T(N,A)
while t == 1:
    A = list(map(W,A))
    count += 1
    t = T(N,A)
print(count)
# Judge status: Wrong Answer
N = int(input())
S = []
for i in range(N):
    S.append(input())

al = [chr(ord('a') + i) for i in range(26)]
out = dict(zip(al,[100]*26))
# print(out)

for i in range(N):
    dam = dict(zip(al,[0]*26))
    for T in S[i]:
        dam[T] += 1   #辞書Tに+1
        for key in out.keys():
            out[key] = min(out[key], dam[key])

outS = ""
for key in out.keys():
    outS+=key*out[key]
print(outS)
# Judge status: Accepted
s=input()
print('Bad' if s[0]==s[1] or s[1]==s[2] or s[2]==s[3] else 'Good')
# Judge status: Accepted
def task():
    n = int(input())
    time_task = []
    for i in range(n):
        a,b = map(int,input().split())
        time_task.append([b,a])
    #print(sorted(time_task))
    time_task.sort()

    total_time = 0
    for j in range(n):
        total_time += time_task[j][1]
        limit = time_task[j][0]
        if total_time > limit:
            return 'No'
    return 'Yes'

print(task())
# Judge status: Accepted
import math
A, B = [int(i) for i in input().split()]
print((A * B) // math.gcd(A, B))
# Judge status: Accepted
from sys import stdin
#, setrecursionlimit, stdout
#setrecursionlimit(1000000)
#from collections import deque
#from math import sqrt, floor, ceil, log, log2, log10, pi, gcd, sin, cos, asin
def ii(): return int(stdin.readline())
def fi(): return float(stdin.readline())
def mi(): return map(int, stdin.readline().split())
def fmi(): return map(float, stdin.readline().split())
def li(): return list(mi())
def si(): return stdin.readline().rstrip()
def lsi(): return list(si())
#mod=1000000007
res=['Yes', 'No']
############# CODE STARTS HERE #############


test_case=1
while test_case:
    test_case-=1


    n, k=mi()
    a=li()
    a.sort()
    print(sum(a[:k]))
# Judge status: Accepted
import math
n,m=map(int,input().split())
A=[]
if n%2==1:
    for i in range(m):
        A.append([i+1,n-i])
else:
    d=n//2-1
    h=math.ceil(d/2)
    for i in range(min(h,m)):
        A.append([i+1,n-i])
    if h<m:
        for j in range(m-h):
            A.append([i+j+2,n-i-j-2])
for a in A:
    print(*a)
# Judge status: Wrong Answer
n = int(input())
x = input().split()
count = 0
flg = 0
while True:
  for i in range(0, n):
    if int(x[i]) % 2 != 0:
      flg = 1
  count += 1
  if flg == 0:
    x.insert(i, int(x[i]) /2)
  else:
    break
print(count)
# Judge status: Accepted
a,b,m = map(int,input().split())
l = list(map(int,input().split()))
d = list(map(int,input().split()))
ans = min(l)+min(d)
for i in range(m):
  x,y,c = map(int,input().split())
  p = l[x-1]+d[y-1]-c
  if p < ans:
    ans = p
print(ans)
# Judge status: Accepted
a, b, c = (int(x) for x in input().split())

print(int((a * b) / 2))
# Judge status: Accepted

N = int(input())

if N % 10 == 9 or N // 10 == 9:
    print('Yes')

else:
    print('No')
# Judge status: Accepted
a, b, k = map(int, input().split())
m = b if a > b else a
ans = []
for i in range(1, m+1):
  if a % i == 0 and b % i == 0:
    ans.append(i)
print(ans[-k])
# Judge status: Accepted
r = list(map(int,input().split()))
a = [0]*100
for i in r:
  a[i-1]=1
  
print(sum(a))