peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
a, b = map(int, input().split())
if (a*b) % 2:
    print("Odd")
else:
    print("Even")
# Judge status: Accepted
s = input()
print('Yes' if len(set(s)) == 3 else 'No')
# Judge status: Accepted
n, l = map(int, input().split())
s = sorted([input() for _ in range(n)])

print(*s, sep='')
# Judge status: Wrong Answer

A,B,K = [int(i) for i in input().split(" ")]

def check(A,B,K):
    if A > K:
        A-=K
        K = 0
    else:
        result = K-A
        A = 0
        K = result
    B-=K
    return "{0} {1}".format(A,B)

print(check(A,B,K))
# Judge status: Accepted
a, b = map(int, input().split())
if (a-b)%2 == 0:
	print(int((a+b)/2))
else:
	print('IMPOSSIBLE')
# Judge status: Accepted
import numpy as np

N, D = map(int, input().split())
X = []
for i in range(N):
  X.append(list(map(int, input().split()))) # OK!

# Compute each distances
dis = [[0 for i in range(N)] for j in range(N)]
for i in range(N):
  for j in range(i+1, N):
    for k in range(D):
      dis[i][j] += (X[i][k]-X[j][k])**2 # OK!

# Check integer or not
dot = 0
for i in range(N):
  for j in range(i, N):
    dis[i][j] = np.sqrt(dis[i][j])
    if dis[i][j].is_integer() and dis[i][j] != 0:
      dot += 1

print(dot)
# Judge status: Wrong Answer
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
if k > e-a and k > e-b and k > e-c and k > e-d and k > d-c and k > d-b and k > d-a and k > c-b and k > c-a and k > b-a:
  print('Yay!')
else:
  print(':(')
# Judge status: Accepted
N = int(input())
power = 1

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

print(power)
# Judge status: Accepted
N,K = map(int,input().split())
lsh = [int(input()) for _ in range(N)]
lsh.sort()
ans = 10**9
for i in range(N-K+1):
    ans = min(ans,lsh[i+K-1]-lsh[i])
print(ans)
# Judge status: Accepted
n = int(input())

for i in range(1,10):
  for s in range(1,10):
    if i*s==n:
      print("Yes")
      exit()
print("No")
# Judge status: Accepted
from fractions import gcd
n = int(input())
a = list(map(int,input().split()))
l = [0]
r = [0]
ans = 0
for i in range(n-1):
    l.append(gcd(l[i],a[i]))
for i in range(n-1):
    r.append(gcd(r[i],a[n-1-i]))
for i in range(n):
    ans = max(ans,gcd(l[i],r[-i-1]))
print(ans)
# Judge status: Accepted
import fractions
from functools import reduce

def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)


def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

N=int(input())
A=list(map(int,input().split()))
MOD=(10**9)+7
S=list(set(A))
LCM=lcm_list(S)
ans=0

for i in range(N):
    ans+=(LCM//A[i])


print(ans%MOD)
# Judge status: Wrong Answer
import math

N = int(input())
S = ''

while N:
    r = N%2
    N = N//(-2)+r
    S += str(r)

print(S[::-1])
# Judge status: Accepted
N=int(input())
ans=(N-1)*N//2
print(ans)
# Judge status: Accepted
A= input()
if A[0]=="A" and A[2:-1].count("C")==1:
    pass
else:
    print("WA")
    exit()
B=A[1:]
B=B.replace("C","")
if B.islower()==True:
    print("AC")
else:
    print("WA")
# Judge status: Accepted
# cook your dish here
n=int(input())
arr=list(map(int,input().split()))
blank=[0]*n
for i in range(len(arr)):
    blank[arr[i]-1]+=1
for i in blank:
    print(i)
# Judge status: Accepted
n,m=list(map(int,input().split()))

if n==m:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
N = int(input())
S_list = []
for _ in range(N):
  S = str(input())
  S_list.append(S)
# print(S_list)
AC_list = [S == 'AC' for S in S_list]
WA_list = [S == 'WA' for S in S_list]
TLE_list = [S == 'TLE' for S in S_list]
RE_list = [S == 'RE' for S in S_list]
print('AC x {}'.format(sum(AC_list)))
print('WA x {}'.format(sum(WA_list)))
print('TLE x {}'.format(sum(TLE_list)))
print('RE x {}'.format(sum(RE_list)))
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))

Ad = [A[i] - A[i+1] for i in range(N-1)]

ans = 1
p = 0
for d in Ad:
    if d * p < 0:
        ans += 1
        p = 0
    elif d != 0:
        p = d

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

if C<A+B:
  print('Yes')
else:
  print('No')
# Judge status: Wrong Answer
# AtCoder
n = int(input())
s = input()

if len(s) >= n:
    print(f'{s[:n]}...')
else:
    print(s)
# Judge status: Accepted
s = list(str(input()))
c = ""
for i in range(len(s)):
    if s[i] == "?":
        s[i] = "D"
for i in range(len(s)):
    c += s[i]
print(c)
# Judge status: Accepted
H,W = map(int,input().split())
if H == 1 or W == 1:
    print(1)
    exit(0)
elif H % 2 != 0 and W % 2 != 0:
    print((H * W // 2) + 1)
else:
    print(H * W // 2)
# Judge status: Wrong Answer
n,m = map(int,input().split())
x = list(map(int,input().split()))
x = sorted(x)
dif = []
for i in range(m-1):
    dif.append(x[i+1]-x[i])
dif = sorted(dif)
print(sum(dif[:m-n]))
# Judge status: Accepted
a,b,c,d=map(int,input().split())
print(max(min(b,d)-max(a,c),0))
# Judge status: Wrong Answer
X, K, D = map(int, input().split())

if abs(X) - K * D < 0:
    d = abs(X) // D
    print(min(abs(abs(X) - d * D), abs(abs(X) - (d+1) * D)))
else:
    print(abs(X) - K * D)
# Judge status: Accepted
n, q = map(int, input().split())
s = input()
lr = [[0] * 2 for _ in range(q)]
for i in range(q):
    l, r = map(int, input().split())
    lr[i][0], lr[i][1] = l, r

chk = [0] * n
cnt = [0] * n
for i in range(1, n):
    if s[i] == 'C':
        if s[i-1] == 'A':
             chk[i] = 1
    cnt[i] = cnt[i-1] + chk[i]

for i in lr:
    print(cnt[i[1]-1] - cnt[i[0]-1])
# Judge status: Accepted
n = int(input())

def modpow(a, n, mod):
  res = 1
  while n > 0:
    if n & 1:
      res = res * a % mod
    a = a * a % mod
    n >>= 1
  return res

mod = 1000000007
ans = modpow(10, n, mod) - (modpow(9, n, mod) + modpow(9, n, mod) - modpow(8, n, mod))
ans = ans % mod
print(ans)
# Judge status: Accepted
N = int(input())
H = list(map(int, input().split()))

for i in range(1, N):
    if H[i] - H[i - 1] > 0:
        H[i] -= 1
    if H[i] - H[i - 1] < 0:
        print("No")
        break
else:
    print("Yes")
# Judge status: Accepted
import math

A = input()
B = input()
C = input()
D = input()
E = input()

num = 10
for i in [int(A[-1]), int(B[-1]), int(C[-1]), int(D[-1]), int(E[-1])]:
    if i != 0:
        num = min(num, i)

result = (math.ceil(int(A)/10) + math.ceil(int(B)/10) + math.ceil(int(C)/10) + math.ceil(int(D)/10) + math.ceil(int(E)/10)) * 10
if num != 10:
    result = result - 10 + num

print(result)
# Judge status: Accepted
from sys import stdin
import math
import fractions

a, b, c, d = [int(x) for x in stdin.readline().rstrip().split()]

while True:
    c -= b
    if c <= 0:
        print('Yes')
        break
    a -= d
    if a <= 0:
        print('No')
        break
# Judge status: Accepted
N = int(input())
S = input()

stack = []
for c in S:
    if len(stack) > 0:
        last = stack[-1]
        if last == '(' and c == ')':
            stack = stack[:-1]
            continue
    stack.append(c)

left = stack.count(')')
right = stack.count('(')

print(left * '(' + S + right * ')')
# Judge status: Accepted
N, M = map(int, input().split())
A = list(map(int, input().split()))

J = sum(A)/(4*M)
cnt = 0

for i in range(N):
    if A[i]>=J:
        cnt+=1

if cnt>=M:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
x, y = map(int, input().split())

if 2 * y < x:
	print(0)
elif y > 2 * x:
	print(0)
elif (x + y) % 3 != 0:
	print(0)
else:
	p = 10**9 + 7
	s = int((2 * x - y) / 3)
	t = int((2 * y - x) / 3)
	u = min(s, t)
	v = s + t
	
	inv = [0] * (u + 1)
	inv[0] = 0
	ans = 1
	for i in range(1, u + 1):
		inv[i] = pow(i, p - 2, p)
		ans = (ans * (v - i + 1) * inv[i]) % p
	
	print(ans)
# Judge status: Wrong Answer
n = int(input())

i = 0
ab = []
while i < n:
    a, b = map(int, input().split())
    ab.append((a, b)) 
    i += 1

ab.sort(key=lambda x: x[1])

days = ab[0][0]

i = 1
ans = 'Yes'
while i < n:
    days += ab[i][0]
    print(days)
    if days > ab[i][1]:
        ans = 'No'
        break
    i += 1
print(ans)
# Judge status: Accepted
N, X, Y = map(int, input().split())

ans = [0] * (N - 1)
ans[0] = 1

for i in range(1, N - 1):
    for j in range(i + 1, N + 1):
        d = min(j - i, abs(Y - j) + abs(X - i) + 1)
        ans[d - 1] += 1

for a in ans:
    print(a)
# Judge status: Wrong Answer
n = int(input())
color = [int(input())]
for _ in range(n-1):
  key = int(input())
  if key <= color[0]:
    color.append(key)
  else:
    l, r = 0, len(color)
    while r-l > 1:
      k = (r+l)//2
      if key <= color[k]:
        l = k
      else:
        r = k
    if l == 0:
      if r == len(color):
        pass
      elif key > color[r]:
        l = r
    color[l] = key
  color.sort()
print(len(color))
# Judge status: Accepted
n = int(input())
for i in range(n):
    t,x,y=map(int,input().split())
    if (x + y) > t or (x + y + t) % 2:
        print("No")
        exit()
print("Yes")
# Judge status: Accepted
import sys
sys.setrecursionlimit(10000000)

mod = 10 ** 9 + 7
def pow(a, n):
    if n == 0:
        return 1
    if n == 1:
        return a
    tmp = pow(a, n//2)
    tmp = (tmp * tmp) % mod
    if n % 2 == 1:
        tmp = (tmp * a) % mod
    return tmp

n = int(input())
print()
print((((pow(10, n) - 2 * pow(9, n) + mod ** 2) % mod) + pow(8, n)) % mod)
# Judge status: Wrong Answer
x, y, a,b, c = map(int, input().split())
P = list(map(int, input().split())); P.reverse()
Q = list(map(int, input().split())); Q.reverse()
R = list(map(int, input().split())); R.reverse()

ans = 0
PQ = P[:x] + Q[:y]; PQ.sort(); PQ.reverse()

for i in range(len(PQ)):
    if max(PQ) >= max(R):
        ans += max(PQ)
    else:
        ans += max(R)
        del R[0]
    del PQ[0]

print (ans)
# Judge status: Accepted
N = int(input())
A = list(map(lambda x: int(x) - 1, input().split()))
C = [0] * N
for a in A:
    C[a] += 1


def comb(n):
    if n <= 1:
        return 0
    else:
        return n * (n - 1) // 2


t = sum(list(map(comb, C)))
for a in A:
    print(t - comb(C[a]) + comb(C[a] - 1))
# Judge status: Accepted
#  --*-coding:utf-8-*--

S = input()
T = set(s for s in S)

print('No' if ('S' in T)^('N' in T) or ('E' in T)^('W' in T) else 'Yes')
# Judge status: Accepted
n=int(input())
def f(s):
  return "".join(sorted(list(s)))
s=[f(input())for _ in range(n)]
from collections import Counter
d=Counter(s)
ans=0
for i in d:ans+=d[i]*(d[i]-1)//2
print(ans)
# Judge status: Accepted
import sys
import math
import itertools

s=input()
min=9999999999
for i in range(0,len(s)-2,1):
	num=abs(int(s[i:i+3])-753)
	if min>=num:
		min=num
print(min)
# Judge status: Wrong Answer
n = int(input())
p = list(map(lambda x: int(x), input().split()))
mins = p[0]
def function(p, i, mins):
  if mins >= p[i]:
    return 1
  else:
    mins = p[i]
    return 0
sums = sum([function(p,i, mins) for i in range(1, n)])
print(sums)
# Judge status: Accepted
def main():
    s = input()

    print('Yes' if s[2] == s[3] and s[4] == s[5] else 'No')


if __name__ == '__main__':
    main()
# Judge status: Accepted
X,Y = map(int, input().split())
print(X if X%Y else -1)
# Judge status: Wrong Answer
N = int(input("N--->"))
A = int(input("A--->"))

b = N%500

if A > b:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
s = input()

ans=0

if s.count("R")>0: ans = 1

if s[:2]=="RR": ans = 2
if s[1:]=="RR": ans = 2

if s == "RRR": ans = 3

print(ans)
# Judge status: Wrong Answer
def main():
    S = input()
    mind = 1000
    for i in range(len(S) - 3 + 1):
        print(S[i:i+3])
        d = abs(753 - int(S[i:i+3]))
        if d < mind:
            mind = d
    print(mind)
main()
# Judge status: Accepted
n = int(input())
s = input()
M = 0
for i in range(1, n):
    cnt = 0
    s1 = s[:i]
    s2 = s[i:]
    t = {}
    for x in s1:
        if x not in t: t[x]=1
    for k in s2:
        if k not in t: t[k]=0
        if t[k] == 1: t[k]+=1
    for x, y in t.items():
        if y==2: cnt+=1
    M = max(cnt, M)
print(M)
# Judge status: Accepted
n=int(input())
if n==1: print(0); exit()
M=10**6+1
l=[]
p=[1]*M
p[0]=p[1]=0
for i in range(2,M):
  if p[i]:
    l.append(i)
    for j in range(2*i,M,i):
      p[j]=0
d={}
for k in l:
  c=0
  while n%k==0: n//=k; c+=1
  if c>0: d[k]=c
s=[1]
for i in range(2,9):
  s.append(s[-1]+i)
a=0
for i in d.values():
  for j in s:
    if j>i: break
    a+=1
print(a+(n>1))
# Judge status: Accepted
s = input()

if s == 'hi' or s == 'hihi' or s == 'hihihi' or s == 'hihihihi' or s == 'hihihihihi':
  print('Yes')
else:
  print('No')
# Judge status: Accepted
H, W = list(map(int, input().split()))
if(min(H, W) == 1):
    print(1)
else:
    print(int(H*W/2) + H*W%2)
# Judge status: Accepted
A=[int(i)*500 for i in range(0,int(input())+1)]
B=[int(i)*100 for i in range(0,int(input())+1)]
C=[int(i)*50 for i in range(0,int(input())+1)]
X=int(input())  
l=[]
for a in A:
  for b in B:
    for c in C:
      l.append(a+b+c)
print(l.count(X))
# Judge status: Accepted
import sys
a, b, c = map(int, input().split())
var = 0
for i in range(1000):
    if a%2 != 0 or b%2 != 0 or c%2 != 0:
        print(var)
        sys.exit()
    a, b, c = b/2 + c/2, a/2 + c/2, a/2 + b/2
    var += 1
print(-1)
# Judge status: Accepted
# -*- coding: utf-8 -*-
"""
Created on Sat Jul 25 21:02:29 2020

@author: NEC-PCuser
"""

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

# B > A C > B
for i in range(K):
    if (C <= B):
        C *= 2
    elif B <= A:
        B *= 2

if (A < B and B < C):
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
def resolve():
    N = int(input())
    if (N + 1) * 100 % 108 == 0:
        print(":(")
    else:
        print(int((N+1)/1.08))
resolve()
# Judge status: Accepted
N, K = [int(i) for i in input().split()]
ab = [[int(i) for i in input().split()] for _ in range(N)]
ab.sort(key=lambda x: x[0])
for a, b in ab:
    K -= b
    if K <= 0:
        print(a)
        break
# Judge status: Accepted
N = int(input())
arm_range = []
for _ in range(N):
    X,L = map(int,input().split())
    arm_range.append([X+L,X-L])

arm_range = sorted(arm_range)

limit = arm_range[0][0]
ans = 1

for i in range(1,N):
    if arm_range[i][1] >= limit:
        ans += 1
        limit = arm_range[i][0] 

print(ans)
# Judge status: Wrong Answer
A, B, C, D = (int(x) for x in input())

class Op(int):
  def __str__(self):
     return '-' if self < 0 else '+'
    
pm = (Op(1), Op(-1))    

for op1 in pm:
  for op2 in pm:
    for op3 in pm:
      if A + op1 * B + op2 * C + op3 * D == 7:
        print(''.join(str(x) for x in [A, op1, B, op2, C, op3, D]) + '=7')
        break
# Judge status: Accepted
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

list = [a, b, c, d, e]

can = False
for i in range(len(list)):
  for j in range(len(list)):
    if i == j:
      continue
    if abs(list[i] - list[j]) <= k:
      can = True
    else:
      can = False
      break
      
if can:
  print("Yay!")
else:
  print(":(")
# Judge status: Accepted
def main():
    N, M = list(map(int, input().split(' ')))
    max_l, min_r = 1, N
    for _ in range(M):
        L, R = list(map(int, input().split(' ')))
        max_l = max([max_l, L])
        min_r = min([min_r, R])
    print(max([min_r - max_l + 1, 0]))


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

n_kabu = 0
money = 1000
for d in range(N-1):
    kabuka_today = A[d]
    kabuka_tomorrow = A[d+1]
    if kabuka_today < kabuka_tomorrow:
        can_buy = money//kabuka_today
        n_kabu += can_buy
        money -= can_buy*kabuka_today
    elif kabuka_today > kabuka_tomorrow:
        money += n_kabu*kabuka_today
        n_kabu = 0

money += n_kabu*A[N-1]

print(money)
# Judge status: Accepted
a,b = input().split()
x = int(a+b)
for i in range(1,317):
  if i * i == x:
    print('Yes')
    exit()
print('No')
# Judge status: Accepted
def resolve():
    s = input()
    if s[2]==s[3] and s[4]==s[5]:
        print('Yes')
    else:
        print('No')

resolve()
# Judge status: Wrong Answer
n,m = map(int,input().split())
li = []
for i in range(n):
    ka = list(map(int,input().split()))
    li.extend(ka[1:])
ans = 0
for i in range(m):
    if li.count(i) == n:
        ans += 1
print(ans)
# Judge status: Wrong Answer
N = int(input())
sum = 0
for i in range(1,N+1):
  sum+=i*(1+N//i)*(N//i)/2
print(sum)
# Judge status: Accepted
n=int(input())
count=0
for i in range(n):
  me1,me2=list(map(int,input().split()))
  if me1==me2:
    count+=1
    if count==3:
      break
  else:
    count=0
if count>=3:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
a,b = map(int,input().split())
x = 0
if b < 10:
    x = 10*a + b
elif b < 100:
    x = 100*a + b
else:
    x = 1000*a + b

if (x**0.5)%1 == 0:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
import statistics

n = int(input())
a = list(map(int, input().split()))

bi = []
for i in range(n):
    bi.append(a[i] - (i))

b = int(statistics.median(bi))

ans = 0
for i in range(n):
    ans += abs(bi[i] - b)

print(ans)
# Judge status: Accepted
S=input()
if S[0]==S[1] or S[1]==S[2] or S[2]==S[3]:
    print('Bad')
else:
    print('Good')
# Judge status: Accepted
import fractions
a,b=map(int, input().split())
print(round(a*b/fractions.gcd(a, b)))
# Judge status: Accepted
n, a, b = map(int, input().split())

if b > a:
    a, b = b, a

if (a - b) % 2 == 0:
    print((a - b) // 2)
else:
    print(min(a - 1, n - b) + 1 + (b - a - 1) // 2)
# Judge status: Wrong Answer
import math

num = int(input())
a_i = list(map(int, input().split()))
anslist = [0] * (num + 1)
for x in range(num):
    val = x + 1
    cnt = a_i.count(val)
    if cnt <= 1: anslist[val] = 0
    else: anslist[val] = math.factorial(cnt - 1)

ans = sum(anslist)
for x in range(num):
    val = a_i[x]
    cnt = a_i.count(val)
    if cnt <= 2: print(ans)
    else: 
        sa = anslist[val] - math.factorial(cnt - 2)
        print(ans - sa)
# Judge status: Accepted
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

n = int(readline())
a = [list(map(int, readline().split())) for _ in range(2)]

ans = 0
for i in range(n):
    ans = max(ans, sum(a[0][:i + 1:]) + sum(a[1][i::]))
print(ans)
# Judge status: Accepted
l = (input())
s = ''
for i in range(len(l)):
    s+='x'
print(s)
# Judge status: Accepted
import sys
def input(): return sys.stdin.readline().rstrip()

def main():
    N = int(input())
    S = list(input())

    ans = 10 ** 6
    sum_count = S.count('E')
    for s in S:
        aft = 0
        if s == 'W':
            aft = 1
        else:
            sum_count -= 1
        ans = min(ans, sum_count)
        sum_count += aft
    print(ans)

if __name__ == '__main__':
    main()
# Judge status: Accepted
import math
N = int(input())
P = [int(i) for i in input().split()]
Q = [int(i) for i in input().split()]
def count(U):
    S = sorted(U)
    C = 1
    for i,j in enumerate(U):
        c = 0
        for u,v in enumerate(S):
            if v == j:
                del S[u]
                break
            else:
                c += 1
        C += (math.factorial(N-i-1))*c
    return C
print(abs(count(P)-count(Q)))
# Judge status: Accepted
s=input()

if s[0]==s[1] or s[1]==s[2] or s[2]==s[3]:
    print("Bad")
else:print("Good")
# Judge status: Accepted
N=int(input())
print(1-(N//2)/N)
# Judge status: Accepted
n, m = map(int,input().split())

if n == 1 and m == 1:
    print(1)
elif n == 1 or m == 1:
    print(max(max(n,m)-2,0))
else:
    print((n-2)*(m-2))
# Judge status: Accepted
S=input()
if S=="RRR" :
  print(3)
elif S=="RRS" :
  print(2)
elif S=="SRR" :
  print(2)
elif S=="RSS" :
  print(1)
elif S=="SRS" :
  print(1)
elif S=="SSR" :
  print(1)
elif S=="RSR" :
  print(1)
else :
  print(0)
# Judge status: Wrong Answer
r,g ,b=map(int,input().split())
A=100*r+10*g+b
if A%4==0:
    print("Yes")
else :
    print("No")
# Judge status: Accepted
a=int(input())
b=int(input())
h=int(input())

print(int((a+b)*h/2))
# Judge status: Accepted
import sys
def input(): return sys.stdin.readline().rstrip()
import numpy as np
def main():
    h,n=map(int,input().split())
    lis=np.array([list(map(int,input().split())) for _ in range(n)])
    dp=np.zeros(h+1,int)
    dp[0]=0
    for i in range(1,h+1):
        dp[i]=np.min(dp[np.maximum(i-lis[:,0],0)]+lis[:,1])
    print(dp[h])

if __name__=='__main__':
    main()
# Judge status: Accepted
a=input()
b=input()


N=int(a)
An = [int(b0) for b0 in b.split(' ')]

Cn=[0]*len(An)
for i in range(len(An)):
    Cn[An[i]-1] = i+1

for i in Cn:
    print(i, end=' ')
# Judge status: Accepted
k, a, b = map(int, input().split())
c = 1
if a + 2 >= b: print(c+k)
else:
    if k - (a+1) >= 0:
        k = k - (a+1)
        c = b
        c += (k//2)*(b-a) + k%2
        print(c)
    else:
        print(c+k)
# Judge status: Wrong Answer
c = input()
print("vowel" if c in "aiueo" else "constant")
# Judge status: Accepted
from operator import itemgetter
N, *A = map(int, open(0).read().split())
X = [(x-l, x+l) for x, l in zip(*[iter(A)]*2)]
X.sort(key=itemgetter(1))
ans = 0
R = -float('inf')
for l, r in X:
    if R <= l:
        ans += 1
        R = r
print(ans)
# Judge status: Wrong Answer
n = int(input())
x = list(map(int,input().split()))
y = sorted(x)
index = n//2

for i in range(n):
  print(y[index] if x[i]<x[index] else y[index-1])
# Judge status: Accepted
money = int(input())
print(int(money/500) * 1000 + int((money % 500)/5) * 5)
# Judge status: Accepted
n, a, b = map(int, input().split())

m = a + b
n_set = n // m
n_mod = n % m

ans = a * n_set

if n_mod > a:
    ans += a
else:
    ans += n_mod
print(ans)
# Judge status: Accepted
K, A, B = map(int, input().split())

if B - A <= 2:
    print(K + 1)
else:
    time = max(0, (K - (A - 1)) // 2)
    ans = A + (B - A) * time
    if (K - (A - 1)) % 2 == 1:
        ans += 1
    print(ans)
# Judge status: Accepted
N,M=map(int,input().split())
ans = 0
if (N == 1) and (M == 1):
  ans = 1
elif M == 1:
  ans = N - 2
elif N == 1:
  ans = M - 2
else:
  ans = (M-2)*(N-2)
print(ans)
# Judge status: Accepted
import bisect
import itertools
n,m,k=map(int,input().split())
A=list(itertools.accumulate([0]+list(map(int,input().split()))))
B=list(itertools.accumulate([0]+list(map(int,input().split()))))

ans=0
for i,a in enumerate(A):
    if a>k:
        break
    cnt=bisect.bisect_right(B,k-a)-1
    ans=max(ans,i+cnt)
print(ans)
# Judge status: Accepted
n = int(input())
h = list(map(int,input().split()))

a = h[0]
for i in range(1,n):
    if a == h[i]:
        pass
    elif a < h[i]:
        h[i] -= 1
        a = h[i]
    else:
        print("No")
        exit()
print("Yes")
# Judge status: Accepted
a=int(input())
b=int(input())
c=int(input())
x=int(input())

ans=0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            if 500*i+100*j+50*k==x:
                ans+=1
print(ans)
# Judge status: Accepted
s = input()
a = s.count('a')
b = s.count('b')
c = s.count('c')
if max(a,b,c) - min(a,b,c) <= 1:
    print('YES')
else:
    print('NO')
# Judge status: Wrong Answer
n,l = map(int,input().split())
lst = 0
if l>=0:
    for i in range(1,n+1):
        lst+=l+(i-1)
    a = lst - l
elif l < 0 and l+n-1 >=0:
        for i in range(1,n+1):
            if l+i-1 == 0:
                lst+=l+(i-1)
        a = lst
elif l+n-1 <0:
    for i in range(1,n+1):
        lst+=l+(i-1)
    a = lst - (l+n-1)
print(a)
# Judge status: Wrong Answer
a, b  = [int(i) for i in input().split()]
x = 0
x = a*(a-1)/2+b*(b-1)/2
print(x)
# Judge status: Accepted
H, A = map(int,input().split())
 
for i in range(H+1):
    if H > 0:
        H = H - A
    else:
        print(i)
        break
# Judge status: Accepted
from sys import stdin

[X, Y] = [int(x) for x in stdin.readline().rstrip().split()]

index=1
while(True):
    X = 2*X
    if X<=Y:
        index+=1
    else:
        break

print(index)
# Judge status: Accepted
str = input()
 
str_length = len(str)
 
import random
 
start_num = random.randint(0,str_length-3)
 
print(str[start_num:start_num+3])
# Judge status: Accepted
N = int(input())
s = set()
for _ in range(N):
    s.add(input())
print(len(s))
# Judge status: Wrong Answer
N=int(input())
p=list(map(int,input().split()))
p.append(0)
count=0
for i in range(N):
    if p[i]==i+1:
        if p[i+1]!=i+2:
            count+=1
print(count)
# Judge status: Accepted
x,a,b=map(int,input().split())
print('A' if abs(a-x)<abs(b-x) else 'B')