peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

n = ii()
A = sorted(iil(),reverse=True)
print(sum(A[::2])-sum(A[1::2]))
# Judge status: Accepted
S = input().rstrip()
T = []
cnt = 0
for s in S:
    if not T:
        T.append(s)
        continue
    if s!=T[-1]:
        cnt += 2
        T.pop()
    else:
        T.append(s)
print(cnt)
# Judge status: Wrong Answer
N = int(input())
S = input()
 
oE = S.count("E")
Wo = 0

L = []
for i in range(N):
    if i == 0:
        if S[i] == "E":
            oE -= 1
    else:
        if S[i-1] == "W":
            Wo += 1
        if S[i] == "E":
            oE -= 1
    L.append(Wo + oE)
    if Wo + oE == 1:
        break
print(min(L))
# Judge status: Accepted
s=0
N=int(input())
for a in range(1,N+1):
    if a%3!=0 and a%5!=0:
        s+=a
print(s)
# Judge status: Wrong Answer
n,m=map(int,input().split())

a=[[] for _ in range(n)]

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

mk=[900000]*n
mk[0]=0

for i in range(n):
    for b in a[i]:
        mk[b]=min(mk[b],mk[i]+1)

print("Yes")
for i in range(n-1):
    print(mk[i+1])
# Judge status: Accepted
N, K = map(int, input().split())
H = list(map(int, input().split()))

H.sort()

print(sum(H[:max(N-K, 0)]))
# Judge status: Accepted
#061_A
a,b,c=map(int,input().split())
print('Yes' if a<=c<=b else 'No')
# Judge status: Accepted
A, B, K = map(int, input().split())
l = []
for i in range(K):
    if A+i <= B:
        l.append(A+i)
    if B-i >= A:
        l.append(B-i)

for i in sorted(set(l)):
    print(i)
# Judge status: Accepted
abc=list(map(int,input().split()))
abc.sort()

n1=abc[2]-abc[0]
n2=abc[2]-abc[1]

if (n1-n2)%2==0:
    print((n1-n2)//2+n2)
else:
    print((n1-n2+1)//2+n2+1)
# Judge status: Wrong Answer
r=input().split()
N=int(r[0])
D=int(r[1])
d=[[int(s) for s in input().split()] for i in range(N)]
ans=0
for i in range(N-1):
    for j in range(i+1,N):
        dis=0
        for k in range(D):
            dis+=(d[i][k]-d[j][k])**2
        ans_pre=dis**(int(1/2))
        if type(ans_pre)==int or ans_pre.is_integer()==True:
            ans+=1
print(ans)
# Judge status: Accepted
n,k=map(int,input().split())
a=list(map(int,input().split()))
for i in range(n-k):
    print("Yes")if a[i]<a[k+i] else print("No")
# Judge status: Wrong Answer
# -*- coding: utf-8 -*-
from collections import Counter

N = int(input().strip())
a_list = list(map(int, input().rstrip().split()))
#-----

cnt_dic = Counter(a_list)

cnt=0
for i,value in cnt_dic.items():
    if i == value:
        continue
    else:
        cnt += min( abs(i- value), value )

print(cnt)
# Judge status: Accepted
P,Q,R = map(int, input().split())

print(min([P + Q, P + R, Q + R]))
# Judge status: Accepted
n,k=map(int,input().split())
for i in range(max(-1000000,k-n+1),min(1000001,n+k)):
  print(i)
# Judge status: Wrong Answer
S = input()

double = 0
for i in range(len(S) - 1):
    if S[i] == S[i+1]:
        double += 1

print(len(S) - double + 1)
# Judge status: Accepted
def resolve():
    N = int(input())
    ans = [0 for _ in range(100005)]
    for x in range(1, 105):
        for y in range(1, 105):
            for z in range(1, 105):
                tmp = x * x + y * y + z * z + x * y + y * z + z * x
                if tmp < 10005:
                    ans[tmp] += 1
    
    for i in range(1, N+1):
        print(ans[i])
    return
 
resolve()
# Judge status: Wrong Answer
n, k = map(int, input().split())
cnt = 0
mod = 10**9+7
for i in range(k,n+2):
    sum_min = i*(i-1) // 2
    sum_max = i*(2*n-i+1) // 2
    #print((sum_max - sum_min + 1))
    cnt = cnt +  (sum_max - sum_min + 1)%mod
print(cnt)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))

cnt1 = sum(i % 4 == 2 for i in a)
cnt2 = sum(i % 4 == 0 for i in a)
if n - 2 * cnt2 - max(1, cnt1) <= 0:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
import math

n = int(input())

for i in range(1, 50001):
    x = math.floor(i * 1.08)
    if x == n:
        print(i)
        break
else:
    print(":(")
# Judge status: Wrong Answer
n, a, b = map(int, input().split())
ans = -1
if abs(a-b) % 2 == 0:
    ans = abs(a-b) // 2
else:
    ans = min(a, abs(n-a), b, abs(n-b)) + abs(a-b)//2

print(ans)
# Judge status: Accepted
N,R = map(int, input().split())
ans = 100*(10-N)+R
if N>=10:
    print(R)
else:
    print(ans)
# Judge status: Wrong Answer
H = input().split()
sdy =0
if int(H[2]) > int(H[0]):
  sdy = int(H[2])*60 +int(H[3])-int(H[0])*60 +int(H[1]) - int(H[4])
else:
  H[2] = (int(H[2])+24)
  sdy = int(H[2])*60 +int(H[3])-int(H[0])*60 +int(H[1]) - int(H[4])
print(sdy)
# Judge status: Accepted
from itertools import accumulate
n, k, *A = map(int, open(0).read().split())
for _ in range(min(k, 50)):
    B = [0] * (n+1)
    for i in range(n):
        B[max(0, i-A[i])] += 1
        B[min(n, i+A[i]+1)] -= 1
    *A, = accumulate(B)
print(*A[:n])
# Judge status: Wrong Answer
k = input().split()
k.sort()
if k[0] == '5' and k[1] == '5' and k[2] == '7':
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
N,K=map(int,input().split())
h=list(map(int,input().split()))
cost=[0,abs(h[1]-h[0])]

for i in range(2,N):
    cand=10**5
    for j in range(K):
        if j==i:
            break
        cand=min(cand,cost[i-j-1]+abs(h[i]-h[i-j-1]))
    cost.append(cand)

print(cost[-1])
# Judge status: Wrong Answer
n,w=map(int,input().split())
l=[list(map(int,input().split())) for i in range(n)]
dp=[[0 for j in range(w+1)] for i in range(n+1)]
for i in range(n):
  for j in range(w+1):
    if l[i][0]<=j:
      dp[i+1][j]=max(dp[i][j],dp[i][j-l[i][0]]+l[i][1])
    else:
      dp[i+1][j]=dp[i][j]
print(dp[n][w])
print(dp)
# Judge status: Accepted
N = int(input())

power = 1

for i in range(N):
    power *= (i+1)
    if power > 1000000007:
        power %= 1000000007

print(power)
# Judge status: Wrong Answer
import heapq
n, h = map(int, input().split())

hq = []
nmax = 0
for i in range(n):
    a, b = map(int,input().split())
    nmax = max(nmax, a)
    heapq.heappush(hq, -b)
heapq.heappush(hq, -nmax)

ans = 0
while h >= 0:
    d = -heapq.heappop(hq)
    if d == nmax:
        ans+=max(0, (h+nmax-1)//nmax)
        break
    else:
        h -= d
        ans+=1
print(ans)
# Judge status: Wrong Answer
S = list(input())
T = list(set(S))
n = len(T)
m = len(S)
if m == 1:
  ans = 'YES'
elif n ==1:
  ans = 'NO'
elif n == 2:
  ans = 'NO'
else:
  ans = 'YES'
print(ans)
# Judge status: Accepted
s = input()

year = int(s[:4])
month = int(s[5:7])
day = int(s[8:])

if year == 2019 and month == 4 and day <= 30:
    print("Heisei")
elif year == 2019 and month < 4:
    print("Heisei")
elif year <= 2018:
    print("Heisei")
else:
    print("TBD")
# Judge status: Wrong Answer
S,T = str(input()).split()

print(S+T)
# Judge status: Wrong Answer
def main():
    c = 100
    x = int(input())
    y = 0
    while c < x:
        c = int(c * 1.01)
        y += 1
    
    print(y)
    return
main()
# Judge status: Accepted
S,W=map(int,input().split())

if W>=S:
    print("unsafe")

else:
    print("safe")
# Judge status: Accepted
N = int(input())
sticks = list(map(int, input().split()))
sticksSum = sum(sticks)
diffMin = sum(sticks)
plusSticks = 0
for i in range(len(sticks)):
    plusSticks += sticks[i]
    diffMin = min(diffMin, abs(2*plusSticks-sticksSum))
print(diffMin)
# Judge status: Accepted
# A - September 9
n=list(input())
if '9' in n:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
d = int(input())

eve = [' Eve Eve Eve', ' Eve Eve', ' Eve', '']
print('Christmas' + eve[d - 22])
# Judge status: Accepted
n = int(input())

s = 0
i = 0 
ans = []
# 値をカウントアップしていき、nを超える値になるまで繰り返す。
# 全ての値を保存する
while s < n:
  i += 1
  s += i
  ans.append(i)
  
delete = s - n # 取得した合計値からnを引き、差分を取得
if delete != 0: ans.remove(delete) # 差分を削除
  
for t in ans: print(t)
# Judge status: Accepted
n = int(input())
l = []
for i in range(n):
    a,b = map(int,input().split())
    l.append([b,a])
l.sort()
time = 0
for b,a in l:
    if time+a > b:
        print("No")
        exit()
    else:
        time += a
print("Yes")
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
k = sum(b) - sum(a)
cnt = 0
for i in range(n):
  if b[i] < a[i]:
    cnt += a[i] - b[i]
  elif (b[i] + a[i]) % 2 == 1:
    cnt += 1
if cnt <= k:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
a,b,c = map(int, input().split())
if a>c:
  print('No')
elif b>c:
  print('No')
elif (4*a*b) < (c*c - 2*c*(a+b) + (a+b)*(a+b)):
  print('Yes')
else:
  print('No')
# Judge status: Accepted
n,x,y = map(int, input().split())
a = [0 for i in range(n-1)]
for i in range(1,n):
    for j in range(i+1,n+1):
        if i<=x and y<=j:
            a[x-i+j-y] += 1
        elif abs(x-i)+abs(y-j)+1<j-i:
            a[abs(x-i)+abs(y-j)]+=1
        else:
            a[j-i-1]+=1
for i in a:
    print(i)
# Judge status: Accepted
#!/usr/bin/env python
# -*- coding: utf-8 -*-


def main():
  N, _ = map(int, input().split())
  S = sum(map(int, input().split()))

  if S > N:
    print(-1)
  else:
    print(N - S)


if __name__ == '__main__':
  main()
# Judge status: Wrong Answer
n,x,y = map(int,input().split())
dist = [0]*(n-1)
for i in range(n):
  for j in range(i+1,n):
    dist[min(j-i,abs(i-x)+abs(j-y)+1,abs(i-y)+abs(j-x)+1)-1] += 1
for i in range(n-1):
  print(dist[i])
# Judge status: Accepted
import math

Z = [int(input()) for _ in range(5)]

ans = 0
r = 0
for z in Z:
    if z%10 != 0:
        r = max(10 - z%10, r)
    ans += math.ceil(z/10) * 10

print(ans - r)
# Judge status: Accepted
a,b,x=map(int,input().split())
if a==0:
  print(b//x+1)
else:
  print((b//x)-((a-1)//x))
# Judge status: Accepted
from heapq import heapify, heappush, heappop

n, m = map(int, input().split())
A = list(map(int, input().split()))

A = list(map(lambda x: x * (-1), A))

heapify(A)
for i in range(m):
    x = heappop(A)
    x = (x + 1) // 2
    heappush(A, x)

print(-1 * sum(A))
# Judge status: Accepted
n, a, b = map(int, input().split())
mod = 10**9 + 7


def neko(n, r):
    p, q = 1, 1
    for i in range(r):
        p = p * (n - i) % mod
        q = q * (i + 1) % mod
    return p * pow(q, mod - 2, mod) % mod


print((pow(2, n, mod) - 1 - neko(n, a) - neko(n, b)) % mod)
# Judge status: Accepted
import sys
# sys.setrecursionlimit(10**10)
# N = int(sys.stdin.readline().rstrip())
# S = sys.stdin.readline().rstrip()
# N, K = map(int, sys.stdin.readline().rstrip().split())
X = list(map(int, sys.stdin.readline().rstrip().split()))
print(X.index(0) + 1)
# Judge status: Wrong Answer
A,B=map(int,input().split())
if (A+B)%2==0:
  print((A+B)/2)
else:
  print('IMPOSSIBLE')
# Judge status: Wrong Answer
N=int(input())
P=list(map(int,input().split()))
M=0
c=0
for i in range(N):
  if M<P[i]:
    M=P[i]
    c+=1
print(c)
# Judge status: Accepted
from decimal import *
A,B = [Decimal(i) for i in input().split()]
print(A*B//1)
# Judge status: Accepted
N = int(input())
i = 0
while 2 ** i <= N:
  i += 1
print(2 ** (i - 1))
# Judge status: Wrong Answer
s = input()
if s[-1] == "s":
  print(s[:-1]+'es')
else:
  print(s+'s')
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))
lis = []
for i in range(n-1):
    lis.append(a[i]^a[i+1])
ans = [26]
for i in range(n-1):
    ans.append(ans[i]^lis[i])
for i in range(len(ans)):
    ans[i] = str(ans[i])
print(" ".join(ans))
# Judge status: Wrong Answer
N, Q = map(int, input().split())
S = input()
acc = []
for i in range(1, len(S)+2):
    acc.append(S[0:i].count("AC"))

for i in range(Q):
    l, r = map(int, input().split())
    print(acc[r] - acc[l-1])
# Judge status: Wrong Answer
N = int(input())
A = int(input())
flag=0
for i in range(10000):
    for j in range(A):
        if N==500*i+j:
            flag=1
if flag==0:
    print("No")
else:
    print("Yes")
# Judge status: Wrong Answer
N = int(input())
a = list(map(int, input().split()))
cnt = 0
for i, k in enumerate(a):
    if i % 2 == 1 and k % 2 == 1:
        cnt += 1
print(cnt)
# Judge status: Accepted
N=int(input())
A=[0]*N
for x in range(1,101):
  for y in range(1,101):
    for z in range(1,101):
      if x**2+y**2+z**2+x*y+y*z+z*x<=N:
        A[x**2+y**2+z**2+x*y+y*z+z*x-1]+=1
for i in range(N):
  print(A[i])
# Judge status: Accepted
# -*- coding: utf-8 -*-
S = list(input())
K = int(input())

for i in range(len(S)):
    if S[i] == 'a':
        continue

    d = ord('z') - ord(S[i]) + 1
    if K >= d:
        S[i] = 'a'
        K -= d
    # print(K, d)

if K > 0:
    j = ord(S[-1]) + K % 26
    S[-1] = chr(j)

print(''.join(S))
# Judge status: Accepted
A, B, K = map(int, input().split())

L = [A+i for i in range(K) if A+i <= B]
R = [B-i for i in range(K) if B-i >= A]
S = set(L+R)
S = sorted(S)
for v in S:
    print(v)
# Judge status: Wrong Answer
S = input()
strs = ["erase", "eraser", "dreamer","dream"]
rtss = [s[::-1] for s in strs]
S_r = S[::-1]
for rts in rtss:
    S_r = S_r.replace(rts, "")
if len(S_r) == 0:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))
b = [a[i] - i - 1 for i in range(n)]
b = sorted(b)
if n % 2 == 1:
  print(b[(n-1)//2])
else:
  print((b[n//2] + b[n//2+1])//2)
# Judge status: Accepted
import math

n, m = (int(x) for x in input().split())

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

ans = 0
ans_n = 0
ans_m = 0

if 1 < n :
    ans_n = combinations_count(n, 2)

if 1 < m :
    ans_m = combinations_count(m, 2)

ans = ans_n + ans_m

print(ans)
# Judge status: Wrong Answer
N,X = map(int,input().split())

x = list(map(int,input().split()))
lst = [0]*N
for i in range(len(x)):
    lst[i] = abs(x[i] - X)
   
def find_gcd(x, y): 
    while(y): 
        x, y = y, x % y 
  
    return x 
if len(lst) > 1:
    num1=lst[0] 
    num2=lst[1] 
    gcd=find_gcd(num1,num2) 
  
    for i in range(2,len(lst)): 
        gcd=find_gcd(gcd,lst[i]) 
    print(gcd)
else:
    min(lst)
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))

c=0
ne=0
for i in range(n):
  c+=max((b[i]-a[i])//2,0)
  ne+=max(a[i]-b[i],0)

print("Yes" if c>=ne else "No")
# Judge status: Wrong Answer
a, b, c,d = map(int, input().split())
aa=a
cc=c
for i in range(a//d+1):
    cc = cc - b
    print(cc)
    if cc<1:
      print("Yes")
      break;
    aa = aa - d
    print(aa)
    if aa <1:
      print("No")
      break;
# Judge status: Accepted
a,b=map(int,input().split())
positive=0
zero=int(a<=0<=b)
negative=0
if b<0:
    negative=b-a+1
elif 0<a:
    positive=b-a+1
print('Zero' if zero==1 else 'Negative' if negative%2!=0 else 'Positive')
# Judge status: Accepted
import numpy as np

N = int(input())
A, B = [], []
for i in range(N):
    a, b = map(int, input().split())
    A.append(a if N & 1 else 2 * a)
    B.append(b if N & 1 else 2 * b)

a, b = int(np.median(A)), int(np.median(B))
if a > b:
    a, b = b, a
print(b - a + 1)
# Judge status: Wrong Answer
from math import log
n = int(input())


def make_list(n, x):
    return [x ** i for i in range(1, int(log(n, x))+1)]


sixes = make_list(n, 6)
nines = make_list(n, 9)
nums = [1] + sixes + nines

dp = [float('inf')] * (n+1)
dp[0] = 0
for num in nums:
    for i in range(1, n+1):
        if i == num:
            dp[i] = 1
        elif i > num:
            dp[i] = min(dp[i], dp[i-num]+1)
print(dp[n])
# Judge status: Accepted
import sys

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

if n == 0:
  print(x)
  sys.exit()
  
p = list(map(int, input().split()))

sub, up = x, x

while True:
  if sub not in p:
    print(sub)
    sys.exit()
  elif up not in p:
    print(up)
    sys.exit()
  sub -= 1
  up += 1
# Judge status: Accepted
n=int(input())
h=list(map(int,input().split()))
l=[]
for i in range(n-1):
    if h[i+1]-h[i]<=0:
        l.append(1)
    else:
        l.append(0)
ans=0
mn=0
for j in range(len(l)):
    if l[j]==0:
        ans=0
    else:
        ans+=1
        mn=max(ans,mn)
print(mn)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))

two = 0
four = 0
for a in A:
    cnt = 0
    while a % 2 == 0:
        a //= 2
        cnt += 1
    if cnt == 1:
        two += 1
    elif cnt > 1:
        four += 1

rest = N - four - two
two_merge = 1 if two > 0 else 0
rest += two_merge


if rest - 1 <= four:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
import numpy as np

n=int(input())
A=np.array(list(map(int,input().split())))
A = np.abs(A)

if 0 in A:
  print(np.sum(A))
else:
  print(np.sum(A) - np.min(A))
# Judge status: Wrong Answer
k = int(input())

ans = 0
for i in range(k + 1):
    for j in range(k + 1):
        for l in range(k + 1):
            for m in range(k, 0, -1):
                if i % m == 0 and j % m == 0 and l % m == 0:
                    ans += m
                    
print(ans)
# Judge status: Accepted
n = int(input())
if n % 2:
  print(0)
else:
  ans = 0
  for i in range(1, 26):
    ans += n//(2*5**i)
  print(ans)
# Judge status: Accepted
n = int(input())
A = [int(input()) for _ in range(n)]

ans = 0
for i in range(n):
    if A[i]%2==0:
        ans+=A[i]//2
    else:
        ans+=A[i]//2
        if i+1<n and A[i+1]!=0:
            A[i+1]-=1
            ans+=1
print(ans)
# Judge status: Accepted
import sys
from collections import defaultdict
sys.setrecursionlimit(10 ** 6)
input = sys.stdin.readline
N = int(input())
A = [int(x) for x in input().strip().split()]
C = defaultdict(int)
for a in A:
    C[a] += 1

sum = 0
for i, c in C.items():
    sum += (c * (c-1)) // 2

for a in A:
    print(sum - (C[a]*(C[a]-1))//2 + ((C[a]-1)*(C[a]-2))//2)
# Judge status: Wrong Answer
S = input()
T = input()
dic = {}
for i in range(len(S)):
    if T[i] not in dic:
        dic[T[i]] = S[i]
    elif dic[T[i]] != S[i]:
        print('No')
        exit()
print('Yes')
# Judge status: Accepted
from collections import Counter
def main():
    n = int(input())
    a = list(map(int,input().split()))
    count = Counter(a)
    ans = 0
    o2 = []
    for k, v in count.items():
        if v >= 2:o2.append(k)
        if v >= 4:ans = max(ans,k*k)
    o2.sort()
    if len(o2) >= 2:ans = max(ans,o2[-1] * o2[-2])

    print(ans)

if __name__ == '__main__':
    main()
# Judge status: Accepted
W, H, N = map(int, input().split())
xl, xh = 0, W
yl, yh = 0, H
for i in range(N):
    x, y, a = map(int, input().split())
    if a == 1:
        xl = max(xl, x)
    elif a == 2:
        xh = min(xh, x)
    elif a == 3:
        yl = max(yl, y)
    else:
        yh = min(yh, y)

if xl >= xh or yl >= yh:
    print(0)
else:
    print((xh-xl) * (yh-yl))
# Judge status: Accepted
arr = list(map(str,input().split()))
arr.sort()
print(int(arr[0]) + int(arr[2]+arr[1]))
# Judge status: Wrong Answer
n = int(input())
b = list(map(int, input().split()))
ans = [b[0]]
for i in range(1, n - 1):
    ans.append(min(b[i], b[i - 1]))
print(sum(ans) + max(b[n - 3], b[n - 2]))
# Judge status: Wrong Answer
import math
from functools import reduce


N = int(input())
A = list(map(int, input().split()))
P = int(1e9+7)

def lcm_base(x, y):
    ret = (x * y) // math.gcd(x, y)
    return ret


def lcm(iter):
    return reduce(lcm_base, iter, 1)


lcm_a = lcm(A)
"""
ans = 0
for a in A:
    ans = (ans + lcm_a//a) %P
print(ans)
"""
# Judge status: Accepted
s = input()
t = input()

def num_of_match(a,b):
    l = len(a)
    return sum([a[i] == b[i] for i in range(l)])


t_len = len(t)
nom_list = []
finish_flg = False
for i in range(len(s) - len(t) + 1):
    s_sub = s[i:i + t_len]
    nom = num_of_match(s_sub, t)
    num_mod = t_len - nom
    if num_mod == 0:
        print(0)
        finish_flg = True
        break
    else:
        nom_list.append(num_mod)

if not finish_flg:
    print(min(nom_list))
# Judge status: Wrong Answer
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

li = list(rr())
print('Yes' if len(list(itertools.groupby(li))) > 2 else 'No')
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))

num4 = 0
num2 = 0
num1 = 0
for i in A:
    if i % 4 == 0:
        num4 += 1
    elif i % 2 == 0:
        num2 += 1
    else:
        num1 += 1

if (num2 != 0) & (num4 >= num1):
    print('Yes')
elif (num2 == 0) & (num4 + 1 >= num1):
    print('Yes')
else:
    print('No')
# Judge status: Accepted
def main():
    a, b = map(int, input().split())
    if b == 1:
        print(0)
    elif b - a <= 0:
        print(1)
    else:
        if (b-1) % (a-1) == 0:
            print((b-1)//(a-1))
        else:
            print((b-1)//(a-1) + 1)
            
if __name__ == '__main__':
    main()
# Judge status: Accepted
s=input()
n=len(s)
count=0
for i in range(n):
  if i%2==0 :
    if s[i]=='R' or s[i]=='U' or s[i]=='D':
      count+=1
  elif i%2==1 or i==0:
    if s[i]=='L' or s[i]=='U' or s[i]=='D':
      count+=1
if count==n:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
H,N = map(int,input().split())
A = list(map(int,input().split()))

if sum(A)>=H:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
c = input()
A = [chr(ord('a') + i) for i in range(26)]
z = A.index("c")
print(A[z+1])
# Judge status: Accepted
n = int(input())
if n % 2 == 1:
    print(0)
    exit(0)
cnt = 0
five = 2 * 5
while n // five > 0:
    cnt += n // five
    five *= 5
print(cnt)
# Judge status: Wrong Answer
N = int(input())
town = [None]*N

for i in range(N):
    town[i] = list(map(int, input().split()))

avr_temp = 0
for i in range(N):
    for j in range(i+1, N):
        #町iから町jまでの距離を求める。
        avr_temp += ((town[i][0]-town[j][0])**2+(town[i][1]-town[j][1])**2)**0.5
avr = avr_temp * 2 / N
# Judge status: Accepted
a, b = map(int, input().split())
x = b - a - 1

ans = x * (x+1) // 2 - a
print(ans)
# Judge status: Accepted
def solve():
    N = int(input())
    A = list(map(int,input().split()))

    n_negative = 0
    for a in A:
        if a < 0:
            n_negative += 1

    abs_sum = sum(map(abs,A))
    if n_negative % 2 == 0:
        print(abs_sum)
    else:
        print(abs_sum - 2 * min(map(abs,A)))

if __name__ == '__main__':
    solve()
# Judge status: Accepted
N = int(input())

patterns = []
patterns.append(1)

f = 6
a = 6
while a <= N:
    patterns.append(a)
    a *= f

f = 9
a = 9
while a <= N:
    patterns.append(a)
    a *= f

dp = [float('inf')] * (N + 1)
dp[0] = 0
for n in range(1, N + 1):
    for p in patterns:
        if n - p < 0:
            continue

        dp[n] = min(dp[n - p] + 1, dp[n])


print(dp[-1])
# Judge status: Accepted
N, K = map(int, input().split())
a_list = list(map(int, input().split()))

num_dic = {}
for a in a_list:
  count = num_dic.get(a, 0)
  num_dic[a] = count + 1

replace_num = len(num_dic.keys()) - K
replace_num = 0 if replace_num < 0 else replace_num
ans = 0
for i, taple in enumerate(sorted(num_dic.items(), key = lambda x:x[1])):
  if i == replace_num:
    break
  ans += taple[1]

print(ans)
# Judge status: Wrong Answer
N,T1=int(input()),int(input())
for n in range(1,N):
    T2=int(input())
    t,T=sorted((T1,T2))
    while t!=0:
        T,t=t,T%t
    T1*=(T2/T)#TはT1とT2の最大公約数
print(int(T1))
# Judge status: Wrong Answer
N = int(input())
N = N / 2 + N % 2
print(N)
# Judge status: Wrong Answer
a, b, c, x, y = map(int, input().split())
ans = 1000000000000
for i in range(50000):
  ans = min(2 * c * i + max(0, x-i) * a + max(0, y-i) * b, ans)
print(ans)
# Judge status: Accepted
k, a, b = map(int, input().split()) 
biscet = 1

rate = (b-a)/2

if ( rate > 1):
    k-=(a-1)
    biscet+=(a-1)
    biscet += int(k/2) * (b-a)
    biscet += k%2
    
else:
    biscet += k    

print(biscet)
# Judge status: Wrong Answer
s=input()
count=0
for i in range(0,len(s)//2):
    if s[i]!=s[len(s)-1-i]:
        count=count+1