peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
n=int(input())
temp=str(input())
templ=list(temp)
tempb=templ[len(templ)-1]
w=[0]*n
w[0]=temp
for i in range(0,n-1):
  temp=str(input())
  templ=list(temp)
  if temp in w or tempb!=templ[0]:
    print("No")
    break
  tempb=templ[len(templ)-1]
  w[i]=temp
else:
  print("Yes")
# Judge status: Accepted
n = int(input())
a1 = list(map(int, input().split()))
a2 = list(map(int, input().split()))
ans = 0
for i in range(n):
    candies = sum(a1[:i + 1] + a2[i:])
    ans = max(ans, candies)
print(ans)
# Judge status: Wrong Answer
k = int(input())
if k%2==0:
    print(int((k//2)**2))
else:
    print(int(((k-1)//2)*(k//2)))
# Judge status: Accepted
A,B,T=map(int,input().split())
print(int(((T+0.5)//A)*B))
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))
a.append(0)
m = 1000
s = 0

for i in range(n):
    if a[i] < a[i + 1]:
        s = m//a[i]
        m = m - a[i]*s
    else:
        m = m + a[i]*s
        s = 0

print(m)
# Judge status: Accepted
import sys

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


def main():
    S = readline().strip()
    N = len(S)

    if (
        S == S[::-1]
        and S[: (N - 1) // 2] == S[: (N - 1) // 2][::-1]
        and S[(N + 1) // 2 :] == S[(N + 1) // 2 :][::-1]
    ):
        print('Yes')
    else:
        print('No')

    return


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
from collections import Counter
N=int(input())
A=list(map(int, input().split()))
C=Counter(A)
L=[]
for i in C:
  if C.get(i)>=2:
    L.append(i)
L.sort()
if len(L)>=2:
  print(L[-1]*L[-2])
else:
  print(0)
# Judge status: Wrong Answer
n = int(input())
l = list(map(int, input().split()))
l.sort()
length = [0]*(10**3+1)

for i in range(n):
  length[l[i]] += 1
  
for i in range(10**3+1):
  length[i] += length[i-1]

ans = 0
for i in range(n):
  for j in range(i+1, n):
    ans += length[min(10**3, l[i]+l[j]-1)] - length[l[j]]
print(ans)
# Judge status: Wrong Answer
N = int(input())
a = [int(input()) for _ in range(N)]
ans = 1
seen = [0] * N
seen[0] = 1
now = a[0]

while True:
    if now == 1 or seen[now-1] == 1:
        print(-1)
        break
    if now == 2:
        print(ans)
        break
    now = a[now-1]
    seen[now-1] = 1
    ans += 1
# Judge status: Accepted
N, C, K = map(int, input().split())
T = [0 for _ in range(N)]
for __ in range(N):
    T[__] = int(input())

T.sort()
bus_count = 1
bus_rest = C
bus_depert = T[0]+K

for ix in range(N):

    if T[ix] <= bus_depert and bus_rest > 0:
        bus_rest -= 1

    else:
        bus_count += 1
        bus_depert = T[ix] + K
        bus_rest = C - 1

print(bus_count)
# Judge status: Accepted
import numpy as np
n,k = map(int,input().split())
c = [0] * (10**5+1)
for _ in range(n):
  a,b = map(int,input().split())
  c[a] += b

A = np.array(c,dtype=np.int64)
A = A.cumsum()
answer = (A >= k).nonzero()[0].min()
print(answer)
# Judge status: Wrong Answer
import sys
S = list(input())
s = list(set(S))
s.sort()
alfa = list('abcdefghijklmnopqrstuvwxyg')
ans = 0
if(len(s)==len(alfa)):
  print('None')
else:
  for i in range(len(s)):
    if(s[i]!=alfa[i]):
      print(alfa[i])
      sys.exit()
# Judge status: Accepted
import itertools
n=int(input())
s=input()
d=[0]
for i in s:
  if i=="W":
    d.append(1)
  else:
    d.append(0)

accum=list(itertools.accumulate(d))
ans=10**9
count=0
for i in range(1,n+1):
  count+=accum[i-1]-accum[0]
  #左のWの数
  count+=(n-i)-(accum[-1]-accum[i])
  #右のEの数
  if ans>count:
    ans=count
  count=0
print(ans)
# Judge status: Wrong Answer
n=int(input())
ans=1
if n%11>6:
  ans+=1
print(2*(n//11)+ans)
# Judge status: Accepted
# A
x, y, z = map(int, input().split())

print(z, x, y)
# Judge status: Accepted
S=input()
N=len(S)

a=0
t=1
d=[0]*2019
d[0]=1
for i in range(N):
  a+=int(S[N-1-i])*t
  a%=2019
  t*=10
  t%=2019
  d[a]+=1

ans=0
for n in d:
  ans += n*(n-1)//2
print(ans)
# Judge status: Accepted
n = int(input())

if n < 10:
    print(n)
    quit()

count = [[0] * 10 for _ in range(10)]
for i in range(1, 10):
    count[i][i] = 1

d = 1
for i in range(10, n + 1):
    if i % (d * 10)== 0:
        d *= 10
    h = i // d
    f = i % 10
    count[h][f] += 1

ans = 0
for i in range(10):
    for j in range(10):
        ans += count[i][j] * count[j][i]
print(ans)
# Judge status: Wrong Answer
W, H, x, y = map(int, input().split())

if W // 2 == x and H // 2 == y:
    a = 1
else:
    a = 0

print(W*H/2, a)
# Judge status: Accepted
import bisect
N = int(input())
A = sorted(list(map(int, input().split())))
B = sorted(list(map(int, input().split())))
C = sorted(list(map(int, input().split())))


ans = 0
for b in B:
    a_index = bisect.bisect_left(A, b)
    c_index = bisect.bisect_right(C, b)
    ans += a_index*(N-c_index)
print(ans)
# Judge status: Wrong Answer
import numpy as np

MOD = 10**9+7

n = int(input())
arr = np.zeros((n+1,n+1), dtype=np.int16)
for i in np.arange(3,n+1):
    arr[0,i] = 1

for i in np.arange(1,n+1):
    sum_ = 0
    for j in np.arange(3*i,n+1):
        sum_ += arr[i-1,j]
        sum_ %= MOD
        if j+3 >= n + 1:
            break
        arr[i,j+3] = sum_

ans = 0
for i in range(n+1):
    ans += arr[i,n]
    ans %= MOD
print(ans)
# Judge status: Wrong Answer
n = int(input())
count = 0
for i in range(1,n+1):
  if n % i == 0:
    count += 1
if count == 8:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
K,X=map(int,input().split())
ans=[]
for i in range(X-K+1,X+K):
    ans.append(i)
print(*ans)
# Judge status: Accepted
N = int(input())
a = list(map(int, input().split()))
now = 1
flag = True
for i in range(N):
  if a[i] == now:
    flag = False
    now += 1
if flag:
  print(-1)
  exit()
print(N-now+1)
# Judge status: Accepted
import collections
def solve(n, a_list):

    counter = collections.Counter()

    for i in a_list:
        counter[i] += 1

    ans = sum([v-k if k < v else v for k, v in counter.items() if k != v])

    return ans

if __name__ == "__main__":
    n = int(input())
    a_list = [int(i) for i in input().split()]
    print(solve(n, a_list))
# Judge status: Accepted
n,k=map(int,input().split())
h=list(map(int,input().split()))
h.sort()
if k>=n:
  print(0)
else:
  print(sum(h[:n-k]))
# Judge status: Accepted
import math
import string


def readints():
    return list(map(int, input().split()))


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


s = int(input())


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


S = {s}
# print(S)
for i in range(10**6):
    s = func(s)
    # print(s)
    if s in S:
        print(i+2)
        break
    else:
        S.add(s)
        # print(S)
# Judge status: Accepted
x = input().split()
N = int(x[0])
R = int(x[1])

if N >= 10:
  print(R)
else:
  print(R+ 100*(10-N))
# Judge status: Accepted
#!/usr/bin/env python3
#%% for atcoder uniittest use
import sys
input= lambda: sys.stdin.readline().rstrip()
def pin(type=int):return map(type,input().split())
def tupin(t=int):return tuple(pin(t))
#%%code
def resolve():
    N,K=pin()
    n=1
    for i in range(N):
        if n>=N:
            break
        n+=K-1
    print(i)
#%%submit!
resolve()
# Judge status: Accepted
K = input()
S = input()

if len(S) <= int(K):
    print(S)
else:
    print(S[:int(K)] + "...")
# Judge status: Accepted
N = int(input())
Alist = list(map(int, input().split()))
 
Alist = [[idx+1, a] for (idx, a) in enumerate(Alist)]
 
Alist.sort(key=lambda x:x[1])
 
ans = [str(a) for a, _ in Alist]
print(" ".join(ans))
# Judge status: Accepted
N, K, *A = map(int, open(0).read().split())

# Destination
t = [[-1] * N for _ in range(61)]
t[0] = [v - 1 for v in A]
for k in range(60):
    for i in range(N):
        t[k + 1][i] = t[k][t[k][i]]

u = 0
for k in range(61):
    if K >> k & 1:
        u = t[k][u]
        
print(u + 1)
# Judge status: Accepted
q, h, s, d = map(int, input().split())
n = int(input())

L = min(4*q, 2*h, s)
L2 = min(2*L, d)

print((n//2)*L2 + (n%2)*L)
# Judge status: Accepted
a,b = map(int,input().split())
def gcd(x,y):
  while y != 0:
    cur = x
    x = y
    y = cur%y
  return x
t = gcd(a,b)
L = []
for i in range(2,10**6+1):
  while t%i == 0:
    t = t//i
    if i not in L:
      L.append(i)
if t != 1:
  L.append(t)
print(len(L)+1)
# Judge status: Wrong Answer
N = int(input())
print('Yes' if any(i * 4 + j * 7 for i in range(100) for j in range(100)) else 'No')
# Judge status: Accepted
N = int(input())
itm = {}
for n in range(N):
    itm[input()] = 0
print(len(itm))
# Judge status: Wrong Answer
def main():
        N = int(input())

        record = []

        for i in range(1,N):
                if i%3==0 or i%5==0:
                        record.append(0)
                else:
                        record.append(i)

        print(sum(record))


if __name__=="__main__":
        main()
# Judge status: Accepted
n = int(input())

l = []

for i in range(n):
    s = input()
    l.append(s)

res = len(set(l))

print(res)
# Judge status: Wrong Answer
import math
N, D = map(int,input().split())

X = []
for i in range(N):
    array = list(map(int, input().split()))
    X.append(array)
    
count = 0

for i in range(N):
  for j in range(i + 1, N):
    L = []
    for k in range(D):
      L.append((X[i][k] - X[j][k]) ** 2)
    y = sum(L)
    for l in range(y + 1):
      if l ** 2 == y:
        print(l)
        count += 1

print(count)
# Judge status: Accepted
s = input()
ans = 0
for i in s:
    ans += int(i)
if ans % 9:
    print("No")
else:
    print("Yes")
# Judge status: Accepted
n = int(input())
ans = 0
for i in range(1,n+1):
    ans += 0.5 * int(n/i) * (2 * i + (int(n/i) - 1) * i)
print(int(ans))
# Judge status: Wrong Answer
from fractions import gcd
N, M = map(int, input().split())
cnt = M // N
M -= N * cnt
ans = 1
while True:
    if cnt == 1:
        ans = cnt
        break
    if M == 0:
        ans = cnt
        break
    tmp = gcd(cnt, M)
    if tmp != 1:
        ans = min(cnt, tmp)
        break
    M += N
    cnt -= 1

print(ans)
# Judge status: Accepted
#6 Dubious Document 2
s=input()
t=input()
ls=len(s)
lt=len(t)

cand=[]
for i in range(ls-lt+1):
    scut =s[i:i+lt]
#    for j,tt in enumerate(t):
    if all(tt==ss or ss=="?" for tt,ss in zip(t,scut) ):
        cand.append(i)
        
ans=[]
for c in cand:
    ans.append( (s[:c]+ t+ s[c+lt:]).replace("?","a") )

if len(ans)==0:
    print("UNRESTORABLE")
else:
    print(min(ans))
# Judge status: Accepted
import sys
input = sys.stdin.readline
N, M, X, Y = map(int, input().split())
li_x = list(map(int, input().split()))
li_y = list(map(int, input().split()))
li_x.append(X)
li_y.append(Y)
li_x.sort()
li_y.sort()
if li_x[0] <= li_y[0] <= li_x[-1] or li_x[0] <= li_y[-1] <= li_x[-1]:
    print("War")
else:
    print("No War")
# Judge status: Accepted
def main():
    n = int(input())
    A = list(map(int, input().split()))
    B = [0] * n
    ans = []
    for i, a in enumerate(A[::-1]):
        i = n - i
        b = sum(B[i - 1::i])
        if b % 2 != a:
            ans.append(str(i))
            B[i - 1] = 1
    print(len(ans))
    print(' '.join(ans))

if __name__ == '__main__':
    main()
# Judge status: Accepted
n = int(input())
b = n//15
print((800*n)-(200*b))
# Judge status: Accepted
#入力（後でいじる）
def pin(type=int):
    return map(type,input().split())
#どっかで最悪計算量の入力データを用意する関数を作ろう？
"""
方針
O(1)
"""
#solution:
#潜 影 蛇 手 ! !
N,A,B=pin()
if A==B:
    print(1)
elif A>B or N==1:
    print(0)
else:
    print((N-2)*(B-A)+1)
#print(["NO","YES"][1-cond])
#print([["NA","YYMM"],["MMYY","AMBIGUOUS"]][cMMYY][cYYMM])
# Judge status: Wrong Answer
N,M = map(int, input().split())
if N == 1 and M == 1:
  print(1)
elif N == 1 :
  print(M-1)
elif M == 1:
  print(N-1)
else:
  print(int(N-2)*(M-2))
# Judge status: Wrong Answer

N = int(input())

print(round(N*(N-1)/2))
# Judge status: Accepted
n,l=map(int,input().split())
s=sorted([input() for i in range(n)])
print("".join(s))
# Judge status: Accepted
from collections import defaultdict

import sys
sys.setrecursionlimit(10**6)
ii = lambda: int(input())
mis = lambda: map(int,input().split())
lmis = lambda: list(mis())
INF = float('inf')

def main():
    n,k=mis()
    a=lmis()
    print(-(-(n-1)//(k-1)))


if __name__ == "__main__":
    main()
# Judge status: Accepted
n=int(input())
A=[1]*(n+1)
A[1]=1
for i in range(2,n+1):
    for j in range(i,n+1,i):
        A[j]+=1
A[1]=1
sum=0
for i in range(1,n+1):
    sum+=i*A[i]
print(sum)
# Judge status: Wrong Answer
n,l = map(int,input().split())
a = []
for i in range(n):
  a.append(input())
  
a.sort()
for i in a:
  print(i)
# Judge status: Accepted
W, H, x, y = map(int, input().split())
half_area = W * H /2
if x == W/2 and y == H/2:
    print(half_area, 1)
else:
    print(half_area, 0)
# Judge status: Wrong Answer
n,m = map(int,input().split())
stds = [tuple(map(int,input().split())) for _ in range(n)]
points = [tuple(map(int,input().split())) for _ in range(m)]

def d(s,p):
  return abs(s[0]-p[0]) + abs(s[1] + p[1])

for std in stds:
  ans = (float('inf'), -1)
  for i, pnt in enumerate(points):
    if d(std,pnt) < ans[1]:
      ans = (i, pnt)
  print(i+1)
# Judge status: Accepted
N,M = map(int,input().split())
A = list(map(int,input().split()))
output = N - sum(A)
if output >= 0:
    print(output)
else:
    print(-1)
# Judge status: Wrong Answer
N=int(input())
a=list(map(int,input().split()))
mi=0
ma=0
l=[]
count=0
for i in range(N):
 if a[i]<3200:
  l.append(a[i]//400)
 else:
  count=count+1

print(len(set(l)),len(set(l))+max(0,count))
# Judge status: Wrong Answer
import collections

n, *a = map(int, open(0).read().split())
c = collections.Counter(a)
length_l = list(c.keys())
length_l.sort(reverse = True)
side1 = 0
ans = 0
for l in length_l:
    cnt = c[l]
    if cnt >= 4:
        ans = l**2
        break
    elif cnt >= 2:
        if side1 != 0:
            ans = side1*l
            break
        else:
            side1 = l
print(ans)
# Judge status: Accepted
#n = int(input())
#a,b = map(int,input().split())
#a_L = list(map(int,input().split()))

s = list(input())
n = len(s)

if s != list(reversed(s)):
    print("No")
    exit()

tmp = s[0:int(((n-1)/2))]
#print(tmp)
if tmp != list(reversed(tmp)):
    print("No")
    exit()


tmp = s[int(((n+3)/2))-1:]
#print(tmp)
if tmp != list(reversed(tmp)):
    print("No")
    exit()

print("Yes")
# Judge status: Wrong Answer
import itertools

n, k = list(map(int, input().split()))
ab = [[] for _ in range(n)]
for i in range(n):
    ab[i] = list(map(int, input().split()))
az, bz = list(zip(*ab))

accb = list(itertools.accumulate(bz))
idx = 0
for j, v in enumerate(accb):
    if k <= v:
        idx = j
        break
print(az[idx])
# Judge status: Accepted
n = int(input())
s = input()

ans = s.count("R") * s.count("G") * s.count("B")

for i in range(n):
    for j in range(i + 1, n):
        k = j - i + j
        if k < n:
            if {s[i], s[j], s[k]} == {"R", "G", "B"}:
                ans -= 1

print(ans)
# Judge status: Accepted
from sys import stdin
X, N = [int(x) for x in stdin.readline().rstrip().split()]
p = [int(x) for x in stdin.readline().rstrip().split()]

ans = 10000
ans_diff = 10000

list_100 = [0] * 100
for i in range(100):
  list_100[i] = i+1
  
list_100.append(0)
list_100.append(-1)
list_100.append(101)
  
live_list = list(set(list_100) - set(p))

for i in live_list:
  diff = abs(X - i)
  if diff < ans_diff:
    ans = i
    ans_diff = diff
  if diff == ans_diff:
    ans = min(ans, i)
 
print(ans)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
ans = 0
for i in range(n - 1, -1, -1):
    c = min(a[i + 1], b[i])
    ans += c
    d = min(a[i], b[i] - c)
    ans += d
    a[i] -= d
print(ans)
# Judge status: Accepted
s=input()
flg=False

for i in range(len(s)):
  if (i+1)%2==0 and s[i]=='R':
    flg=True
  if (i+1)%2==1 and s[i]=='L':
    flg=True
if flg:
  print('No')
else:
  print('Yes')
# Judge status: Accepted
n, m = map(int, input().split())
max_l = 1
min_r = n 

for _ in range(m):
    l, r = map(int, input().split())
    max_l = max(max_l, l)
    min_r = min(min_r, r)

ans = max(min_r - max_l + 1, 0)
print(ans)
# Judge status: Accepted
k, n = map(int, input().split())
a = list(map(int, input().split()))

lis = []

for i in range(n-1):
    lis.append(a[i+1] - a[i])
lis.append(k- a[-1] + a[0])
print(k-max(lis))
# Judge status: Accepted

n = int(input())

print((1+n)*n//2)
# Judge status: Accepted
n = int(input())
a = [int(v) for v in input().split()]

field = {}
for v in a:
    if not v in field:
        field[v] = 1
    else:
        field[v] += 1

all_ans = 0
for k,v in field.items():
    all_ans += ((v*(v-1))/2)


for i in a:
    ans = all_ans
    if i in field:
        n = field[i]
        ans -= (n*(n-1))/2
        n = n - 1
        ans += (n*(n-1))/2
    
    print(int(ans))
# Judge status: Accepted
alpha = str(input())

if alpha.isupper()==True:
	print('A')
else:
	print('a')
# Judge status: Accepted
n = int(input())
t = [0]
x = [0]
y = [0]
for _ in range(n):
    T, X, Y = map(int, input().split())
    t.append(T)
    x.append(X)
    y.append(Y)

for num in range(n):
    dif_t = t[num+1] - t[num]
    dif_x = abs(x[num+1] - x[num])
    dif_y = abs(y[num+1] - y[num])
    i = dif_t - (dif_x + dif_y)
    if i%2 == 1 or i <= -1:
        print('No')
        exit()

print('Yes')
# Judge status: Accepted
print("ARC" if input() == "ABC" else "ABC")
# Judge status: Accepted
A,B,T = map(int,input().split())
X = (T + 0.5) // A
Y = B * X
print(int(Y))
# Judge status: Wrong Answer
n, x, y = map(int, input().split())
x, y = x - 1, y - 1
for k in range(1, n):
    count = 0
    for i in range(n - k):
        x_i = abs(i - x)
        flag = True
        if x_i < k:
            points = {y + k - x_i - 1, y - k + x_i + 1}
            for p in points:
                if n > p > i + k:
                    count += 1
        if x_i+1+abs(i+k-y)>k:
            count += 1
    print(count)
# Judge status: Accepted
import sys
from itertools import permutations

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


def main():
    N = int(readline())
    print(N * (N - 1) // 2)
    return


if __name__ == '__main__':
    main()
# Judge status: Accepted
a,b = [int(x) for x in input().split()]

if a + b < 24:
    print(a+b)
else:
    print(a+b-24)
# Judge status: Accepted
n = int(input())
dishes = list(map(int, input().split()))
points = list(map(int, input().split()))
bonuses = list(map(int, input().split()))

score = 0
prev = 0
for i in dishes:
  score += points[i-1]
  if prev > 0:
    if i == prev + 1: score += bonuses[i-2]
  prev = i

print(score)
# Judge status: Accepted
a, b = map(int, input().split())
print(0 if b == 1 else ((b - 1) + (a - 2)) // (a - 1))
# Judge status: Accepted
N = int(input())
W = []
for i in range(N):
  tmp = input()
  W.append(tmp)

flag = 1
for i in range(N):
  count = W.count(W[i])
  if count > 1:
    flag = 0
    break
if flag == 0:
  print('No')
else:
  for i in range(1,N):
    if W[i-1][-1] != W[i][0]:
      flag = 0
      break
  if flag == 0:
    print('No')
  else:
    print('Yes')
# Judge status: Accepted
n=int(input())
x=""
while n!=0:
    x=str(n%2)+x
    n=-(n//2)
print(0 if x=="" else x)
# Judge status: Accepted
N = int(input())
a = [int(input()) for _ in range(N)]
a = [0] + a
count = 0
i = 1
while i != 2:
    j = i
    i = a[i]
    a[j] = -1
    count  += 1
    if i == -1:
        count = -1
        break
print(count)
# Judge status: Accepted
a=list(map(int,input().split()))
print(len(set(a)))
# Judge status: Wrong Answer
N=int(input())
A=list(map(int,input().split()))
B=list(dict.fromkeys(A))
if A==B:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
a,b = map(int, input().split())
print(a + b/2)
# Judge status: Wrong Answer
n = int(input())
l = list(map(int, input().split()))
L = list(set(l))
count = 0
for x in L:
  num = l.count(x)
  if num > x:
    count += num - x
  else:
    count += x - num
print(count)
# Judge status: Wrong Answer
n = int(input())
data = [int(input()) for i in range(n)]
count = 1
temp = data[0]
for i in range(n):
    temp = data[temp-1]
    count += 1
    if temp == 2:
        print(count)
        break
    else:
        print(-1)
# Judge status: Wrong Answer
N = int(input())
tmpN = N
C = input()
if N % 2 == 1:
  N -= 1
  N = int(N / 2)
  result = C.count('R',N)
  if C[N+1] == 'R' and C[N] == 'R':
    result += 1
else:
  N = int(N / 2)
  result = C.count('R',N)

if C.count('R') == tmpN:
  print('0')
else:
  print(result)
# Judge status: Accepted
import sys

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()))


a, b, c = rm()
if a == b == c:
  if a & 1:
    print(0)
  else:
    print(-1)
  exit()
cnt = 0
while a & 1 == 0 and b & 1 == 0 and c & 1 == 0:
  a, b, c = (b+c)//2, (a+c)//2, (a+b)//2
  cnt += 1
print(cnt)
# Judge status: Accepted
N,K = map(int, input().split())
A = list(map(int, input().split()))

for i in range(N-K):
  if A[i] < A[i+K]:
    print("Yes")
  else:
    print("No")
# Judge status: Accepted
import sys
n = list(str(input()))
for i in range(len(n)-2):
    if n[i] == n[i + 1] and n[i + 1] == n[i + 2]:
        print('Yes')
        sys.exit()
print('No')
# Judge status: Accepted
import sys
input = sys.stdin.readline
N, Q = map(int,input().split())
S = input()
ls = []
rs = []
for i in range(Q) :
    l, r = map(int,input().split())
    ls.append(l)
    rs.append(r)

ans = [0 for _ in range(N+1)]
temp = 0
for i in range(N) :
    if S[i:i+2] == "AC" :
        temp += 1
    ans[i+1] += temp

for i in range(Q) :
    print(ans[rs[i]-1] - ans[ls[i]-1])
# Judge status: Accepted
S = input()
T = ''
words = ['dream', 'dreamer', 'erase', 'eraser']
for i in range(len(words)):
    words[i] = words[i][::-1]
for i in S[::-1]:
    T += i
    for q in words:
        if T == q:
            T = ''
if T == '':
    print('YES')
else:
    print('NO')
# Judge status: Accepted
from decimal import Decimal
import math
a,b = input().split()
a = Decimal(a)
b = Decimal(b)
print(math.floor(a*b))
# Judge status: Accepted
n = int(input())
s = [int(input()) for _ in range(n)]
tots = sum(s)
if tots % 10 > 0:
   print(tots)
else:
   t = [x for x in s if x % 10 > 0]
   if len(t) == 0:
      print(0)
   else:
      t.sort()
      print(tots-t[0])
# Judge status: Accepted
H, W = map(int, input().split())

if W % 2 == 0:
    x = W // 2
    y = W // 2
else:
    x = W // 2 + 1
    y = W // 2

if H % 2 == 0:
    ans = (x + y) * (H // 2)
else:
    ans = (x + y) * (H // 2) + x

if H == 1 or W == 1:
    print(1)
else:
    print(ans)
# Judge status: Accepted
n,l=map(int,input().split())
s=sorted([input() for _ in range(n)])
print(''.join(s))
# Judge status: Accepted
N=int(input())
pre=int(input())
ans=pre//2
pre=pre&1
for i in range(2,N+1):
    Ai=int(input())
    if pre and Ai>=1:
        ans+=1
        Ai-=1
    ans+=Ai//2
    pre=Ai&1
print(ans)
# Judge status: Wrong Answer
x,y,a,b,c=map(int,input().split())
P=sorted(list(map(int,input().split())))[::-1]
Q=sorted(list(map(int,input().split())))[::-1]
R=sorted(list(map(int,input().split())))[::-1]+[0]*(max(x+y-c,0))
L=sorted(P[:x]+Q[:y])[::-1]
print(L)
print(R)
l=r=0
for i in range(x+y): 
    if r+R[i]<l+L[-i-1]:
        print(sum(L[:x+y-i]+sorted(L[x+y-i:]+R[:i])[::-1][:i]))
        exit()
    r+=R[i]
    l+=L[-i-1]
print(r)
# Judge status: Wrong Answer
w = str(input())
a =  sorted(w)
b = 0
count = 0
for i in range(len(a)):
    if i == 0:
        b = a[i]
        count = 1
    else:
        if a[i - 1] == a[i]:
            count += 1
        else:
            if count % 2 == 1:
                print('No')
                exit()
            else:
                count = 1
print('Yes')
# Judge status: Wrong Answer
d=int(input())
a=[]
for x in range(d+1):
  b=list(map(int,input().split()))
  a.append(b)
  
  

sum1=sum(a[0][1:d])

ans=[0]*d

for n in range(d):
  ans[n]=(a[n+1][0])
  ans[n]=int(int(ans[n])-(sum1))
  try:
    ans[n]=ans[n]+ans[n-1]
  except:
    True
    
for y in range(d):
  print(ans[y])
# Judge status: Accepted
N = int(input())

mod = N % 10
if mod in [2,4,5,7,9]:
    print("hon")
elif mod in [0,1,6,8]:
    print("pon")
else:
    print("bon")