peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
import collections

n, k = map(int, input().split())
a = list(map(int, input().split()))
cnt = len(set(a))
ans = 0
l = collections.Counter(a)
for i, v in l.most_common()[::-1]:
    if k < cnt:
        cnt -= v
        ans += v
print(ans)
# Judge status: Wrong Answer
N = int(input())
a = list(map(int,input().split()))

if N == 2:
  print(a[1],a[0])
  exit()
for i in range(N):
  if i+3 < N:
    print(a[i+1]^a[i+2]^a[i+3],end = " ")
  else:
    print(a[i-1]^a[i-2]^a[i-3],end = " ")
# Judge status: Accepted
a = ["R","U","D"]
b = ["L","U","D"]
s = input()
cnt = 0
for i in range(len(s)):
    if i%2==0:
        if s[i] in a:
            pass
        else:
            cnt = 1
            break
    else:
        if s[i] in b:
            pass
        else:
            cnt = 1
            break
if cnt == 0:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
n, m, q = map(int, input().split())
abcd = [list(map(int, input().split())) for i in range(q)]
import itertools

A = []
M = []
for i in range(1, m+1):
    M.append(i)
for team in itertools.combinations(M, n):
    A.append(team)
    
B = [0]*len(A)
for i in range(q):
    a = abcd[i][0]
    b = abcd[i][1]
    c = abcd[i][2]
    d = abcd[i][3]
    for j in range(len(A)):
        if A[j][b-1] - A[j][a-1] == c:
            B[j] += d

print(B)
# Judge status: Wrong Answer
x, y = [int(i) for i in input().split()]

gr = [4,6,9,11]

if (x ==2) | (y ==2):
    print("No")
    
elif (x in gr) & (y in gr):
    print("Yes")
else:
    print("Yes")
# Judge status: Accepted
X,Y = map(int,input().split())
if Y - 2 * X >= 0 and 2 * X - Y / 2 >= 0 and (Y - 2 * X) % 2 == 0:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
N = int(input())
H = list(map(int, input().split()))

ans = 0
for i in range(N-1):
  if H[i] >= H[i+1]: ans += 1
  else: ans = 0
    
print(ans)
# Judge status: Wrong Answer
dishes = [int(input()) for i in range(5)]
min_dish = dishes.pop(dishes.index(min(dishes)))
sum = 0
for d in dishes:
  sum += -int(-d)
print(sum + min_dish)
# Judge status: Accepted
a = list(map(int, input().split()))
if a[0]%2 == 0 or a[1]%2 == 0 or a[2]%2 == 0:
  print(0)
else:
  a.sort()
  print(a[0]*a[1])
# Judge status: Wrong Answer
#!python3.4.3

import math

h = int(input())
x = math.floor(h/2)
n = 2
count = n
while x > 1:
    x = math.floor(x/2)
    n = n*2
    count += n
    
print(count+1)
# Judge status: Accepted
def operation(s,t):
    cnt = 0
    if s == t:
        return cnt
    for i in range(len(s)):
        if s[i]!=t[i]:
            cnt+=1
    return cnt

def main():
    s = str(input())
    t = str(input())
    print(operation(s,t))

if __name__ == '__main__':
    main()
# Judge status: Wrong Answer

def solve():
    N = int(input())
    A = list(map(int,input().split()))
    
    Taku = []

    A.sort()
    A.reverse()
    flg = 0

    ans = 0

    for an in A:
        if flg == 0:
            Taku.append(an)
            flg = 1
        else:
            Takudiff = [min(Taku[i], Taku[i-1]) for i in range(len(Taku))]
            Taku.insert(Taku.index(max(Takudiff)), an)
            ans += max(Takudiff)

    print(ans)

solve()
# Judge status: Accepted
from collections import defaultdict
from math import gcd
import time
import sys
from collections import Counter
import itertools
import math
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
start = time.time()
# N = list(map(int, input()))[::-1]
N = input()

if N[1] == 'B':
    print('ARC')
else:
    print('ABC')
# Judge status: Accepted
a, b, k = map(int, input().split())
cnt = 0
for i in reversed(range(1, 101)):
    if a%i==0 and b%i==0:
        cnt += 1
        if cnt == k:
            print(i)
            break
# Judge status: Wrong Answer
a=list(input())
b=list(input()).reverse()
print('NYOE S'[a==b::2])
# Judge status: Wrong Answer
n = int(input())
results = 0
number = 0
for i in range(n+1):
    if i == 0:
        continue
    count = 0
    while True:
        if i % 2 == 0:
            count += 1
            i = i / 2
        else:
            if results < count:
                results = count
                number = n
            break
print(number)
# Judge status: Accepted
def main():
    N,A,B = map(int,input().split())
    if abs(A-B)%2==1:
        print(min(A-1,N-B)+1+(B-A-1)//2)
    else:
        print(abs(A-B)//2)

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

n, m = 0,0
for a in A:
    if not a % 4:
        n += 1
    if not a % 2:
        m += 1

m -= n
if 2 * n >= N-1:
    print('Yes')

elif 2*n + m >= N:
    print('Yes')

else:
    print('No')
# Judge status: Accepted
n,k=map(int,input().split())
a,b,c=map(int,input().split())
t=input()
d={"r":c,"s":a,"p":b}
ans=0
for i in range(n):
    if i<k:
        ans+=d[t[i]]
    elif t[i]!=t[i-k]:
        ans+=d[t[i]]
    else:
        t=t[:i]+"z"+t[i+1:]
print(ans)
# Judge status: Accepted
s,_,*q=open(0)
a='S'
p=1
for q in q:
  try:
    q,f,c=q.split()
    if(f<'2')^p:a+=c
    else:a=c+a
  except:p^=1
print(a.replace('S',s[:-1])[::p or-1])
# Judge status: Accepted
n=int(input())
for i in range(1,10):
  x = 111*i
  if x >= n:
    print(x)
    break
# Judge status: Accepted
n, m = map(int, input().split())

s = [tuple(map(int, input().split())) for _ in range(n)]
c = [tuple(map(int, input().split())) for _ in range(m)]

for a, b in s:
    d = float('inf')
    for i in range(m):
        x, y = c[i]
        if abs(a - x) + abs(b - y) < d:
            d = abs(a - x) + abs(b - y)
            ans = i + 1
    print(ans)
# Judge status: Accepted
a, b, c, k = map(int, input().split())

if k%2 == 0:
    print(a-b)
else:
    print(b-a)
# Judge status: Accepted
def mi():
    return map(int, input().split())

def ii():
    return int(input())

def main():
    S = input()
    K = ii()
    for i in range(min(len(S), K)):
        if S[i] != '1':
            print(S[i])
            return
    print(1)

if __name__ == '__main__':
    main()
# Judge status: Accepted
N, M = map(int, input().split())
A = sorted([int(i) for i in input().split()])
BC = [tuple(map(int, input().split())) for _ in range(M)]
BC.sort(key=lambda x: x[1], reverse=True)

ans = 0
j = 0
b = 0
for i in range(N):
    if j < M and A[i] < BC[j][1]:
        ans += BC[j][1]
        b += 1
        if b == BC[j][0]:
            j += 1
            b = 0
    else:
        ans += A[i]
print(ans)
# Judge status: Wrong Answer
N = int(input())
csf = [tuple(map(int,input().split())) for i in range(N-1)]

for i in range(N-1):
    t = 0
    for c,s,f in csf[i:]:
        t = max(t, s)
        if t%f:
            t += 0--t//f
        t += c
    print(t)

print(0)
# Judge status: Accepted
a, b, c = map(int, input().split())
print('Yes' if a <= c <= b else 'No')
# Judge status: Accepted
N,K = map(int, input().split())
_ = input()
print(-(-(N-1)//(K-1)))
# Judge status: Accepted

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

print("Yes" if a+b >= c else "No")
# Judge status: Accepted
S = input()
N = len(S)
M = int((N-1)/2)
a = 0
for i in range(M):
    if S[i] == S[M-1-i] and S[i] == S[N - 1 - i]:
        a += 1
    else:
        break

if a == M:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
a, b = map(int, input().split())

ans = sorted([str(a) * b, str(b) * a])[0]

print(ans)
# Judge status: Wrong Answer
n = int(input())
print(n%500%5*5+n//500*1000)
# Judge status: Accepted
s = list(input())
t = input()

prev = s
for i in range(len(s)):
    prev = list(prev[-1]) + prev[:-1]
    if ''.join(prev) == t:
        print('Yes')
        exit()

print('No')
# Judge status: Accepted
n,*a=map(int,open(0).read().split())
ans=10**9
for i in range(-100,101):
  c=0
  for a_i in a:
    c+=(a_i-i)**2
  ans=min(ans,c)
print(ans)
# Judge status: Wrong Answer
a,b,c=map(int,input().split())
M = b % c
m = a % c
res = (b-M)/c+(m-a)/c
K=int(res)+1
print(K)
# Judge status: Accepted
n = int(input())
s = [input() for i in range(n)]
s.sort()

poll = []
count = []
pre_poll = ''
for i in range(n):
    if pre_poll == s[i]:
        count[-1] += 1
    else:
        poll.append(s[i])
        count.append(1)
        pre_poll = s[i]
        
poll_dict = dict(zip(poll, count))
poll_dict = dict(sorted(poll_dict.items(), key=lambda x:x[1], reverse=True))

val = next(iter(poll_dict.values()))
for t in poll_dict.items():
    if val == t[1]:
        print(t[0])
    else:
        break
# Judge status: Accepted
X=int(input())
for i in range(1,X+1):
  if (i*(i+1))//2>=X:
    print(i)
    break
# Judge status: Wrong Answer
n, k = map(int, input().split())

if k == 1:
    print(0)
    exit()
    
def gcd(a,b):
  while b!=0:
    a,b=b,a%b
  return a

tmp = gcd(n, k)
low = 10**19

while True:
    tmp = abs(tmp-k)
    if tmp < low:
        low = tmp
        n = tmp
    else: break

print(low)
# Judge status: Accepted
word = input()
if str.isupper(word):
    print('A')
elif str.islower(word):
    print('a')
# Judge status: Accepted
target,min_t,max_t=(int(x) for x in input().split())
al=[]
for i in range(target+1):
  ii = sum(list(map(int,str(i))))
  if min_t <= ii <= max_t:
      al.append(i)
print(sum(al))
# Judge status: Accepted
s = input()
n = int(input())
t = ''
for i in range(n):
    q = input().split()
    if len(q) == 1:
        t, s = s, t
    elif len(q) == 3:
        if q[1] == '1':
            t += q[2]
        elif q[1] == '2':
            s += q[2]

t = t[::-1]
print(t + s)
# Judge status: Wrong Answer
a,b,c,d = map(int,input().split())

ans = 0

if ans < a*c:
    ans = a*c

if ans < a*d:
    ans = a*d

if ans < b*c:
    ans = b*c

if ans < b*d:
    ans = b*d

print(ans)
# Judge status: Wrong Answer
d = raw_input()
a, b, c =  d.split()
a = int(a)
b = int(b)
c = int(c)
if (a==b):
  if c == a:
    print("Yes")
  else:
    print("No")
else:
  if a==c or b == c:
    print("Yes")
  else:
    print("No")
# Judge status: Accepted
N = int(input())
value = [[0]*3 for _ in range(N+1)]
for i in range(N):
  a = list(map(int, input().split()))
  for k in range(3):
    value[i+1][k] = a[k]

dp = [[0]*3 for _ in range(N+1)]
for i in range(1,N+1):
  for j in range(3):
    for k in range(3):
      if j == k:
        continue
      dp[i][k] = max(dp[i][k], dp[i-1][j] + value[i][k])
ans = 0
for k in range(3):
  ans = max(ans, dp[N][k])
  
print(ans)
# Judge status: Accepted
X,Y,Z = map(int,input().split())
p = X - Z
a = Z+Y
ans = p//a
print(ans)
# Judge status: Accepted
a, b, c = list(map(int, input().split()))

if a == b + c or a + b == c or a + c == b:
  print('Yes')
else:
  print('No')
# Judge status: Wrong Answer
N=int(input())
A=list(map(int,input().split()))
s=[]
for i in range(1,N+1):
  s.append(A.index(i)+1)
print(s)
# Judge status: Wrong Answer
def main():
    from collections import deque
    n, m, *ab = map(int, open(0).read().split())
    c = list(zip(ab[::2], ab[1::2]))
    c = sorted(c, key=lambda x: (-x[1], -x[0]))

    q = deque(c)
    ans = 0
    while m and q:
        a, b = q.popleft()
        if a <= m:
            ans += b
            m -= 1

    print(ans)


if __name__ == '__main__':
    main()
# Judge status: Accepted
from collections import Counter
s = Counter(list(input()))
if len(s)==3:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
import bisect
# from collections import deque
# from collections import Counter
# from fractions import gcd # >=Python3.5 # lcm（最小公倍数） = (a*b)//gcd(a,b)
# from fractions import Fraction
# from math import gcd # <Python3.5
# from math import sqrt
 
n = int(input())
li = [int(input()) for i in range(n)]
li = [-x for x in li]

X = []
X.append(li[0])

for i in range(1,n):
    idx = bisect.bisect_right(X,li[i])
    if idx==len(X):
        X.append(li[i])
    else:
        X[idx] = li[i]

print(len(X))
# Judge status: Accepted
# coding: utf-8
N,M=map(int,input().split())
L=[]
B=[]
A=[]
flg=0
cnt=0
for i in range(M):
    a,b=list(map(int,input().split()))
    L.append([a,b])
    if a==1:
        B.append(b)
        cnt+=1
    elif b==N:
        A.append(a)
        
#print(L)
ans=[]
if len(set(A)&set(B))==0:
    print('IMPOSSIBLE')
else:
    print('POSSIBLE')
# Judge status: Wrong Answer
N = int(input())
S = [input() for _ in range(N)]
Common = list(S[0])
for s in S[1:]:
    Common = [x for x in Common if x in s]
print(''.join(sorted(Common)))
# Judge status: Wrong Answer
a = int(input())
s = input()
if a>=3200:
  print('red')
else:
  print(s)
# Judge status: Wrong Answer
a, b, k = map(int, input().split())

min = [0] * k
max = [0] * k

for i in range(k):
  if a+i > b:
    break
  min[i] = a+i

for n in range(k):
  if b-n < a:
    break
  max[n] = b-n

ans = min + max
ans.sort()
ans = set(ans)


for j in ans:
  if j == 0:
    continue
  print(j)
# Judge status: Accepted
A, B = map(int, input().split())

total = A + B

if total % 3 == 0 or A % 3 ==0 or B % 3 ==0:
    print("Possible")
else:
    print("Impossible")
# Judge status: Wrong Answer
def f(n):
  x = 0
  for i in range(2, int(n ** 0.5 + 2)):
    if n == 1:
      x = 1
      break
    elif n == 2:
      x = 2
      break
    if n % i == 0:
      x += 1
  else:
    x += 2
  return x

n = int(input())
ans = 0
for k in range(1, n + 1):
  print(k, f(k))
  ans += k * f(k)

print(ans)
# Judge status: Accepted
n = int(input())
print(800*n - 200*(n//15))
# Judge status: Accepted
s=input()
l=len(s)
amari=[0]*2019
amari[0]=1

d=0
digi=1

for c in s[::-1]:
    d=(int(c)*digi + d)%2019
    amari[d]+=1
    digi=(digi*10)%2019

ans=0
for i in amari:
    ans+=i*(i-1)//2
print(ans)
# Judge status: Accepted
s = input()
count = 0
if(s[1]=='R'):
  for i in s:
    if(i=='R'):
      count+=1
else:
  for i in s:
    if(i=='R'):
      count = 1
print(count)
# Judge status: Wrong Answer
S = input()
n = len(S) + 1

A = [0 for _ in range(n)]
for i in range(n - 1):
    prev = A[i]
    if S[i] == "<":
        A[i + 1] = max(A[i + 1], prev + 1)

for i in range(n - 2, 0, -1):
    prev = A[i + 1]
    if S[i] == ">":
        A[i] = max(A[i], prev + 1)

print(sum(A))
# Judge status: Accepted
n,k=map(int,input().split())
a=list(map(int,input().split()))

tmp=0

ans=[]
for i in range(n):
    if i>=k:
        if a[i]>a[i-k]:
            ans.append("Yes")
        else:
            ans.append("No")




for item in ans:
    print(item)
# Judge status: Accepted
a,b=list(map(int,input().split()))
if a==1:
    a=14
if b==1:
    b=14

if a>b:
    print("Alice")
elif a<b:
    print("Bob")
else:
    print("Draw")
# Judge status: Accepted
import math
a,b,H,M=map(int,input().split())
theta=abs(30*H+0.5*M-6*M)*math.pi/180
ans=math.sqrt(a**2+b**2-2*a*b*math.cos(theta))
print(ans)
# Judge status: Accepted
N=int(input())
A=list(map(int,input().split()))

t=1
for i in range(len(A)):
    if(A[i]==t):
        t+=1
if(t==1):
    print(-1)
else:   
    print(N+1-t)
# Judge status: Accepted
x, a, b = map(int, input().split())
if abs(x-a) < abs(x-b):
  print("A")
else:
  print("B")
# Judge status: Accepted
import functools

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

def euclid(a, b):
    if b == 0:
        return a
    else:
        return euclid(b, a%b)

def gcd(nums):
    return functools.reduce(euclid, nums)

print(gcd(A))
# Judge status: Accepted
pre=-1
n=int(input())
al=list(map(int,input().split()))
bl=list(map(int,input().split()))
cl=[0]+list(map(int,input().split()))
ans=0
prec=0
for  a,b in zip(al,bl):
    ans+=b
    if pre+1==a:ans+=cl[pre]
    pre=a
print(ans)
# Judge status: Accepted
n, m = map(int, input().split())
N = 10 ** 5  # N は必要分だけ用意する
fact = [1, 1]  # fact[n] = (n! mod p)
for i in range(2, N + 1):
    fact.append((fact[-1] * i) % (10**9+7))
result = 0
if abs(n-m) < 2:
    if n == m:
        result = 2*(fact[n]**2)
    else:
        result = fact[n]*fact[m]
print(result%(10**9+7))
# Judge status: Accepted
a,b,c = map(int, input().split())

print(c, a, b)
# Judge status: Accepted
n, m = list(map(int, input().split()))

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

possibilities = [False] * n
possibilities[0] = True
nums = [1] * n

for i in range(m):
    x = moves[i][0] - 1
    y = moves[i][1] - 1

    if possibilities[x]:
        possibilities[y] = True

    nums[x] -= 1
    nums[y] += 1
    if nums[x] == 0:
        possibilities[x] = False

print(sum(possibilities))
# Judge status: Wrong Answer
N = int(input())
S = list(str(input()))

if N == 1:
    print('No')
    exit()
for i in range(int(N/2)):
    if S[i] != S[int(N/2)+i]:
        print('No')
        exit()
print('Yes')
# Judge status: Wrong Answer
h = int(input())

attack = 1
while h > 0 :
    h = h // 2
    print(h)
    attack *= 2

print(attack - 1)
# Judge status: Wrong Answer
def main(x):
  return int(x)**2
main(input())
# Judge status: Wrong Answer
l = str(int(input()))
n = []

for i in range(len(l)):
    n.append((l)[i])
print(n[-1])

if n[-1] == '2' or n[-1] == '4' or  n[-1] == '5' or n[-1] == '7' or  n[-1] == '9':
    print("hon")
elif  n[-1] == '3':
    print("bon")
else:
    print("pon")
# Judge status: Accepted
H, A = map(int,input().split())
if H <= A:
  print(1)
else:
  if H%A==0:
    print(H//A)
  else:
    print(H//A+1)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
A = sorted(A, reverse = True)
print (sum(A[::2]) - sum(A[1::2]))
# Judge status: Accepted
s = input()
t = input()
s=sorted(s)
t=sorted(t,reverse = True)
if s < t:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
a, b = map(int, input().split(" "))
print(a*b)
# Judge status: Accepted
k , n = map(int, input().split())
a = list(map(int, input().split()))
d = []

for i in range(1, n):
    y = a[i]
    x = a[i-1]
    d.append(y-x)
d.append(k - (a[n-1] - a[0]))
d.sort(reverse = True)
print(k-d[0])
# Judge status: Accepted
a, b = list(map(int, input().split()))

if a > 0 and b > 0:
  print("Positive")

elif a < 0 and b < 0:
  if abs(b - a) % 2 == 1:
    print("Positive")

  else:
    print("Negative")

elif a <= 0 and b >= 0:
  print("Zero")
# Judge status: Accepted
s=input()
li=[i for i in s]
p="abcdefghijklmnopqrstuvwxyz"
for i in p:
    if li.count(i)%2==1:
        print("No")
        exit()
else:
    print("Yes")
# Judge status: Wrong Answer
from operator import itemgetter
N, M = map(int, input().split())
AB = sorted([list(map(int, input().split())) for i in range(N)], key=itemgetter(0))
ans, tmp = 0, 0
print(AB)
for ab in AB:
    if ab[1] + tmp < M:
        tmp += ab[1]
        ans += ab[0] * ab[1]
        print(tmp, ans)
    else:
        ans += (M - tmp) * ab[0]
        break
print(ans)
# Judge status: Accepted
n,m=map(int,input().split())
sc=[list(map(int,input().split())) for _ in range(m)]
ans=-1
for i in range(10**3):
    if (len(str(i))==n):
        flag=1
        for s,c in sc:
            if str(i)[s-1] != str(c):
                flag=0
        if flag==1:
            ans =i
            break
print(ans)
# Judge status: Wrong Answer
N, M=map(int, input().split())
print(N*(N-1)//2, M*(M-1)//2)
# Judge status: Accepted
a,b,c=map(int,input().split())

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

if s%4==0:
    print("YES")
else:
    print("NO")
# Judge status: Wrong Answer
n = int(input())
lst = []
for i in range(n):
	lst.append(list(map(int,input().split())))
print(lst)

cnt = 0

for i in range(n):
	if lst[i][0]==lst[i][1]:
		cnt += 1
	else:
		cnt = 0
	if cnt == 3:
		print('Yes')
		exit()
print('No')
# Judge status: Wrong Answer
N, K = map(int, input().split())
d = []
A = []

s = set([i for i in range(1, N+1)])
print(s)
rs = set()

for i in range(K):
    d.append(int(input()))
    A.append(list(map(int, input().split())))

for i in range(K):
    for a in A:
        for j in a:
            rs.add(j)

for i in rs:
    s.remove(i)

print(len(s))
# Judge status: Accepted
N, M = map(int, input().split())
A = [-1] * N
valid = True
for i in range(M):
  s, c = map(int, input().split())
  if A[s - 1] < 0:
    A[s - 1] = c
  elif A[s - 1] != c:
    valid = False
if A[0] < 0:
  A[0] = 1 if 1 < len(A) else 0
if 1 < len(A) and A[0] < 1:
  valid = False
for i in range(1, N):
  if A[i] < 0:
    A[i] = 0
print(''.join([str(a) for a in A]) if valid else -1)
# Judge status: Wrong Answer
def left(x):
    a = 0
    while x-1 > 0 and s[x-1]=='<':
        a += 1
        x -= 1
    return a

def right(x):
    a = 0
    while x+1 < len(s) and s[x+1]=='>':
        a += 1
        x += 1
    return a

s = input()
ans = 0

for i in range(len(s)+1):
    ans += max(left(i), right(i))
print(ans)
# Judge status: Accepted
n = int(input())
cnt = 0
for i in range(1, n+1):
  if len(str(i)) % 2 != 0:
    cnt += 1

print(cnt)
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))
a.sort()
print(sum(a[n:2*n]))
# Judge status: Accepted
x = int(input())
p5 = [i ** 5 for i in range(121)]

a = 0
b = 0

for _p5 in p5:
  if _p5 + x in p5:
    a = p5.index(_p5 + x)
    b = p5.index(_p5)
    break
  
  if x - _p5 in p5:
    a = p5.index(x - _p5)
    b = -(p5.index(_p5))
    break

print(str(a) + " " + str(b))
# Judge status: Accepted
s=input()

flag=True

for i in range(1,len(s)):
    if s[i-1]==s[i]:
        flag=False

if flag:
    print("Good")
else:
    print("Bad")
# Judge status: Wrong Answer
n = int(input())
a = sorted([int(input()) for _ in range(n)])

def func():
    for i in range(len(a)):
        if sum(a[i:]) % 10 != 0:
            return sum(a[i:])

    return 0

print(func())
# Judge status: Accepted
a,b=map(int,input().split())
print(-(-(a+b)//2))
# Judge status: Wrong Answer
time,rate = map(int,input().split())
ans = 0
if time >= 10:
  ans = rate
else:
  ans = rate - 100*(10 - time)
print(ans)
# Judge status: Wrong Answer
n = int(input())
p = list(map(int,input().split()))
c = 0
for i in range(n-1):
    if p[i+1]-p[i] == 1:
        c += 1

if c >= n-3:
    print("YES")
else:
    print("NO")
# Judge status: Wrong Answer
a,b,c=map(int,input().split())
k=int(input())
d=max(a,b,c)
print(a+b+c-d+2*k*d)
# Judge status: Accepted
n, m=map(int,input().split())
if(n%m==0):
  print('0')
else:
  print('1')
# Judge status: Accepted
A, B = map(int, input().split())
print(int(A * B))
# Judge status: Wrong Answer
N , M = map(int,input().split())
L = []
for i in range(M):
    a,b = map(int,input().split())
    L.append(a)
    L.append(b)
for j in range(N+1):
    ans = L.count(j)
    print(j)
# Judge status: Accepted
x,n=map(int,input().split())
p=list(map(int,input().split()))

l=list(range(102))

for i in range(n):
  l.remove(p[i])

#print(l)
ans=0
dif=1000

for i in range(102-n):
  temp=abs(l[i]-x)
  if temp<dif:
    dif=temp
    ans=l[i]
print(ans)
# Judge status: Wrong Answer
x,y=map(int,input().split())
a=y/x
i=1
while 2**i<=a:
    i+=1
print(i)
# Judge status: Accepted
from collections import defaultdict

n = int(input())
dct = defaultdict(int)

for i in range(n):
    s = input()
    sorted_s = "".join(sorted(s))
    dct[sorted_s] += 1

ans = 0
for a, b in dct.items():
    ans += b *(b-1)//2

print(ans)
# Judge status: Accepted
#!/usr/bin/env python3

def main():
    n, m = map(int, input().split())
    a = list(map(int, input().split()))
    sa = sum(a)
    if sa > n:
        print(-1)
        return
    print(n - sa)

if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
S=input()
tmp=S[0]
i=1
ans=1
while i<len(S):
    # print(S[i],tmp)
    if S[i]!=tmp:
        ans+=1
        tmp=S[i]
        i+=1
    else:
        ans+=1
        tmp=S[i:i+2]
        i+=2
if S[-2]==S[-1]:
    ans-=1
print(ans)
# Judge status: Accepted
import math


def main():
    n, k = map(int, input().split())
    As = list(map(int, input().split()))
    ans = math.ceil((n-1)/(k-1))
    print(ans)


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
import numpy as np
MOD = 10 ** 9 + 7
N = int(input())
A = list(map(int,input().split()))
cnt = []
A = np.array(A)
for _ in range(60):
    ad = A % 2
    cnt.append(sum(ad))
    A = A // 2
ans = 0
for i in range(60):
    num0 = N - cnt[i]
    num1 = cnt[i]
    ans += (num0 * num1) * (2 ** i)
print(ans % MOD)
# Judge status: Wrong Answer
S,W = map(int,input().split())
if S >= W :
    print("safe")
else:
    print("unsafe")
# Judge status: Wrong Answer
N=int(input())
if N%2==0:
  print((N/2)**2)
else:
  print((N//2)*((N//2)+1))