peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))

ans=[0 for _ in range(n+1)]
t=[]
S=0

for i in range(n):
  b=n-i
  c=(n-i)*2
  ch=0
  while c<=n:
    ch+=ans[c]
    c+=b
    
  if ch%2==0:
    if a[b-1]==1:
      ans[b]+=1
      S+=1
      t.append(str(b))
  else:
    if a[b-1]==0:
      ans[b]+=1
      S+=1
      t.append(str(b))
      

print(S)
if S>0:
  
  print(' '.join(t))
# Judge status: Wrong Answer
n = int(input())
l = list(map(int, input().split()))
l.reverse()
count = 0
for i in range(len(l) - 1):
    if l[i] > l[i + 1]:
        count += abs(l[i] - l[i + 1])
print(count)
# Judge status: Wrong Answer
print("No" if 2 in [int(x) for x in input().split()] else "Yes")
# Judge status: Wrong Answer
n, m = (int(x) for x in input().split())
if n == m:
    print('Yes')
else:
    print('no')
# Judge status: Wrong Answer
n=int(input())
a=list(map(int,input().split()))
ans=0
i=1
while i+1<n:
    if a[i-1]<=a[i]<=a[i+1] or a[i-1]>=a[i]>=a[i+1]: i+=1
    else:
        ans+=1
        i+=2
print(ans+1)
# Judge status: Accepted
K,N = list(map(int, input().split()))

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

max = 0

for i in range(N):
    if i == N-1:
        if max < K - (A[i]-A[0]):
            max = K - (A[i]-A[0])
    else:
        if max < A[i+1]-A[i]:
            max = A[i+1]-A[i]

print(K-max)
# Judge status: Wrong Answer
q , h , s , d = map(int,input().split())
n = int(input())
qb = q*4
hb = h*2
db = d/2

if min(qb,hb,db,s) != db:
    print(n*min(qb,hb,s))
elif min(qb,hb,db,s) == db:
    if n % 2 == 0:
        print(n*db)
    elif n % 2 == 1:
        ans = (n//2) * d
        ans += min(qb,hb,s)
        print(ans)
# Judge status: Accepted
S = list(map(int, input().split('/')))
if S[0] > 2019:
    print('TBD')
elif S[0] == 2019 and S[1] > 4:
    print('TBD')
else:
    print('Heisei')
# Judge status: Accepted
N = int(input())
S = input()

r = S.count('R')
w = S.count('W')

if r == N or r == 0:
  print(0)
  exit()

a = S[:r].count('W')

print(a)
# Judge status: Wrong Answer
def kaijyou(x):
  a=1
  for i in range(x):
    a*=i
    return a

cnt=0
n=int(input())
x=[input() for i in range(n)]
y=set(x)
for i in y:
  cnt+=kaijyou(x.count(i))
print(cnt)
# Judge status: Accepted
from functools import reduce
def nCr(n,r,DIV):
  # X/Y mod DIV == X*Y**(DIV-2)
  X=reduce(lambda x,y:x*y%DIV,range(n-r+1,n+1))
  Y=reduce(lambda x,y:x*y%DIV,range(1,r+1))
  return X*pow(Y,DIV-2,DIV)%DIV

DIV=10**9+7
n,a,b=map(int,input().split())
ans=pow(2,n,DIV)-1
ans-=nCr(n,a,DIV)
ans-=nCr(n,b,DIV)
print(ans%DIV)
# Judge status: Accepted
n = int(input())
for i in range(n//4 + 1):
  if (n-4*i)%7 == 0:
    print('Yes')
    exit()
print('No')
# Judge status: Wrong Answer
import math

N = int(input())
min_move_count = 10**7

for i in range(1, int(math.sqrt(N)) + 1):
    if N % i == 0:
        move_count = i + (N // i) - 2
        if move_count < min_move_count:
            min_move_count = move_count

ans = min_move_count
print(ans)
# Judge status: Accepted
print(("NO","YES")[input()==input()[::-1]])
# Judge status: Accepted
s=list(input())
s1="".join(s[:2])
s2="".join(s[2:])
if 0<int(s1)<=12 and 0<int(s2)<=12:
    print("AMBIGUOUS")
elif 0<int(s1)<=12 and (int(s2)>12 or int(s2)==0):
    print("MMYY")
elif 0<int(s2)<=12 and (int(s1)>12 or int(s1)==0):
    print("YYMM")
else:
    print("NA")
# Judge status: Accepted
A,B,C,D = map(int, input().split())
a = []
b = []
for i in range(A,B+1):
    a.append(i)
for i in range(C,D+1):
    b.append(i)
print(max(len(set(a)&set(b))-1,0))
# Judge status: Wrong Answer
s = input()
if(s[0]==s[1])and(s[2]==s[3]):
    print("Yes")
elif(s[1]==s[2])and(s[0]==s[3]):
    print("Yes")
elif(s[1]==s[3])and(s[0]==s[2]):
    print("Yes")
elif(s[0]==s[1])and(s[2]==s[3])and(s[1]==s[2]):
    print("No")
else:
    print("No")
# Judge status: Wrong Answer
n=int(input())
a=sorted(map(int,input().split()))

A=0
B=0

for i in range(n):
 if i%2 ==1:
  A += a[i]
 else:
  B += a[i]

print(A-B)
# Judge status: Wrong Answer
N=int(input())
a=list(map(int,input().split()))
ans=[['']*30 for _ in range(N)]
i=29

while True:
    curbit=[aa%2 for aa in a]

    s=sum(curbit)

    if s%2==0:
        for j in range(N):
            ans[j][i]=str(curbit[j])
    else:
        for j in range(N):
            ans[j][i]=str(0 if curbit[j] else 1)

    if s==0:
        break
    
    a=[aa//2 for aa in a]
    i-=1

print(' '.join([str(int(''.join(aa),2)) for aa in ans]))
# Judge status: Wrong Answer
n = int (input())
result =0
for i in range(1,n):
    result =result +i
print (result)
# Judge status: Accepted
N,K = list(map(int,input().split()))
A = list(map(int,input().split()))

Asort = sorted(A)

from collections import Counter
c = Counter(A)
keys, values = zip(*c.most_common())

ans = 0
N = len(keys)

for i in range(K,N):
    ans += values[i]
    
print(ans)
# Judge status: Accepted
a,b=map(int,input().split())
cnt=0
for i in range(a,b+1):  
  ii=str(i)
  if ii[-1]!="0":
    flg=True
    for i in range(2):
      if ii[i] != ii[-i-1]:
        flg=False
    if flg:
      cnt+=1
print(cnt)
# Judge status: Wrong Answer
S = input()

odd = list(S[::2])
even = list(S[1::2])
xx = "No"
x1 = ""
x2 = ""
check = 0
check2 = 0

for i in range(len(odd)):
  
  if odd[i] == "R" or odd[i] == "U" or odd[i] == "D":
    check += 1
  
  if check == len(odd):
    x1 = "Y"
  
for i in range(len(even)):
 
  if even[i] == "L" or "U" or "D":
    check2 += 1
 
  if check2 == len(even):
    x2 = "Y"
  
  
if x1 and x2 == "Y":
  xx = "Yes"
  
  
print(xx)
# Judge status: Wrong Answer
A,B,T=list(map(int, input().split()))
n=T//A
print((n*(n+1)//2)*B)
# Judge status: Accepted
S = input()
if S == 'SUN':
  ans = 7
elif S == 'MON':
  ans = 6
elif S == 'TUE':
  ans = 5
elif S == 'WED':
  ans = 4
elif S == 'THU':
  ans = 3
elif S == 'FRI':
  ans = 2
elif S == 'SAT':
  ans = 1
print(ans)
# Judge status: Accepted
N=int(input())
a=input()
b=input()
ans = N
for i in range(N):
    if a[i:] == b[:N-i]:
        break
    else:
        ans += 1
print(ans)
# Judge status: Accepted
def main():
    N, A, B, C, D = (int(i) for i in input().split())
    S = input()
    if "##" in S[A:C] or "##" in S[B:D]:
        return print("No")
    if D < C and (S[D-2] == "#" or S[D] == "#"):
        if (S[B-2] == "#" or S[B] == "#") and "..." not in S[B-1:D]:
            return print("No")
    print("Yes")


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
def main():
    from fractions import gcd
    from functools import reduce
    from operator import mul
    n, *t = map(int, open(0).read().split())
    g = reduce(gcd, t)
    ans = reduce(mul, t) // g
    print(ans)


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
x=int(input())
if(x<=40 and x>=-40):
    print('Yes')
else:
    print('No')
# Judge status: Accepted
n,d=map(int,input().split())
a=n/(2*d+1)
print(int(a) if a==a//1 else int(a)+1)
# Judge status: Wrong Answer
import math
def main():
    t = [int(t)for t in input().split()]
    w,h,x,y = t[0],t[1],t[2],t[3]

    left,right = x, w-x
    top, bottom = y, h-y

    s_ = [left*h,right*h,top*w,bottom*w]
    s_ = sorted(s_)
    print(s_[2],1 if s_[2]==s_[3] else 0)

if __name__ == "__main__":
    main()
# Judge status: Accepted
a = list(map(int,input().split()))
if a[1]%2 == 1:
  print('No')
else:
  if a[0]*2<= a[1] and a[1] <= a[0]*4:
    print('Yes')
  else:
    print('No')
# Judge status: Wrong Answer
num_list = list(map(int, input().split()))
s_List = sorted(num_list)
print(num_list[0] + num_list[1])
# Judge status: Accepted
Num=int(input())
Str=input()

Letters =list('A B C D E F G H I J K L M N O P Q R S T U V W X Y Z'.split())

Ans=''
for i in range(len(Str)):
  Index = Letters.index(Str[i])
  if Index + Num < 26:
    Ans += Letters [Index + Num]
  else:
    Diff = (Index + Num) - 26
    Ans += Letters [Diff ]
  
print(Ans)
# Judge status: Accepted
from sys import stdin


def main():
    input = lambda: stdin.readline()[:-1]
    X, K, D = map(int, input().split())

    d, m = divmod(X, D)
    if abs(d) >= K:
        print(abs(abs(X) - (K * D)))
    else:
        if (K - d) % 2:
            print(D - m)
        else:
            print(m)


main()
# Judge status: Accepted
def main():
    n, d = list(map(int, input().split()))
    a, s = divmod(n, (d*2)+1)
    print(a) if s == 0 else print(a+1)


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

z = [0]*n
w = [0]*n

for i in range(n):
    x, y = map(int, input().split())
    z[i] = x+y
    w[i] = x-y

a = max(z)
b = min(z)
c = max(w)
d = min(w)

print(max(a-b, b-a, c-d, d-c))
# Judge status: Accepted
S = input()
print("2018" + S[4:])
# Judge status: Accepted
N = int(input())
A = [int(i) for i in input().split()]

count = [0]*N
for elem in A:
    count[elem-1] += 1
for c in count:
    print(c)
# Judge status: Accepted
n, k = map(lambda x: int(x), input().split())

if n%k == 0:
  print(0)
else:
  print(1)
# Judge status: Accepted
import sys
import heapq
inf = 10**6
n, m = map(int, input().split())

if n >= m:
  print(0)
  sys.exit()

a = [int(x) for x in input().split()]
a.sort()

count = []
heapq.heapify(count)
for i in range(m-1):
  heapq.heappush(count, -a[i+1]+a[i])

ans = 0
for j in range(n-1):
  ans -= heapq.heappop(count)
ans = max(a)-min(a)-ans
print(ans)
# Judge status: Wrong Answer
a, b, k = map(int, input().split())
c = []
for i in range(min(k, b-a)):
  c.append(a+i)
  c.append(b-i)
c.sort()
c = sorted(set(c))
for i in c:
  print(i)
# Judge status: Accepted
xy = list(map(int, input().split()))
print("U"*(xy[3]-xy[1]) + "R"*(xy[2]-xy[0]) + "D"*(xy[3]-xy[1]) + "L"*(xy[2]-xy[0]+1) + "U"*(xy[3]-xy[1]+1) + "R"*(xy[2]-xy[0]+1) + "D" + "R"+ "D"*(xy[3]-xy[1]+1) + "L"*(xy[2]-xy[0]+1) + "U")
# Judge status: Wrong Answer
#!/use/bin/env python3

import math
from collections import defaultdict

a = [int(s) for s in input().split()]
r = int(input())

q = a[0] / 0.25
h = a[1] / 0.5
s = a[2]
d = a[3] / 2

s = [(q, 0.25), (h, 0.5), (s, 1), (d, 2)]
p = sorted(s, key=lambda x:x[0])

ans = 0

for u, q in p:
    c = r//q
    ans += (u * q) * c
    r -= (q * c)

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

ans = float("inf")

if abs(x - y) > abs(x + y):
    ans = min(ans, abs((-1) * x - y) + 1)

if x <= y: ans = min(ans, y - x)
else: ans = min(ans, x - y + 2)

print(ans)
# Judge status: Wrong Answer
def b_frog_2(stones, k):
    dp = [0] * len(stones)
    dp[0] = 0
    for i in range(1, len(stones)):
        for j in range(max(0, i - k), i):
            dp[i] = min(dp[i], dp[j] + abs(stones[i] - stones[j]))
    return dp[-1]


def main2():
    N, K = list(map(int, input().split()))
    h = list(map(int, input().split()))
    print(b_frog_2(h, K))
# Judge status: Accepted
def main():
  n=int(input())
  a=list(map(int,input().split()))
  dp=[0,-10**18]
  for i in range(n-1):
    dp2=[max(dp[0]+a[i],dp[1]-a[i]),max(dp[0]-a[i],dp[1]+a[i])]
    dp=dp2
  print(max(dp[0]+a[-1],dp[1]-a[-1]))
main()
# Judge status: Accepted
n = int(input())
s = list(input())
r, g, b = 0, 0, 0
for i in s:
    if i == "R":
        r += 1
    elif i == "G":
        g += 1
    else:
        b += 1
ans = r * g * b
for i in range(n - 2):
    k = i + 2
    while True:
        if k >= n:
            break
        j = i + (k - i) // 2
        if s[i] != s[j] and s[j] != s[k] and s[k] != s[i]:
            ans -= 1
        k += 2
print(ans)
# Judge status: Accepted
a , b = map(int,input().split())
if a > b:
  print(a - 1)
else:
  print(a)
# Judge status: Wrong Answer
n, m = map(int, input().split())
a, b = [], []
for i in range(n):
    te, mp = map(int, input().split())
    a.append(te)
    b.append(mp)

e, f = [], []
for i, j in sorted(zip(a, b)):
    e.append(i)
    f.append(j)

ans = 0
for i in range(n):
    if m - f[i] < 0:
        ans += e[i] * m
        print(ans)
        break
    else:
        ans += f[i] * e[i]
        m -= f[i]
# Judge status: Accepted
x, y, a, b, c = map(int, input().split())
p = sorted(list(map(int, input().split())))
q = sorted(list(map(int, input().split())))
r = sorted(list(map(int, input().split())))

filt_p = p[-x:]
filt_q = q[-y:]
filt_p.extend(filt_q)
filt_p.extend(r)
all_apples = sorted(filt_p)

ans = sum(all_apples[-x-y:])

print(str(ans))
# Judge status: Accepted
def cmb(a,b,c):
    b = min(b,a-b)
    num = 1
    for i in range(b):
        num = num*(n-i) % c
    den = 1
    for i in range(b):
        den = den*(i+1) % c
    return num*pow(den,-1,c) % c
mod = 10**9+7
n,a,b = map(int,input().split())
ans  = (pow(2,n,mod)-cmb(n,a,mod)-cmb(n,b,mod)-1) % mod
if ans < 0:
    ans = ans + mod
print(ans)
# Judge status: Wrong Answer
# coding: utf-8

#N = int(input())
alp = [chr(i) for i in range(97, 97+26)]
L = []
l, r = map(int,input().split())

if r-l+1 > 2019:
    ans = 0
else:
    for i in range(l, r+1):
        L.append(i%2019)
    L.sort()
    print((L[0]*L[1])%2019)
# Judge status: Accepted
N = int(input())
D = {}
for _ in range(N):
    A = int(input())
    D[A] = not D.get(A, False)
print(sum(D.values()))
# Judge status: Wrong Answer
# coding = utf-8
n=input("")
a=input("")
a=a.split(" ")
a=[int(s) for s in a]
a.sort()
base=100000
n=0
for num in a:
    while num%2**n==0:
        n=n+1
    if n < base:
        base=n
base=base-1
print(base)
# Judge status: Accepted
import collections
s = map(int,raw_input())

dp = [0] * 2019
count = 0
for j in range(len(s)):
    ndp = [0] * 2019
    ndp[s[j]] += 1
    for k in range(len(dp)):
        ndp[(10*k + s[j]) % 2019] += dp[k]
    count += ndp[0]
    dp = ndp[::]

print count
# Judge status: Wrong Answer
h,w  = map(int,input().split())
if h == 1 or w == 1:
    ans = 2
    
else:
    ans = 2*(h-2)+2*(w-2)+4
ans = (h*w) - ans
print(ans)
# Judge status: Accepted
x = list(map(int,input().split()))
x.sort()
if (x[1]-x[0])%2==0:
  print(x[2]-x[1]+(x[1]-x[0])//2)
else:
  print(x[2]-x[1]+(x[1]-x[0])//2+2)
# Judge status: Wrong Answer
N = int(input())
ans = 0
tmp = 0
for _ in range(N):
    a = int(input())
    ans += (a + tmp) // 2
    tmp = 0
    if a % 2 == 1:
        tmp = 1

print(ans)
# Judge status: Accepted
x=int(input())
for i in range(-118,120):
    for j in range(-118,120):
        if i**5-j**5==x:
            print(i,j)
            break
    else:
        continue
    break
# Judge status: Accepted
N = int(input())
A = [[int(n), i] for i,n in enumerate(input().split(), 1)]
A.sort()
print(" ".join(map(str, [i[1] for i in A])))
# Judge status: Accepted
import sys
input = sys.stdin.readline

n, m = map(int, input().split())
p_s = [list(map(str, input().split())) for _ in range(m)]

ac = [0 for _ in range(n)]
wa = [0 for _ in range(n)]

for i in range(m):
    if p_s[i][1] == 'WA':
        if ac[int(p_s[i][0]) - 1] == 0:
            wa[int(p_s[i][0]) - 1] += 1
    else:
        ac[int(p_s[i][0]) - 1] = 1

for i in range(n):
    if ac[i] == 0:
        wa[i]=0

print(sum(ac), sum(wa))
# Judge status: Wrong Answer
#abc056 b 
w,a,b=map(int,input().split())
print(min(abs(b+w-a),abs(a+w-b)))
# Judge status: Wrong Answer
import math

def pushpush(n , a):

    ans = []

    for i in range(n):
        if i % 2 == 0:
            ans = ans + [a[i]]
        else:
            #ans.insert(0 , int(a[i]))
            ans = [a[i]] + ans

    return ans

def main():
    n = int(input())
    a = list(map(int , input().split()))
    print(*pushpush(n , a))

if __name__ == '__main__':
    main()
# Judge status: Accepted
n = int(input())
C = input()
rc = C.count('R')
print(C[:rc].count('W'))
# Judge status: Accepted
N, K = map(int, input().split(" "))
routs = {}
location = [0 for i in range(N + 1)]
tereporter = list(map(int, input().split()))
for i in range(N):
  routs[i] = tereporter[i] - 1
present_location = 0
n = 0
for i in range(K):
  n += 1
  present_location = routs[present_location]
  if location[present_location] == 0:
    location[present_location] = n
  else:
    loop = n - location[present_location]
    if (K - location[present_location]) % loop == 0:
      break
    else:
      for i in range((K - location[present_location]) % loop):
        present_location = routs[present_location]
      break
print(present_location + 1)
# Judge status: Accepted
#!/usr/bin/env python3

n = int(input())

for b in range(1, 10):
    a = n//b

    if a*b == n:
        if a <= 9 and b <= 9:
            print("Yes")
            exit()
print("No")
# Judge status: Accepted
# coding:utf-8

import sys
import math
import time
#import numpy as np
import collections
from collections import deque
import queue
import copy


#X = str(input()).split()
#a = [int(x) for x in input().split()]


NR = str(input()).split()
N = int(NR[0])
R = int(NR[1])
if(N>=10):
  ans = R
else:
  ans = R+100*(10-N)


print(ans)
# Judge status: Accepted
def main():
    n, m = map(int, input().split())
    if n%2:
        for i in range(1, m+1):
            print(i, n-i+1)
    else:
        for i in range(1, m+1):
            if n-2*i+1 > n//2:
                print(i, n-i+1)
            else:
                print(i, n-i)

if __name__ == "__main__":
    main()
# Judge status: Accepted
s = list(input())
if s[0] == s[1] == s[2] or s[1] == s[2] == s[3]:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
N, M= map(int, input().split())

if N >= M // 2:
    print(M // 2)

else:
    m = M - N * 2
    s = m // 4
    print(N + s)
# Judge status: Wrong Answer
a,b = map(int,input().split())

aa = a+a-1
bb = b+b-1
ab = a+b-1

lists = [aa,bb,ab]
print(max(lists))
# Judge status: Wrong Answer
N, M = map(int,input().split())
for i in range(1,M+1):
  print(i,N-i)
# Judge status: Accepted
a,b = map(int,input().split())

if a==b:
  print("Draw")
elif a == 1:
  print("Alice")
elif b == 1:
  print("Bob")
elif a > b:
  print("Alice")
elif a < b:
  print("Bob")
# Judge status: Accepted
# import bisect
# import heapq
# from copy import deepcopy
# from collections import deque
# from collections import Counter
# from itertools import accumulate
# from itertools import permutations
# import numpy as np
# import math
# mod = 10**9 + 7
from fractions import gcd
# n = int(input())

# s = deque(input())
# q = int(input())

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



def lcm(x, y):
    return (x * y) // gcd(x, y)

print(lcm(a,b))
# Judge status: Wrong Answer
import math
n,h = map(int,input().split())
al = []
bl = []
ans = 0
for i in range(n):
    a,b = map(int,input().split())
    al += [a]
    bl += [b]
am = max(al)
bl.sort(reverse=1)
print(al)
print(bl)
for i in bl:
    if i>am:
        ans += 1
        h -= i
        if h <= 0:
            break
    else:
        break
if h > 0:
    ans += math.ceil(h/am)
print(ans)
# Judge status: Wrong Answer
n,m=map(int,input().split())
if n>2: print((n-2)*(m-2))
elif n==1 and m==1: print(1)
else: print(m-2)
# Judge status: Accepted
s = list(input())
n = len(s)
flg = True
s4 = reversed(s)
if s != s[::-1]:
    flg = False
s2 = s[0:((n-1)//2)]
s5 = reversed(s)
if s2 != s2[::-1]:
    flg = False
s3 = s[(n+3)//2 -1:n]
s6 = reversed(s)
if s3 != s3[::-1]:
    flg = False
if flg == True:
    print('Yes')
else:
    print('No')
#print(s[::-1])
# Judge status: Accepted
c = str(input())
if c == "a" or c == "e" or c == "i" or c == "o" or c == "u":
    print("vowel")
else:
    print("consonant")
# Judge status: Accepted
N = int(input())
S = input()
m = 10 ** 6
tot1 = 0
cnt1 = 0
cnt0 = 0
for s in S:
    if(s == '#'):
        cnt0 += 1
    else:
        cnt1 += 1
        tot1 += 1
    m = min(m,cnt0-cnt1)
m += tot1
m = min(m,tot1)
print(m)
# Judge status: Wrong Answer
import math
N, K = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
l = 0
r = a[-1]

while r - l > 1:
    mid = (r + l) // 2
    cnt = 0
    for i in a:
        cnt += math.ceil(i // mid)
    if cnt <= K:
        r = mid
    else:
        l = mid

print(r)
# Judge status: Accepted

[D,T,S] = list(map(int,input().split()))
jikan=D/S
if jikan>T:
    print('No')
else:
    print('Yes')
# Judge status: Wrong Answer
input_str = input().split()
k = int(input_str[0])
s = int(input_str[1])

count = 0
for x in range(k+1):
  if x == s:
    count += 1
  else:
    for y in range(k+1-x):
      if x+y == s:
        count += 1
      else:
        for z in range(k+1-x-y):
          if x+y+z == s:
            count += 1
print(count)
# Judge status: Accepted
a,b,c = map(int,input().split())
if a == b == c:
  print(1)
elif a == b or b == c or c == a:
  print(2)
else:
  print(3)
# Judge status: Accepted
n,k = map(int,input().split())
a = list(map(int,input().split()))
already = ["1"]
set = {"1"}
now = 1

for i in range(n):
    now = str(a[int(now)-1])
    if now in set:
        break
    else:
        already.append(now)
        set.add(now)


ind = already.index(now)
k -= ind
cycle = already[ind:]

if k <= 0:
    print(already[k+ind])
else:
    now = (k+1) % len(cycle)
    print(cycle[now-1])
# Judge status: Accepted
a,b,c=map(int,input().split())
if a<=c<=b:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
#!/usr/local/bin/python3
# https://atcoder.jp/contests/agc014/tasks/agc014_a

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

if A == B == C and A % 2 == 0:
    print(-1)
    exit()

def check(A, B, C):
    return A%2 == 1 or B%2 == 1 or C%2 == 1

ans = 0
while check(A, B, C) == False:
    nA = (B + C) / 2
    nB = (A + C) / 2
    nC = (A + B) / 2
    A, B, C = nA, nB, nC
    ans += 1

print(ans)
# Judge status: Accepted
import sys
readline = sys.stdin.readline

sx,sy,tx,ty = map(int,readline().split())

xdist = tx - sx
ydist = ty - sy

ans = "R" * xdist + "U" * ydist + "L" * xdist + "D" * ydist

ans += "L" + (ydist + 1) * "U" + "R" * (xdist + 1) + "D"
ans += "R" + (ydist + 1) * "D" + "L" * (xdist + 1) + "U"

print(ans)
# Judge status: Wrong Answer
N = int(input())
A = [input() for i in range(N)]
import copy
B = copy.copy(A)
B.sort()
a1 = B[-1]
a2 = B[-2]
if a1 == a2:
  for i in range(N):
    print(a1)
else:
  for i in range(N):
    if A[i] == a1:
      print(a2)
    else:
      print(a1)
# Judge status: Wrong Answer
n=int(input())
for i in range(1,10**9):
    print(i)
    if i*i > n:
        break
print((i-1)*(i-1))
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
k = sum(b)-sum(a)
c,d = 0,0
for i in range(n):
  e = b[i]-a[i]
  if e<=0:
    d -= e
  else:
    c+= (e+1)//2
    d+= e%2 
print("Yes" if k>=c and k>=d else "No")
# Judge status: Wrong Answer
##Educational-DP B
n,k = map(int,input().split())
h = tuple(map(int,input().split()))

dp = [10**4 + 1] * n
dp[0] = 0

for i in range(1,n):
    for j in range(max(0,i-k),i):
        dp[i] = min(dp[i],dp[j]+abs(h[j]-h[i]))
        
#print(dp)
print(dp[-1])
# Judge status: Wrong Answer
a, b, c = list(map(int, input().split()))

print(10 * max([a, b, c]) + sum([a, b, c]))
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))
Q = int(input())

dp = [0 for _ in range(10**5+10)]

for a in range(len(A)):
    dp[A[a]] += 1
s = sum(A)

for q in range(Q):
    B, C = map(int,input().split())
    dp[C] += dp[B]
    s +=(C-B)*dp[B] 
    dp[B] = 0
    print(s)
# Judge status: Accepted
K = int(input())

from collections import deque

nlist = deque([1,2,3,4,5,6,7,8,9])

for i in range(K):
    sample = nlist.popleft()
        
    if sample%10 != 0:
        nlist.append(sample*10 - 1 + sample%10)
            
    nlist.append(sample*10 + sample%10)
        
    if sample%10 != 9:
        nlist.append(sample*10 + 1 + sample%10)
    
print(sample)
# Judge status: Accepted
lists = [input() for i in range(int(input()))]
dct = {'AC':0, 'WA':0, 'TLE':0, 'RE':0}
for lst in lists:
    if lst in dct:
        dct[lst] += 1

for k, v in dct.items():
    print(k,'x',v)
# Judge status: Accepted
n = int(input())
s = input()
ans = [0]
x = 0
for i in range(n):
  if s[i] == 'I':
    x += 1
    ans.append(x)
  else:
    x -= 1
    ans.append(x)
#print(ans)
print(max(ans))
# Judge status: Accepted
a,b=map(int,input().split())
res = 0
c = a+b
if c % 2 == 1:
  print("IMPOSSIBLE")
else:
  res = int(c/2)
  print(res)
# Judge status: Accepted
w=list(input())
w.sort()
if len(w)%2==0:
    for i in range(0,len(w),2):
        if w[i]!=w[i+1]:
            print('No')
            exit()
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
from math import gcd
K = int(input())

ans = 0

for i in range(K):
    for j in range(K):
        t = gcd(i, j)
        for k in range(K):
            ans += gcd(t, k)

print(ans)