peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
a = int(input())
e = int(input())
k = int(input())
if e-a <= k:
  print("Yay!")
else:
  print(":(")
# Judge status: Accepted
n=int(input())
x=list(map(int,input().split()))
m=1000000
for i in range(100):
    su=0
    for j in range(n):
        su+=(x[j]-i-1)**2
    if m>su:
        m=su
print(m)
# Judge status: Accepted
x=int(input())

ans=(x//11)*2
if x%11==0:
    pass
elif 0<x%11<=6:
    ans+=1
else:
    ans+=2
print(ans)
# Judge status: Accepted
# coding: utf-8
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

X, N = lr()
P = set(lr())
flag = True
answer = X
while answer in P:
    if flag:
        diff = abs(X - answer)
        answer = X - diff - 1
        flag = False
    else:
        diff = abs(X - answer)
        answer = X + diff
        flag = True

print(answer)
# Judge status: Wrong Answer
s = int(input())
a = (s-1)//10**9+1; b = 10**9-s%10**9
print(0, 0, 1, a, 10**9, b)
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split(' ')))


a.sort(reverse=True)
cnt=0
for i in range(1,n):
    if i==1:
        cnt+=a[0]
    else:
        j = (i // 2)
        cnt += a[j]
print(cnt)
# Judge status: Accepted
N = int(input())
A = [int(input()) for _ in range(N)]

m,s = 0,0
for a in A:
    if a > m:
        m = a
    elif a > s:
        s = a

for a in A:
    if a == m:
        print(s)
    else:
        print(m)
# Judge status: Accepted
import math

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

s = str(a) + str(b)
i = int(s)

r = int(math.sqrt(i))

if (r * r == i):
    print('Yes')

else:
    print('No')
# Judge status: Wrong Answer
import math
n = int(input())
# 4, 7
f = []
s = []
tmp = 0
ans = 0
a = math.floor(n/4)
b = math.floor(n/7)
cnt = 0
for i in range(a):
  f.append(4)
for i in range(0, len(f)):
  ans = math.floor((n-4*i) % 7) 
  if ans == 0:
    cnt = 1
    break
  ans = 0
if cnt == 1:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
a=input()
if a.isupper():
  print('A')
  
else:
  print('a')
# Judge status: Accepted
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())

if A > B:
  T = -T

posA = A + V*T
posB = B + W*T


if T <= 0:
  if posA <= posB:
    print('YES')
  else:
    print('NO')
else:
  if posA >= posB:
    print('YES')
  else:
    print('NO')
# Judge status: Accepted
N = int(input())

if len(str(N)) <= 1:
    answer = N
elif len(str(N)) <=2:
    answer = 9
elif len(str(N)) <=3:
    answer = 9 + N - 10**2 + 1
elif len(str(N)) <=4:
    answer = 9 + 9*10**2
elif len(str(N)) <= 5:
    answer = 9 + 9*10**2 + N - 10**4 + 1
else:
    answer = 9 + 9*10**2 + 9*10**4

print(answer)
# Judge status: Accepted
a,b = map(int, input().split())
powers = list(range(2,13+1))+[1]
if powers.index(a) > powers.index(b):
    print('Alice')
elif powers.index(b) > powers.index(a):
    print('Bob')
else:
    print('Draw')
# Judge status: Accepted
n, a, b, c, d = map(int, input().split())
S = input()

if c < d and (S[a-1:d+1].count("##") == 0):
    print("Yes")
    exit()

if c > d and (S[b-2:d+1].count("...") >= 1) and (S[a-1:d+1].count("##") == 0):
    print("Yes")
    exit()

print("No")
# Judge status: Accepted
S=input()

Wea=['Sunny','Cloudy','Rainy']

if S==Wea[0]:
  print(Wea[1])
elif S==Wea[1]:
  print(Wea[2])
else:
  print(Wea[0])
# Judge status: Wrong Answer
n, m = map(int, input().split())
A = {}
for i in range(n):
  a, b = map(int, input().split())
  if not a in A:
    A[a] = b
  else:
    A[a] += b
ans = 0
num = 0
for k, v in A.items():
  if num < m and m <= num+v:
    ans += (m-num)*k
    break
  else:
    ans += v*k
    num += v
print(ans)
# Judge status: Wrong Answer
import sys
input=sys.stdin.readline
n,k=map(int,input().split())
a=list(map(int,input().split()))

for i in range(50):
    ans=[0]*(n)
    for j in range(n):
        l=max(0,j-a[j])
        r=j+1+a[j]
        ans[l]+=1
        if r<n:
            ans[r]-=1
    for z in range(n-1):
        ans[z+1]+=ans[z]
    a=ans
print(" ".join(list(map(str,ans))))
# Judge status: Accepted
data = input()
temp = ord(data)
if 97 <= temp <= 122:
    print('a')
if 65 <= temp <= 90:
    print('A')
# Judge status: Wrong Answer
n = input()
for i in n:
    if i == "7":
        print("Yes")
        exit()
    else:
        print("No")
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))

num_negative = sum(1 for x in A if x < 0)
positives = [abs(x) for x in A]
if num_negative % 2 == 0:
    print(sum(positives))
else:
    print(sum(positives) - min(positives) * 2)
# Judge status: Accepted
S, W = map(int, input().split())
if W >= S:
    print('unsafe')
else:
    print('safe')
# Judge status: Wrong Answer
x = int(input())
cnt = 0
dep = 100
while True:
  dep = int(dep * 1.01)
  cnt+= 1
  if dep >= x:
    print(cnt)
    break
# Judge status: Wrong Answer
a,b = map(int,input().split())
s = list(input())
num = [str(i) for i in range(10)]
flag = True
for i in range(a+b+1):
    if s[a]!='-':
        flag = False
        
    if 0<=i<a or a+1<=i<b:
        if not s[i] in num:
            flag = False
            
    if i==0:
        if s[i]=='0':
            flag = False
print('Yes' if flag==True else 'No')
# Judge status: Wrong Answer
n, k = map(int, input().split())

print(abs((n % k + n // k) - n // k))
# Judge status: Accepted
a = input()
 
if a == "e" or a == "i" or a == "a" or a == "u" or a == "o":
  print("vowel")
else:
  print("consonant")
# Judge status: Accepted

from collections import deque
import bisect


N = int(input())
A = []
for i in range(N):
    A.append(int(input()))

d = deque()

for a in A:
    p = bisect.bisect_left(d, a)
    if p == 0:
        d.appendleft(a)
        continue
    d[p-1] = a

print(len(d))
# Judge status: Accepted
def main():
    n = int(input())
    hlis = list(map(int, input().split()))
    ans = 0
    tmp = 0
    for i in range(n-1):      
        if hlis[i+1] <= hlis[i]:
            tmp += 1
        else:
            if ans < tmp:
                ans = tmp
            tmp = 0
    if ans < tmp:
        ans = tmp
    print(ans)
    


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
n,k=map(int, input().split())
a = list(map(int, input().split()))
a=sorted(a)
if k==0:
    print(max(a))
    exit()

lo=0
hi=10**9
oldmid=0
while True:
    mid=(hi+lo)/2
    cnt=0
    for i in range(n):
        cnt+=round((a[i])/mid-0.5)
    if cnt>k:
        lo=mid
    elif cnt<=k:
        hi=mid
    if oldmid-0.001<=mid<=oldmid+0.001:
        #print(mid)
        print(round(mid))
        break
    oldmid=mid
# Judge status: Accepted
n, k = map(int, input().split())
h = list(map(int, input().split()))

inf = 10**10
dp = [0] + [inf] * (n-1)

for i in range(1,n):
    j = 1
    while j <= k and j <= i:
        dp[i] = min(dp[i-j]+abs(h[i]-h[i-j]), dp[i])
        j += 1
    
print(dp[-1])
# Judge status: Accepted
s = int(input())

sec = [s]
i = 1

def f(n):
    if n%2==0:
        result = n/2
        return result
    else:
        result = 3 * n + 1
        return result

def my_index_multi(l,x):
    return [i for i, _x in enumerate(l) if _x == x]

while len(my_index_multi(sec,s))!=2:
    s = f(s)
    sec.append(s)
print(my_index_multi(sec,s)[1]+1)
# Judge status: Accepted
import sys
a=[[int(x) for x in input().split()] for i in range(3)]
n=int(input())
for i in range(n):
  bi = int(input())
  for j in range(3):
    if bi in a[j]:
      a[j][a[j].index(bi)] = 0
  # 判定
  for j in range(3):
    x = [a[k][j] for k in range(3)]
    if (not any(x)) or (not any(a[j])):
      print('Yes')
      sys.exit()
  if not any([a[0][0],a[1][1],a[2][2]]):
    print('Yes')
    sys.exit()
  if not any([a[2][0],a[1][1],a[0][2]]):
    print('Yes')
    sys.exit()
print('No')
# Judge status: Accepted
A,B=input().split()
count=0

for i in range(int(A),int(B)+1):
    S=str(i)
    if S==S[::-1]:
        count+=1
        
        
print(count)
# Judge status: Accepted
n, a, b = map(int, input().split())
MOD = 10**9+7

def comb(n, k, MOD):
    x = 1
    for i in range(k):
        x *= (n-i)
        x *= pow(i+1, MOD-2, MOD)
        x %= MOD
    return x

ans = pow(2, n, MOD) - 1 - comb(n, a, MOD) - comb(n, b, MOD)
ans += MOD
ans %= MOD
print(ans)
# Judge status: Wrong Answer
N= int(input())
if N ==0:
    print("a")
else:   
    mylist =[]
    while N >26:
        b = N%26
        mylist.append(b-1)
        N = N//26
    if N ==26:
        mylist.append(0)
    else:
        mylist.append(N-1)

    num = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
    ans = []
    for i in reversed(mylist):
        ans.append(num[i])
    print(''.join(ans))
# Judge status: Accepted
X = input()
n = len(X)
S_waitng_for_T = 0
ans = n
for i in range(n):
    if X[i] == 'S':
        S_waitng_for_T += 1
    else:
        if S_waitng_for_T > 0:
            S_waitng_for_T -= 1
            ans -= 2
print(ans)
# Judge status: Accepted
#!/usr/bin/env python3

import sys
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 7)

x = int(readline())

q = (x + 10) // 11
tot = 0
if 11 * q - x >= 5:
    tot -= 1

tot += q * 2
print(tot)
# Judge status: Accepted
S = input()
for i in range(len(S)):
  if i % 2 == 1:
    if S[i] =="R":
      print("No")
      break
  else:
    if S[i] == "L":
      print("No")
      break
else:
  print("Yes")
# Judge status: Accepted
from collections import deque
N = int(input())
B = list(map(int, input().split()))

b = deque(B)
b.appendleft(B[0])
b.append(B[-1])

ans = 0
for i in range(N):
    ans += min(b[i],b[i+1])
print(ans)
# Judge status: Wrong Answer
import math

a,b,n = map(int, input().split())
tmp = int(n/b)
result = 0
if tmp != 0:
    result = b - 1
else:
    result = n
print(math.floor((a*result)/b) - a*math.floor(result/b))
# Judge status: Wrong Answer
s=int(input())
count=int(1)
sum=int(0)
while(count!=s):
    if count%3!=0 and count%5!=0:
        sum+=int(count)
    count+=1
print(int(sum))
# Judge status: Accepted
A,B,M=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
xyc=[list(map(int,input().split()))for i in range(M)]
ans=min(a)+min(b)
for i in range(M):
    tmp = a[xyc[i][0]-1]+b[xyc[i][1]-1]-xyc[i][2]
    if ans > tmp:
        ans=tmp
print(ans)
# Judge status: Wrong Answer
N = int(input())
S = list(input())

if N % 2 != 0:
    print('No')

for i in range(N//2):
    if S[i] == S[i + (N//2)]:
        continue
    else:
        print('No')
        exit()
        
print('Yes')
# Judge status: Wrong Answer
def ave_temp(temp, height):
	return temp - (height * 0.006)

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

ans = []

for i in range(0, N):
	ans.append(ave_temp(T, H[i]))

built = 0

for k in range(0, N-1):
	if abs(H[k] - A) > abs(H[k+1] - A):
		built = k + 1

print(str(built + 1))
# Judge status: Accepted
X = int(input())

a, b = divmod(X, 11)

if b == 0:
    print(a * 2)
elif b <= 6:
    print(a * 2 + 1)
else:
    print(a * 2 + 2)
# Judge status: Wrong Answer
N=int(input())
A=[]
B=[]
for i in range(N):
    AB=list(map(int,input().split()))
    A.append(AB[0])
    B.append(AB[1])

ans=0
for i in range(N-1,-1,-1):
    if B[i]!=1:
        A[i]=(A[i]+ans)%B[i]
        ans+=B[i]-A[i]

print(ans)
# Judge status: Accepted
X = int(input())
N = X//100
X %=100
if N == 0:
    print(0)
    exit()
if X == 0:
    print(1)
    exit()
for i in [5,4,3,2,1]:
    for j in range(N,0,-1):
        if X//(i*j) > 0:
            N -= j
            X %= i*j
            break
    if N == 0:
        break
if X == 0:
    print(1)
else:
    print(0)
# Judge status: Wrong Answer
N,T=map(int,input().split())
cost=1001
ans=0
for i in range(N):
    c,t=map(int,input().split())
    if t<T and c<cost:
        cost=c
        ans=cost
if ans==0:
    print('TLE')
else:
    print(ans)
# Judge status: Wrong Answer
N=int(input())
L=[sorted(input()) for _ in range(N)]
Y=[]
for i in range(len(L)):
    Y.append("".join(L[i]))
print(N-len(set(Y)))
# Judge status: Wrong Answer
N,*A=open(0).read().split()
print(sum([sum(map(int,t))//2 for t in ''.join(A).split('0')]))
# Judge status: Accepted
x, y = map(int, input().split())
ans = 0
while x <= y:
    x *= 2
    ans += 1

print(ans)
# Judge status: Accepted
from sys import stdin
nii=lambda:map(int,stdin.readline().split())
lnii=lambda:list(map(int,stdin.readline().split()))

n=int(input())

z=[]
w=[]
for i in range(n):
  x,y=nii()
  z.append(x-y)
  w.append(x+y)

z_ans=max(z)-min(z)
w_ans=max(w)-min(w)
print(max(z_ans,w_ans))
# Judge status: Wrong Answer
D = int(input())
C = list(map(int, input().split()))
S = []
N = 26
for d in range(D):
    S += [list(map(int, input().split()))]
#print(C)
#print(S)
myans = [d%N for d in range(D)]
for d in range(D):
  print(myans[d])
# Judge status: Accepted
abc=set(list(map(int,input().split())))
print(len(abc))
# Judge status: Accepted
A,B,C=map(int,input().split())

ans='NO'
i=1
while i<=B:
    if i*A%B==C:
        ans='YES'
    i+=1

print(ans)
# Judge status: Wrong Answer
L,R=map(int,input().split())
if L+1==R: print((L*R)%2019)
else:
    c=0
    while (c+1)*2019<R: c+=1
    if c*2019<L: print((L*(L+1))%2019)
    else: print(((c*2019)*((c*2019)+1))%2019)
# Judge status: Wrong Answer
N=int(input())
ans=0
for i in range(1,(10**5)+1):
    if i==N: break
    if len(str(i))%2==1: ans+=1
print(ans)
# Judge status: Accepted
k,x=map(int, input().split())

if 500*k>=x:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n, m = map(int, input().split())
s = [list(map(int, input().split())) for _ in range(n)]
c = [list(map(int, input().split())) for _ in range(m)]
d = {}
for i in range(n):
    for j in range(m):
        d[j] = abs(s[i][0]-c[j][0])+abs(s[i][1]-c[j][1])
    t = sorted(d.items(), key=lambda x:x[1])
    print(t[0][0]+1)
    d = {}
# Judge status: Accepted
n = int(input())
aa = tuple(map(int, input().split()))

balls = set()
for i in range(n, 0, -1):
    r = aa[i - 1]
    
    x = 0
    for j in range(i, n + 1, i):
        if j in balls:
            x += 1
    if x % 2 != r:
        balls.add(i)
print(len(balls))
if balls:
    print(' '.join(map(str, balls)))
# Judge status: Wrong Answer
import numpy as np

X, Y = map(int, input().split())
l = int(np.log2(Y/X))
print(l + 1)
# Judge status: Accepted

n=int(input())

x=800*n
y=200*(n//15)

print(x-y)
# Judge status: Wrong Answer
o = list(input())
e = list(input())

for x, y in zip(o, e):
    print(x+y, end="")
# Judge status: Accepted
n=list(map(int, input().split()))

if n[1]==100:
  print((n[1]+1)*(100**n[0]))
else:
  print(n[1]*(100**n[0]))
# Judge status: Accepted
N, M = input().split()
if N == M:
  print('Yes')
else:
  print('No')
# Judge status: Wrong Answer
n = int(input())
arr = [list(map(int,input().split())) for _ in range(2)]
ans = []
for i in range(n):
    if sum(arr[0][i+1:]) >= sum(arr[1][i:]):
        ans.append(arr[0][i])
    else:
        ans.append(arr[0][i])
        ans += arr[1][i:]
        break
else:
    ans.append(arr[0][-1])
print(sum(ans))
# Judge status: Accepted
N=int(input())
v=[int(x) for x in input().rstrip().split()]
v.sort()
ans=0
now=(v[0]+v[1])/2
if 2<=N:
  for i in range(2,N):
    now=(now+v[i])/2

print(now)
# Judge status: Accepted
N = int(input())
x_list = list(map(int, input().split()))
sorted_x = sorted(x_list)

medi = N//2
l = sorted_x[medi-1]
r = sorted_x[medi]
for x in x_list:
    if x < r:
        print(r)
    else:
        print(l)
# Judge status: Accepted
S = input()
list = []
for i in range(len(S)):
    list.append(S[i])
list = set(list)
lists = set([chr(i) for i in range(ord('a'), ord('z')+1)])
ans = lists-list
print('None' if len(ans)==0 else min(ans))
# Judge status: Accepted
n=int(input())
P=list(map(int,input().split()))
mn=2*10**5+1
cnt=0

for item in P:
  if mn>item:
    cnt+=1
    mn=item
print(cnt)
# Judge status: Accepted
print(input().replace('2017/01/', '2018/01/'))
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split())) # 横入力

x = [0]
aaa = 0
aa = sum(a)
y = [aa]
for i in range(n):
    aaa += a[i]
    x.append(aaa)
    aa -= a[i]
    y.append(aa)

ans = 202020202020
for i in range(n+1):
    ans = min(ans, abs(x[i] - y[i]))

print(ans)
# Judge status: Wrong Answer
x, y, a, b, c = map(int, input().split())
p = sorted(list(map(int, input().split())), reverse = True)
q = sorted(list(map(int, input().split())), reverse = True)
r = sorted(list(map(int, input().split())), reverse = True)
pi = x - 1
qi = y - 1
ri = 0

while ri < c and (p[pi] < r[ri] or q[qi] < r[ri]):
    if p[pi] >= q[qi]:
        q[qi] = r[ri]
        qi -= 1
    else:
        p[pi] = r[ri]
        pi -= 1
    ri += 1

print(sum(p[:x]) + sum(q[:y]))
# Judge status: Accepted
a,b,c=map(int,input().split())
if (a-b)>c:
	print("0")
else:
	print(c-a+b)
# Judge status: Wrong Answer
A, B, C=map(int,input().split(' '))
if(A<C and C<B):
  print('Yes')
else:
  print('No')
# Judge status: Accepted
from collections import deque
n = int(input())
a = list(map(int, input().split()))

d = deque()
t = 0
for i in a:
  if t == 0: d.append(i)
  elif t == 1: d.appendleft(i)
  t = 1 - t
  
if t == 0: print(*d)
else: print(*list(reversed(d)))
# Judge status: Accepted
import sys
N=int(sys.stdin.readline().strip())
ans=0
for i in range(1,N):
    if N%i==0:
        max_sho=N/i-1
    else:
        max_sho=N/i
    ans+=max_sho
print ans
# Judge status: Wrong Answer
#!/usr/bin/env python3
import sys
from collections import Counter

def main():
    N = int(input())
    S = input()
    L = Counter(S)
    ans = 1
    for l in L.items():
        ans *= l[1] + 1
    print(ans - 1)

if __name__ == '__main__':
    main()
# Judge status: Accepted
N = int(input())
LP = list(map(int, input().split()))

LPS = []
LPS = sorted(LP)

cnt = 0
for i in range(N):
    if LP[i] != LPS[i]:
        cnt += 1
        if cnt == 3:
            print("NO")
            exit()

print("YES")
# Judge status: Accepted
import sys
input = lambda: sys.stdin.readline().rstrip()

def main():
    s = input()
    ans = float('inf')
    for i in range(len(s)-2):
        if i == len(s)-3:
            ans = min(ans, abs(int(s[i:]) - 753))
        else:
            ans = min(ans, abs(int(s[i:i+3]) - 753))
    print(ans)
            
if __name__ == '__main__':
    main()
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))
s = sum(a)
l1 = 0

for i in range(n):
    l1 += a[i] 
    if l1> s//2:break
r1 = s - l1
l2 = l1 -a[i]
r2 = s - l2
ans = min(abs(r1-l1),abs(r2-l2))
print(ans)
# Judge status: Accepted
num = int(input())
num_list = [int(a) for a in input().split()]
target = 1
ans = 0
flg = False

for i in range(num):
    if num_list[i] == target:
        target += 1
        flg = True
    else:
        ans += 1

if not flg:
    ans = -1

print(ans)
# Judge status: Accepted
n = int(input())
ans = 0
cnt = 1
while n >= 1:
    ans += cnt
    n //= 2
    cnt *= 2
print(ans)
# Judge status: Wrong Answer
n=int(input())
a=list(map(int,input().split()))
SUM=sum(a)
sum_snuke = 0
sum_araisan = 0
answer = float('inf')
for i in range(1, n):
    sum_snuke += a[i]
    sum_araisan = SUM - sum_snuke
    # print(sum_snuke, sum_araisan)
    if answer >= abs(sum_snuke - sum_araisan):
        answer = abs(sum_snuke - sum_araisan)

print(answer)
# Judge status: Accepted
import sys
N,M,X,Y=[int(x) for x in input().rstrip().split()]
x_n=[int(x) for x in input().rstrip().split()]
y_m=[int(x) for x in input().rstrip().split()]
x_max=max(x_n)
y_max=min(y_m)
for z in range(X+1,Y+1):
  if x_max<z and z<=y_max:
    print("No War")
    sys.exit()
print("War")
# Judge status: Accepted
import sys
import heapq, math
from itertools import zip_longest, permutations, combinations, combinations_with_replacement
from itertools import accumulate, dropwhile, takewhile, groupby
from functools import lru_cache
from copy import deepcopy
x = int(input())

cnt = x // 11

if x % 11 == 0:
    print(cnt * 2)
elif cnt * 11 + 6 >= x:
    print(cnt * 2 + 1)
else:
    print(cnt * 2 + 2)
# Judge status: Accepted
n,m=map(int,input().split())
cnt = [0]*n
total = [0]*n
for i in range(m):
    P=list(input().split())
    p = int(P[0]) - 1
    if P[1] == 'WA' and cnt[p] == 0:
        total[p] += 1
    if P[1] == 'AC' and cnt[p] == 0:
        cnt[p] = True
ans = 0
for i in range(n):
    if cnt[i] == True:
        ans += total[i]
print(sum(cnt),ans)
# Judge status: Accepted
S = list(input())
print('Yes') if S[2] == S[3] and S[4] == S[5] else print('No')
# Judge status: Wrong Answer
n = int(input())
c = list(input())
 
if n % 2 == 0:
  half = int(n / 2)
  odd =0
else:
  half = int((n-1) / 2)
  odd = 1
pre_w_num = 0
for i in range(half):
  if c[i] == "W":
    pre_w_num = pre_w_num + 1
post_r_num = 0
for j in range(half):
  if c[-1 *(j+1)] == "R":
    post_r_num = post_r_num +1
if pre_w_num > post_r_num:
  ans = pre_w_num
else:
  ans = post_r_num
if odd == 1:
  if c[half] == 'W':
    ans = ans +1
print(ans)
# Judge status: Accepted
n = int(input())
p = list(map(int,input().split()))

ans = 0

for i in range(0,n-2):
  if p[i]<p[i+1]<p[i+2] or p[i+2]<p[i+1]<p[i]:
    ans+=1
    
    
print(ans)
# Judge status: Wrong Answer
a, c, b, d=map(int, input().split())
print('R'*(b-a)+'U'*(d-c)+'L'*(b-a)+'D'*(d-c))
# Judge status: Accepted
s = str(input())
k = int(input())


for i in range(k):
    if s[i] != "1" :
        break
print(s[i])
# Judge status: Accepted
N=int(input())
a=list(map(int, input().split()))
b=[0]*N
c=1
while c<=N:
	d=a[c-1]
	b[d-1]=c
	c+=1
for i in range(N):
	print(b[i])
# Judge status: Wrong Answer
def main():
    num = int(input())
    if num > 1799:
        print(1)
    elif num > 1599:
        print(2)
    elif num > 1399:
        print(3)
    elif num > 1199:
        print(4)
    elif num > 999:
        print(5)
    elif num > 799:
        print(6)
    elif num > 599:
        print(7)
    elif num > 400:
        print(8)

if __name__ == '__main__':
    main()
# Judge status: Accepted
s = input()
c = set(s)
print('yes' if len(s) == len(c) else 'no')
# Judge status: Wrong Answer
import numpy as np
import bisect
n = int(input())
aa = list(map(int, input().split()))
bb = list(map(int, input().split()))
cc = list(map(int, input().split()))

aa.sort()
cc.sort()

cnt = 0
for b in bb:
    na = bisect.bisect_left(aa,b)
    nc = n - bisect.bisect_right(cc,b)
    print(na, nc)
    cnt += na*nc
print(cnt)
# Judge status: Accepted
from collections import Counter
n, k = map(int, input().split())
a = [int(i) for i in input().split()]
cost = sorted(Counter(a).values())
print(sum(cost[:max(len(cost) - k, 0)]))
# Judge status: Accepted
s = int(input())

d = dict()

for i in range(1000000):
    if s in d:
        print(i+1)
        break
    else:
        d[s] = 0
        if s % 2 == 0:
            s = s//2
            continue
        else:
            s = 3*s + 1
            continue
# Judge status: Wrong Answer
# -*- coding: <encoding name> -*-

a, b, x = map(int, input().split())
print('YES' if a <= x <= b else 'NO')
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))
ans = [0]*N
cnt = 1
for i in range(N):
    ans[A[i]-1] = cnt
    cnt += 1
for i in range(N):
    print(ans[i])
# Judge status: Accepted
a,b,c = map(int, input().split())

print(int((a-c)/(b+c)))
# Judge status: Wrong Answer
n = int(input())
s = list(input())
#s = s[::-1]
from itertools import groupby
li = []
for k,v in groupby(s):
    li.append(list(v))
#print(li)
cnt = 0

for i in range(len(li)//2):
    cnt += min(len(li[i]),len(li[i+1]))
print(cnt)
# Judge status: Accepted
S = input()
if S.endswith("s"): print(S + "es")
else: print(S + "s")
# Judge status: Wrong Answer
import math
 
n = int(input().replace(' ', ''))

ans = 'No' if (math.sqrt(n) % 1).is_integer else 'Yes'
print(ans)
# Judge status: Accepted
n = int(input())

MOD = 10 ** 9 + 7

ans = pow(10, n, MOD) - 2 * pow(9, n, MOD) + pow(8, n, MOD)
ans %= MOD

print(ans)
# Judge status: Accepted
import heapq

N = int(input())
arr = list(map(int, input().split()))
arr = sorted(arr, reverse = True)
ans = 0
q = []
heapq.heappush(q, -arr[0])

for i in range(1, N):
  tmp = heapq.heappop(q)
  tmp *= -1
  ans += tmp
  heapq.heappush(q, -arr[i])
  heapq.heappush(q, -arr[i])
  
print(ans)