peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
n, a, b = map(int, input().split())
mod = pow(10, 9) + 7

def cmb(N, x):
    numerator = 1
    for i in range(N-x+1, N+1):
        numerator = numerator * i % mod
    denominator = 1
    for j in range(1, x+1):
        denominator = denominator * j % mod
    d = pow(denominator, mod-2, mod)
    return numerator * d
 
a = cmb(n, a)
b = cmb(n, b)

total=pow(2,n,mod)-(1+a+b)%mod

print(total)
# Judge status: Wrong Answer
n, h = map(int, input().split())
a = [0]*n
b = [0]*n
maxa = 0
for i in range(n):
    a[i], b[i] = map(int, input().split())
    maxa = max(maxa, a[i]) 
b.sort()
bsum = sum(b)
count = n

if bsum >= h:
    i = 0
    while bsum - b[i] > h:
        bsum -= b[i]
        i += 1
        count -= 1
else:
    if (h - bsum) % maxa == 0:
        count += (h - bsum) // maxa
    else:
        count += (h - bsum + 1)//maxa


print(a, b)
print(maxa)
print(count)
# Judge status: Accepted
N, M, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
x.append(X)
y.append(Y)
x.sort()
y.sort()
if x[-1] < y[0]:
    print('No War')
else:
    print('War')
# Judge status: Wrong Answer
def solve():
    N = int(input())
    C = []
    for _ in range(N):
        a, b = list(map(int, input().split()))
        C.append((a-b+1, a+b-1))

    C.sort()

    for i in range(N-1):
        for j in range(len(C)-1):
            if C[j][1] >= C[j+1][0]: 
                C.pop(j+1)
                break

    return len(C)

print(solve())
# Judge status: Accepted
n=int(input())
c=0
seq=list(map(int,input().split()))
for i in range(n):
    if i%2==0:
        if seq[i]%2!=0:
            c+=1
print(c)
# Judge status: Wrong Answer
A,B,M = map(int, input().split())

a=list(map(int, input().split()))
b=list(map(int, input().split()))
dis=[list(map(int,input().split()))  for l in range(M)]


comp1=a[dis[0][0]-1]+a[dis[0][0]-1]-dis[0][2]
for l in range(M):
    y=a[dis[l][0]-1]+b[(dis[l][1])-1]-dis[l][2]
    if comp1>y:
        comp1=y

comp2=min(a)+min(b)
                  
print(min(comp1,comp2))
# Judge status: Wrong Answer
S=input()
print("Yes" if len(set(S))==3 else "No")
print(set(S))
# Judge status: Accepted
a = int(raw_input())
odds = (a + 1)/2
even = a/2

print even * odds
# Judge status: Wrong Answer
a,b,c = map(int , input().split())
k = int(input())
while(k>=1):
    if c<b:
        c = c*2
    elif b<a:
        b = b*2
    else:
        a = a*2
    k-=1
if (a<b and b<c):
    print ("Yes")
else:
    print("No")
# Judge status: Accepted
import sys
S = input()
A = ''
input()
key = 1

for i in sys.stdin:
    if i[0] == '0':
        break

    if i[0] == '1':
        key = -key
    
    elif key == 1:
        if i[2] == '1':
            A = A + i[4]
        else:
            S = S + i[4]

    else:
        if i[2] == '2':
            A = A + i[4]
        else:
            S = S + i[4]

ans = A[::-1] + S
print(ans[::key])
# Judge status: Wrong Answer
N=int(input())
s=input()
t=input()
ans=2*N

for i in range(N):
  if s[-1-i]==t[i]:
    ans+=-1
  else:
    break

print(ans)
# Judge status: Wrong Answer
a = list(input())

yes = 0

for i in a:
  print(i)
  if i == '7':
    yes += 1
if yes > 0:
  print('Yes')
# Judge status: Wrong Answer
N = int(input())
S = input()
l = S.count("(")
r = S.count(")")
ans = "("*max(r-l, 0) + S + ")"*max(l-r, 0)
print(ans)
# Judge status: Accepted
a, b = [int(x) for x in input().split()]

if a > 0:
    print('Positive')
elif a <= 0 and 0 <= b:
    print('Zero')
elif (b - a) % 2 == 0:
    print('Negative')
else:
    print('Positive')
# Judge status: Accepted
import math
k = int(input())
ans = 0
for x in range(1,k+1):
    for y in range(1,k+1):
        for z in range(1,k+1):
            ans += math.gcd(x,math.gcd(y,z))
print(ans)
# Judge status: Accepted
a,b = list(map(int,input().split(" ")))

l = [input() for i in range(a)]

l.sort()
print("".join(l))
# Judge status: Accepted
a,b,c = map(int,input().split())
k = int(input())

li = sorted([a,b,c])
print(li[0]+li[1]+li[2]*(2**k))
# Judge status: Accepted
N, K = map(int, input().split())

AB = []
for _ in range(N):
    ai, bi = map(int, input().split())
    AB.append((ai,bi))

AB.sort()

memo = {}
len_arr = 0

for ai, bi in AB:
    len_arr += bi
    memo[len_arr] = ai

len_arr_list = sorted(memo.keys())

for boundary in len_arr_list:
    if K <= boundary:
        print(memo[boundary])
        break
# Judge status: Accepted
#!/usr/bin/env python
from collections import deque, defaultdict
import bisect
from math import factorial

def main():
    N = int(input())
    #Xs = list(map(int, input().split()))

    if N % 2 == 1:
        N += 1
    print(N // 2)


if __name__ == '__main__':
    main()
# Judge status: Accepted
#17:21
from collections import deque
import bisect
n = int(input())
now = deque()
for _ in range(n):
  tmp = int(input())
  b = bisect.bisect_left(now,tmp)
  if b != 0:
    now[b-1] = tmp
  else:
    now.appendleft(tmp)
print(len(now))
# Judge status: Accepted
import sys
# input = sys.stdin.readline

def main():
    N = int(input())
    S = input()
    
    for i in range(N):
        left = set(S[:i])
        right = set(S[i:])

        yield len(left & right)


print(max(main()))
# Judge status: Wrong Answer
n=int(input())
l1=list(map(int,input().split()))
l2=list(set(l1))
L2=len(l2)
print('Yes' if n==L2 else 'No')
# Judge status: Wrong Answer
x = int(input())
ans = x // 500 * 1000 + x % 1000 // 5 * 5
print(ans)
# Judge status: Wrong Answer
l = list(map(int, input().split()))
menor = 100
for i in range(len(l) - 1):
    if l[i+1] + l[i] < menor:
        menor = l[i+1] + l[i]
print(menor)
# Judge status: Wrong Answer
number = input().split(" ")
A = int(number[0])
B = int(number[1])
C = int(number[2])
if A > B + C:
	print((B + C) - A)
else:
	print(0)
# Judge status: Accepted
n = int(input())
ans = n - 1
for i in range(1, int(n**0.5)+2):
  if n%i!=0:
    continue
  ans = min(ans, i + n//i - 2)
print(ans)
# Judge status: Accepted
n, k = map(int, input().split())
ans = n%k
print(min(ans, abs(ans-k)))
# Judge status: Wrong Answer
n = int(input())
a = sorted(list(map(int, input().split())))

m = sum(a)//2
ans = 0
s = float("inf")
t = 0
for i in range(n-1):
  t += a[i]
  if  abs(m-t) <= s:
    s = abs(m-t)
    ans = i+1
  else: break

print(abs(sum(a[:ans]) - sum(a[ans:])))
# Judge status: Accepted
import math 
H, W = map(int, input().split())
if H==1 or W == 1:
    print(1)
else:
  print(math.ceil((H * W) / 2))
# Judge status: Accepted
n,k=map(int,input().split())
count=1
num=n
while True:
    if num<k:
      print(count)
      exit()
    else:
      num=num/k
      count+=1
# Judge status: Accepted
def main():
    n, m = list(map(int, input().split()))
    x = []
    for _ in range(m):
        x.append(list(map(int, input().split())))
    for i in range(1000):
        y = str(i)
        if len(y) != n:
            continue
        
        for s, c in x:
            if y[s-1] != str(c):
                break
        else:
            print(i)
            return
    print(-1)

if __name__ == '__main__':
    main()
# Judge status: Accepted
t = input()
n = len(t)
ans = [None]*n
for i in range(n):
  if t[i] != "?":
    ans[i] = t[i]
  else:
    ans[i] = "D"

print("".join(ans))
# Judge status: Accepted
def main():
    N = int(input())
    H = list(map(int, input().split(" ")))
    flag = True
    for i in range(N - 1):
        if H[i] - H[i + 1] < 0:
            H[i + 1] -= 1
    for j in range(N - 1):
        if H[j + 1] - H[j] < 0:
            flag = False
            break
    if flag:
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()
# Judge status: Accepted
a,b,c = map(int,input().split())

d = b//a
print(min(d,c))
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))
if N==2: print(max(A));exit()
from math import gcd
L = {}
R = {}
L[0] = A[0]
R[N-1] = A[-1]
ans = 0
for i in range(1,N):
    L[i] = gcd(L[i-1],A[i])
    R[N-i-1] = gcd(R[N-i],A[N-i-1])
for i in range(2,N):
    ans = max(ans,gcd(L[i-2],R[i]))
ans = max(ans,R[1])
ans = max(ans,L[N-2])
ans = max(ans,R[0])
print(ans)
# Judge status: Accepted
n,k = map(int,input().split())
ab = [tuple(map(int,input().split())) for _ in range(n)]
ab.sort(key = lambda x:x[0])
i = 0
j = 0
while i < k:
  i += ab[j][1]
  j += 1
  
print(ab[j-1][0])
# Judge status: Wrong Answer
n,k=tuple(map(int,input().split()))
l=list(map(int,input().split()))
dp=[1e5 for i in range(n)]
dp[0]=0
for i in range(1,min(k+1,n)):
    dp[i]=abs(l[i]-l[0])
for i in range(1,n):
    for j in range(max(i-k,1),i):
        dp[i]=min(dp[i],abs(l[i]-l[j])+dp[j])

print(dp[n-1])
#print(dp)
# Judge status: Accepted
a, b = map(int, input().split())

str_a = str(a)
str_b = str(b)

line_a = str_a*b
line_b = str_b*a

lines = [line_a, line_b]
sorted_lines = sorted(lines)

print(sorted_lines[0])
# Judge status: Wrong Answer
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)
print(t)
for _ in range(q):
  l,r=map(int,input().split())
  print(t[r-1]-t[l-1])
# Judge status: Accepted
import math
A, B, H, M = map(int, input().split(' '))
deg = abs(30 * H + 0.5 * M - 6 * M)
if deg > 180:
    deg = 360 - deg
deg = math.radians(deg)
print(math.sqrt((B * math.sin(deg)) ** 2 + (B * math.cos(deg) - A) ** 2))
# Judge status: Wrong Answer
n = int(input())
A = list(map(int,input().split()))
t = 0
i = 1
for _ in range(1, n - 1):
    if (A[i - 1] >= A[i] >= A[i+1]) or (A[i-1] <= A[i] <= A[i+1]):
        i += 1
    else:
        t += 1
        i += 2
    if i>=n-1:
        break
print(t + 1)
# Judge status: Accepted
s=list(map(str,input()))
n0=s.count('0')
n1=s.count('1')
print(min(n0,n1)*2)
# Judge status: Accepted
N = int(input())

AC = 0
WA = 0
TLE = 0
RE = 0

for i in range(N):
    S = input()
    if S == 'AC':
        AC+=1
    elif S == 'WA':
        WA+=1
    elif S =='TLE':
        TLE+=1
    elif S =='RE':
        RE+=1

print('AC x '+str(AC))
print('WA x '+str(WA))
print('TLE x '+str(TLE))
print('RE x '+str(RE))
# Judge status: Wrong Answer
from fractions import gcd
from math import ceil,sqrt
a, b = map(int, input().split())

g = gcd(a,b)

s = set()
for i in range(2,ceil(sqrt(g))+1):
    while g % i == 0:
        g //= i
        s.add(i)
if g != 1:
    s.add(int(1e14))
#print(g)
#print(s)
print(len(s)+1)
# Judge status: Wrong Answer
#At coder 2020/2/9 D

# 入力
N,K= map(int, input().split())
p = list(map(int, input().split())) 
#p2 = sorted(p, reverse=True)
#print(p2)
kk=0.0
for ii in range(N-K):
    kk=max(kk,sum(p[ii:K+ii]))
K=float(K)
kk=float(kk)
ans=0.5*(kk+K)

print(ans)
# Judge status: Wrong Answer
a=int(input())
b=int(input())
if a==1:
  if b==2:
    print(3)
  else:
    print(2)
if a==2:
  if b==1:
    print(3)
  else:
    print(1)
else:
  if b==1:
    print(2)
  else:
    print(1)
# Judge status: Accepted
# import sys
# import math
# import decimal
# import queue
# import bisect
# import heapq
# import time
# import itertools
# import collections # queue
# from fractions import Fraction

mod = int(1e9+7)
INF = 1<<29
lINF = 1<<35

def main():
    s = input()
    if len(s)%2!=0:
        print('No')
        return
    for i in range(0,len(s),2):
        if s[i]!='h' or s[i+1]!='i':
            print('No')
            return
    print('Yes')
    return

if __name__=='__main__':
    main()
# Judge status: Accepted
x,y=map(int,input().split())
a = x // y
if x%y:a+=1
print(a)
# Judge status: Accepted
a,b,m=map(int,input().split())
al=list(map(int,input().split()))
bl=list(map(int,input().split()))
ans=min(al)+min(bl)
for i in range(m):
    d,f,off=map(int,input().split())
    ans=min(ans,al[d-1]+bl[f-1]-off)
print(ans)
# Judge status: Wrong Answer
N=int(input())
A=list(map(int,input().split()))
counter=1

while len(A)>1:
    res=(A[1]>=A[0])
    for i in range(len(A)-1):
        if (A[i+1]<A[i] and res) or (A[i+1]>A[i] and not res):
            A=A[i+1:]
            counter+=1
            break

print(counter)
# Judge status: Accepted
N = int(input())
L_list = list(map(int, input().split()))

if max(L_list) * 2 < sum(L_list):
    print('Yes')
else:
    print('No')
# Judge status: Accepted
h1, m1, h2, m2, k = map(int, input().split())
start = h2 * 60 + m2 - k
time = h1 * 60 + m1
ans = start - time
print(ans)
# Judge status: Accepted
n = int(input())
d = sorted(list(map(int,input().split())))
print(d[n//2] - d[n//2 - 1])
# Judge status: Accepted
import sys
readline = sys.stdin.readline
from collections import deque

def solve():
    N = int(readline())
    C = readline().rstrip()

    R, W = 'R', 'W'
    reds = deque(i for i in range(len(C)) if C[i] == 'R')
    whites = deque(i for i in range(len(C)) if C[i] == 'W')

    count = 0
    while len(whites) > 0 and len(reds) > 0 and whites[0] < reds[-1]:
        reds.pop()
        whites.popleft()
        count += 1
    
    print(count)

solve()
# Judge status: Accepted
import math
a,b = map(int,input().split())
count = 1
answer = 0
while count < b :
    count-=1
    count +=a
    answer +=1
print(answer)
# Judge status: Accepted
n=int(input())
t,a=map(int,input().split())
temp=[abs(t-0.006*int(x)-a) for x in input().split()]

print(temp.index(min(temp))+1)
# Judge status: Wrong Answer
n = int(input())
 
lst = list(input().split())
 
ans = 1
for i in range(0, n):
  	for j in range(i + 1, n):
      		for k in range(j + 1, n):
          			if lst[i] + lst[j] > lst[k]:
              				ans += 1
            
print(ans)
# Judge status: Wrong Answer
a,b=map(int,input().split())

if a>=13:
  print(b)
elif a<=12 and a>=6:
  print(b/2)
else:
  print(0)
# Judge status: Accepted
def main():
    s = map(int, input()[::-1])
    mod = 2019
    counts = [0] * mod
    counts[0] = 1
    t = 0
    x = 1
    for num in s:
        t = (t + num * x) % mod
        counts[t] += 1
        x = (x * 10) % mod
    ans = 0
    for count in counts:
        if count > 1:
            ans += count * (count - 1) // 2
    print(ans)


main()
# Judge status: Accepted
N = input()

if '9' in N:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
A, B, C = map(int, input().split())
if C>=A and C<=B:
    print("YES")
else:
    print("NO")
# Judge status: Accepted
N=int(input())
# N=100
n=str(N)
Length=len(n)

l=list(n)

if l[1:]==['9']*(Length-1):
    ans=int(n[0])+9*(Length-1)
else:
    ans=int(n[0])-1+9*(Length-1)

print(ans)
# Judge status: Accepted
from itertools import combinations 
N = int(input())
L = list(map(int,input().split()))


ans = list(combinations(L,3))
ans1 = 0
for i in ans:
    if (i[0]+i[1]>i[2] and i[0]+i[2]>i[1] and i[1]+i[2]>i[0] and i[0]!=i[1] and i[0]!=i[2] and i[1]!=i[2]):
        ans1+=1

print(ans1)
# Judge status: Wrong Answer
N = int(input())
A, B = map(int, input().split())

if B - A >= N - 1:
    print('OK')
else:
    print('NG')
# Judge status: Accepted
L=int(input())
h=L/3
print((h**3-2*L*h**2+h*L**2)/4)
# Judge status: Wrong Answer
S,T = input().split()
print(S+T)
# Judge status: Wrong Answer
import itertools

N, M, Q = list(map(int,input().split()))
numbers = [i for i in range(1, M+1)]
array = itertools.combinations(numbers, N)

combinations = [list(map(int,input().split())) for _ in range(Q)]

max_score = 0
for combi in array:
    score = 0
    for _ in range(Q):
        a, b, c, d = combinations[_]
        a = a - 1
        b = b - 1
        if combi[b] - combi[a] == c:
            score += d
    if score > max_score:
        max_score = score
    
print(max_score)
# Judge status: Accepted
N = int(input())
B = list(map(int, input().split()))
A = [B[0], B[0]]
for i in range(1, N-1):
    b = B[i]
    A.append(b)
    a = max([A[i],A[i+1]])
    if a > b:
        A[A.index(a)] = b
print(sum(A))
# Judge status: Wrong Answer
N=int(input())
T,A=map(float,input().split())
H=list(map(float,input().split()))
d=[]
for i in H:
  d.append(abs(T-i*0.006))
print(d.index(min(d))+1)
# Judge status: Accepted
# -*- coding: utf-8 -*-
"""
Created on Tue Apr 28 22:05:17 2020
"""

import sys
#import numpy as np

sys.setrecursionlimit(10 ** 9)
#def input():
#    return sys.stdin.readline()[:-1]
mod = 10**9+7

#N = int(input())
K, N = map(int,input().split())
A = list(map(int,input().split()))
A.append(K+A[0])
B = []
for i in range(N):
    B.append(A[i+1] - A[i])

ans = K - max(B)

print(ans)
# Judge status: Accepted
n=int(input())
lst=[2,1]
for i in range(86):
    lst.append(lst[i]+lst[i+1])
print(lst[n])
# Judge status: Wrong Answer
N = int(input())
A = [int(i) for i in input().split()]
  
O = [0] * N

for i in range(N):
  for j in range(N):
    if i == j:
      continue
    O[i] ^= A[j]

print(O)
# Judge status: Accepted
n=int(input())
a=1
while True:
    if 2**a>n:
        print(2**(a-1))
        break
    a+=1
# Judge status: Wrong Answer
s=input()
if sorted(s)=='abc':
  print('Yes')
else:
  print('No')
# Judge status: Accepted
n = str(input())

ans = 0
for i in range(len(n)):
  ans += int(n[i])
  
if ans == 1:
  print(10)
else:
  print(ans)
# Judge status: Accepted
def main():
    D = int(input())
    if D == 22:
        print('Christmas Eve Eve Eve')
    elif D == 23:
        print('Christmas Eve Eve')
    elif D == 24:
        print('Christmas Eve')
    elif D == 25:
        print('Christmas')
    

main()
# Judge status: Wrong Answer
a,b,c = map(int,input().split())
if a == b == c:
  if a%2 == b%2 == c%2 == 0:
    print(-1)
  else:
    print(0)
t = 0
while t > -1:
  if a%2 == 1 or b%2 == 1 or c%2 == 1:
    break
  (a,b,c) = ((b+c)//2,(a+c)//2,(a+b)//2)
  t += 1
print(t)
# Judge status: Accepted
N,M,K=map(int,input().split())
flag=False

for i in range(N+1):
    for j in range(M+1):
        black= (N-i)*j + (M-j)*i
        if K==black:
            flag=True
            break
    if flag:
        break
       
if flag:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
def gcd(a, b):
    while b != 0:
        a, b = b, a % b
    return a

def lcm(a, b):
    return a // gcd(a, b) * b

A, B = map(int, input().split())

print(lcm(A, B))
# Judge status: Wrong Answer
w, h, n = map(int,input().split())
xy = [list(map(int,input().split())) for _ in range(n)]
print(0)
# Judge status: Accepted
n,t=map(int,input().split())

c=[]
for i in range(n):
  c_=list(map(int,input().split()))
  c.append(c_)
  
c.sort()

for i in range(n):
  if c[i][1]<=t:
    print(c[i][0])
    exit()
    
  else:
    continue
    
print('TLE')
# Judge status: Accepted
sx,sy,tx,ty=map(int,input().split())
ans=[]

for i in range(ty-sy):
    ans.append("U")
for i in range(tx-sx):
    ans.append("R")
for i in range(abs(sy-ty)):
    ans.append("D")
for i in range(abs(sx-tx)):
    ans.append("L")

ans.append("L")
for i in range(ty-sy+1):
    ans.append("U")
for i in range(tx-sx+1):
    ans.append("R")
ans.append("D")
ans.append("R")
for i in range(abs(sy-ty)+1):
    ans.append("D")
for i in range(abs(sx-tx)+1):
    ans.append("L")
ans.append("U")

print("".join(ans))
# Judge status: Accepted
x = list(map(int, input().split()))
n = len(x)+1
print([i for i in list(range(n)) if i not in x][0])
# Judge status: Accepted
N = int(input())
*A, = map(int, input().split())
m = max(A)
if 2*m < sum(A):
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
import sys
n=int(input())
S=[]
for i in range(n):
  s=list(input())
  S+=[s]
ANS=[]
if n==1:
  ANS=S[0]
  ANS.sort()
  ans="".join(ANS) 
  print(ans)
  sys.exit()
for k in range(len(S[0])):
  if S[0][k] in S[1]:
    ANS+=[S[0][k]]
    S[1].remove(S[0][k])
for i in ANS:
  flag=0
  for k in range(2,n):
    if i in S[k]:
      S[k].remove(i)
    elif flag!=1:
      ANS.remove(i)
      flag=1
ANS.sort()      
ans="".join(ANS)  
print(ans)
# Judge status: Accepted
import re
s = input().replace('?', '.')[::-1]
t = input()[::-1]
for i in range(len(s)-len(t)+1):
  if re.match(s[i:i+len(t)], t):
    print((s[:i].replace('.','a')+t+s[i+len(t):].replace('.','a'))[::-1])
    break
else:
  print('UNRESTORABLE')
# Judge status: Accepted
#!/usr/bin/env python

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

while k>=0:
    if a>=b:
        b *= 2
    elif b>=c:
        c *= 2
    else:
        print('Yes')
        exit(0)
    k -= 1
print('No')
# Judge status: Wrong Answer
a = int(input())
b = int(input())
h = int(input())
print((a + b) * h / 2)
# Judge status: Accepted
from itertools import*
n = int(input())
s = input()
b, w = [list(accumulate([0] + list(map(int, s.translate(str.maketrans("#.","10"[::p]))))[::p]))[::p] for p in [1,-1]]
m = float("inf")
for i in range(-~n):
    m = min(m, b[i] + w[i])
print(m)
# Judge status: Wrong Answer
a=int(input())
s=input()
print('red') if a <= 3200 else print(s)
# Judge status: Accepted
import math

S = list(input())
a =0
b = 0
n=len(S)
for i in range(0,n,2):
  if(S[i]=="R" or S[i]=="U" or S[i]=="D"):
    a +=1
for j in range(1,n,2):
  if(S[j]=="L" or S[j]=="U" or S[j]=="D"):
    b+=1
if(a==math.ceil(n/2) and b ==math.floor(n/2)):
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
N = int(input())
a = list(map(int,input().split()))

a.sort()

ALICE = sum(a[::2])
BOB = sum(a[1::2])

print(ALICE-BOB)
# Judge status: Wrong Answer
a,b,c,d= map(int,input().split())
if a+b >=d or  (b==0 and c == 0) :
    print(a)
    exit()
while d>0 :
  d = d-1
  if a != 0:
   a = a-1
  elif a == 0:
    b = b-1
  elif b == 0 :
    c = c-1
print(d)
# Judge status: Accepted
import math

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

ans = 0
for x, y in xy:
    if math.sqrt(x**2 + y**2)<=d:
        ans += 1
print(ans)
# Judge status: Accepted
a,b,c=map(int,input().split())
print(c//a*b)
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))
i = 1
j = 0
count = 0
while j < n:
  if a[j] == i:
    i += 1
  else:
    count += 1
  j += 1
if count == n:
  print('-1')
  exit()
print(count)
# Judge status: Wrong Answer
s = input()
a = s.count("a")
b = s.count("b")
c = s.count("c")
k = (a > 0) + (b > 0) + (c > 0)
if k == 1:
  print("YES")
  exit()
if k == 2:
  if len(s) == 2:
    print("YES")
  else:
    print("NO")
  exit()
minabc = sorted([a, b, c])[0]
a = max(0, a - minabc)
b = max(0, b - minabc)
c = max(0, c - minabc)
# print(a, b, c, k)
if a <= 1 and b <= 1 and c <= 1:
  print("YES")
else:
  print("NO")
# Judge status: Accepted
import sys

input = sys.stdin.readline
s = list(input().strip())
t = list(input().strip())
if sorted(s) < sorted(t, reverse=True):
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
a=list(input())
ans=0
for i in range(len(a)):
  if a[i]=='?':
    if a[i-1]=='P':
      a[i]='D'
    else:
      a[i]='P'
for i in range(len(a)):
    print(a[i],end='')
# Judge status: Wrong Answer
a=input()
c=int(a)
b=0
if c%2!=0:
	b=b+1
if c%3!=0:
	b=b+1
if c%5!=0:
	b=b+1
if c%7!=0:
	b=b+1
if b>=3:
	print("No")
else:
	print("Yes")
# Judge status: Accepted
import math
N,M=map(int,input().split())
A=[0]*N
B=[0]*M
for i in range(N):
  A[i]=str(input())
for i in range(M):
  B[i]=str(input())
k=math.ceil(N/M)

def macthing(y,x):
  flag=0
  for p in range(M):
    if A[y+p][x:x+M]!=B[p]:
      flag=1
      break
  if flag==0:
    return True
  else:
    return False

for i in range(k):
  for j in range(k):
    if macthing(i,j):
      print('Yes')
      exit()
print('No')
# Judge status: Accepted
from math import sqrt
n = int(input())
ans = 10 ** 18
for i in range(1, int(sqrt(n))+1):
    if n % i != 0:
        continue
    j = n // i
 
    ans = min(ans, i+j-2)
print(ans)
# Judge status: Accepted
N,K=map(int,input().split())
h=[int(input()) for _ in range(N)]
h.sort()
print(min(h[i+K-1]-h[i] for i in range(N-K+1)))
# Judge status: Accepted
N = int(input())
a = list(map(int, input().split()))

x = [0] * (N+1)

for i in range(1, N+1):
  x[i] = x[i-1] + a[i-1]

suma = x[N]
y = [suma] * (N+1)
for i in range(1, N+1):
  y[i] = y[i-1] - a[i-1]
  
ans = sum([abs(i) for i in a])
for i in range(1, N):
  ans = min(ans, abs(x[i]-y[i]))
  
print(ans)
# Judge status: Wrong Answer
N,M,K = list(map(int,input().split()))
A=list(map(int,input().split()))
B=list(map(int,input().split()))
A.append(1000000001)
B.append(1000000001)
a=0
b=0
count=0
time=0
while True:
    if A[a]<B[b]:
        time+=A[a]
        a+=1
        if time>K:
            break
        count+=1
    else:
        time+=B[b]
        b+=1
        if time>K:
            break
        count+=1

print(count)
# Judge status: Wrong Answer
N, K = (int(x) for x in input().split())
S = input()

S[K-1].lower()
print(S)