peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
S = input()

target = "keyence"
N = len(target)

for i in range(8):
    s = S[:i] + S[len(S) - N + i :]
    if s == target:
        print("YES")
        break
else:
    print("NO")
# Judge status: Wrong Answer
N = int(input())
B = list(map(int,input().split()))

for i in range(N-2):
    if(B[i]>B[i+1]):
        for j in range(i,-1,-1):
            if(B[j]>B[i+1]):
                B[j] = B[i+1]
            else:
                break
ans = B[0]
for i in B:
    ans += i
print(ans)
# Judge status: Accepted
n,k=map(int,input().split())
s=list(input())
if s[k-1]=='A':
  s[k-1]='a'
elif s[k-1]=='B':
  s[k-1]='b'
else:
  s[k-1]='c'
for i in range(n):
  print(s[i],end='')
# Judge status: Wrong Answer
x = input()

t = 0
s = 0
for i in x:
    if i == "T":
        t += 1
    else:
        break
for j in x[::-1]:
    if j == "S":
        s += 1
    else:
        break

b = x[t:-s]
print(t + s + abs(b.count("S") - b.count("T")))
# Judge status: Accepted
from decimal import Decimal,ROUND_FLOOR
[A,B] = input().split()
A = Decimal(A)
B = Decimal(B)

print((A*B).quantize(Decimal('0'),rounding = ROUND_FLOOR))
# Judge status: Accepted

def solve():
    n = int(input())
    a = [int(x) for x in input().split()]
    for x in a:
        if x==0:
            print(0)
            return

    ans = 1
    for x in a:
        ans *= x
        if ans > 10**18:
            print(-1)
            return

    print(ans)

solve()
# Judge status: Accepted
def main():
    import sys
    input = sys.stdin.readline
    N, W = map(int, input().split())
    wv = [tuple(map(int, input().split())) for i in range(N)]

    dp = [-1]*(W+1)
    dp[0] = 0
    for w, v in wv:
        for j in range(W-w, -1, -1):
            if dp[j] >= 0 and dp[j+w] < dp[j]+v:
                dp[j+w] = dp[j] + v

    print(max(dp))


main()
# Judge status: Accepted
K = int(input())

ans = 1
now = 7 % K
isvisited = set()

while now != 0:
    if now in isvisited:
        print(-1)
        exit()
    isvisited.add(now)
    now = (now * 10 + 7) % K
    ans += 1

print(ans)
# Judge status: Accepted
a,b=map(int,input().split())
if a<=b:
    print(a)
else:
    print(a-1)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
a.sort()
flag = [True] * (a[-1] + 1)
memo = -1
for i in a:
    if memo == i:
        flag[i] = False
        continue
    memo = i
    tmp = 2 * i
    while tmp <= a[-1]:
        flag[tmp] = False
        tmp += i
ans = 0
for i in a:
    if flag[i]: ans += 1
print(ans)
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
s=sum(b)
for x in range(len(a)-1):
    if a[x+1]-a[x]==1:
        s+=c[a[x]-1]
print(s)
# Judge status: Wrong Answer
def main():
    X = input()
    s, t = 0, 0
    for x in X:
        if x == "S":
            s += 1
        else:
             t += 1
    for x in X:
        if x == "T":
            t -= 1
        else:
            break
    for x in X[::-1]:
        if x == "S":
            s -= 1
        else:
            break
    print(len(X) - min(s, t) * 2)
main()
# Judge status: Accepted
a = [] 
for i in range(3):
    a.extend(input().split())
n = int(input())
for i in range(n):
    c = input()
    if c in a:
        a[a.index(c)] = '0'
if (a[0] == a[1] == a[2] or a[3] == a[4] == a[5] or a[6] == a[7] == a[8] or
    a[0] == a[3] == a[6] or a[1] == a[4] == a[7] or a[2] == a[5] == a[8] or
        a[0] == a[4] == a[8] or a[2] == a[4] == a[6]):
    print('Yes')
else:
    print('No')
# Judge status: Accepted
A = [int(a) for a in input().split()]

if sum(A) >=22:
    print("bust")
else:
    print("win")
# Judge status: Wrong Answer
arr=str(input())
a = len([1 for x in arr if x=='a'])
b = len([1 for x in arr if x=='b'])
c = len([1 for x in arr if x=='c'])
if a+b+c == 3:
  print('Yes')
else:
  print('No')
# Judge status: Wrong Answer
S=input()
s=str(S)
for i in range(len(s)):
    s.replace("x",s[i])

print(s)
# Judge status: Accepted
N = int(input())
S = input()
T = input()
for i in range(N + 1):
    if S[i:] == T[: N - i]:
        print(N + i)
        break
# Judge status: Accepted
n,m = map(int,input().split())
ans = n*(n-1)//2 + m*(m-1)//2
print(ans)
# Judge status: Accepted
a, b = map(int, input().split())

s_a, s_b = '', ''
for i in range(b):
    s_a += str(a)
for i in range(a):
    s_b += str(b)
if s_a < s_b:
    print(s_a)
else:
    print(s_b)
# Judge status: Accepted
s = input(); n = len(s)
dp = [ [0,1<<32] for i in range(2) ]
for i in range(n):
  d = ord(s[i])-ord('0')
  dp[(i+1)%2][0] = min(dp[i%2][0], dp[i%2][1])+d
  dp[(i+1)%2][1] = min(dp[i%2][0], dp[i%2][1]-2)+11-d
print(min(dp[n%2][0],dp[n%2][1]))
# Judge status: Accepted
A, B, C = map(int, input().split())

sum_a = 0

for i in range(1, B+1):
    sum_a = A*i
    if sum_a % B == C:
        print("YES")
        exit()

print("NO")
# Judge status: Accepted
S = input()

N = len(S)
table = [-1] * N
T = [-1] * N
prev = 0
for i, s in enumerate(reversed(S)):
    prev += (int(s) * pow(10, i, 2019)) % 2019
    prev %= 2019
    T[i] = prev

DP = [0] * 2019
for t in T:
    DP[t] += 1

ans = DP[0]
for num in DP:
    ans += num * (num - 1) // 2

print(ans)
# Judge status: Wrong Answer
# For taking integer inputs.
def inp():
    return(int(input()))


# For taking List inputs.
def inlist():
    return(list(map(int, input().split())))


# For taking string inputs. Actually it returns a List of Characters, instead of a string, which is easier to use in Python, because in Python, Strings are Immutable.
def instr():
    s = input()
    return(list(s[:len(s)]))


# For taking space seperated integer variable inputs.
def invr():
    return(map(int, input().split()))


X = inp()
res = 0
for i in range(105, 99, -1):
    d = X % i
    for i in range(100, i):
        if d % i == 0:

            res = 1
            break
print(res)
# Judge status: Accepted
N = int(input())
SqN = 1
while True:
    if SqN**2>N:
        print((SqN-1)**2)
        break
    SqN += 1
# Judge status: Accepted
import sys
stdin = sys.stdin
sys.setrecursionlimit(10**6)
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

n = ni()
p = na()
ans = 0

for i in range(n-1):
    j = i+1
    if j == p[i]:
        p[i],p[i+1] = p[i+1],p[i]
        ans += 1
if p[-1] == n:
    ans += 1
print(ans)
# Judge status: Wrong Answer
import math
X = int(input())
now = 100
for i in range(10**7):
    now = math.floor(now*1.01)
    if now >= X:
        print(i+1)
        break
# Judge status: Accepted
a, b, c, d = map(int, input().split())
if abs(a - c) <= d or (abs(a - b) <= d and abs(b - c) <= d):
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
n = int(input())
L = list(map(int,input().split()))
kekka = 0
for i in range(n):
  if 2*L[i] > sum(L):
    kekka = 1
    break
    
if kekka == 1:
  print('No')
else:
  print('Yes')
# Judge status: Wrong Answer
d = input()
if d == "25":
    print("Christmas")
elif d == "24":
    print("Christmas Eve")
elif d == "23":
    print("Christmas Evel Eve")
elif d == "22":
    print("Christmas Eve Eve Eve")
# Judge status: Accepted
N, *AB = map(int, open(0).read().split())
ans = 0
for i in range(N):
    index = N - 1 - i
    a = AB[index * 2 + 0] + ans
    b = AB[index * 2 + 1]
    remainder = a % b
    ans += (b - remainder) % b
print(ans)
# Judge status: Accepted
S=input()
num=len(S)
a=[0]*(num+1)
for i in range(num):
  if S[i]=="<":
    a[i+1]=max(a[i+1],a[i]+1)
for i in range(1,num+1):
  if S[-i]==">":
    a[-(i+1)]=max(a[-(i+1)],a[-i]+1)
print(sum(a))
# Judge status: Wrong Answer
n = int(input())
li = list(map(int,input().split()))

li0 = sorted(li)

print(li)
print(li0)

j = 0
for i in range(n):
  if li0[i-1]==li0[i]:
    j = 1

if j == 0:
  print("YES")
else:
  print("NO")
# Judge status: Accepted
N, M = map(int,input().split())

if N == 1 and M == 1:
    print(1)
elif N == 1 or M == 1:
    print(N*M-2)
elif N == 2 or M == 2:
    print(0)
else:
    print((N-2)*(M-2))
# Judge status: Wrong Answer
n,m=map(int,input().split())
for i in range(m):
    if i%2==0:
        print(n-m-i,n-m+i+1)
    else:
        print(m-i,m+i+1)
# Judge status: Accepted
n = int(input())
print('Yes' if n%9==0 else 'No')
# Judge status: Accepted
a = int(input())
s = input()
if a < 3200 :
	print('red')
else :
	print(s)
# Judge status: Wrong Answer
n,k = map(int,input().split())
s = list(input())
c = 0
a = 0
for i in range(n-1):
	if s[i] == s[i+1]:
		c += 1
i = 0
if s[-1] == 'R':
	s.append('L')
else:
	s.append('R')

while a < k and len(s) >= 2:
	if s[0] != s[1] and s[-1] != s[-2] and s[0] == s[-1]:
		c += 2
		a += 1
	s = s[1:]

	i += 1
print(c)
# Judge status: Wrong Answer
def Atcoder111(n):

    ans = ""

    if int(n[0]) >= int(n[1]) >= int(n[2]):
        ans = n[0]*3
    else:
        ans = int(n[0]*3)
        ans += 111

    return ans

def main():
    n = str(input())
    print(Atcoder111(n))

if __name__ == '__main__':
    main()
# Judge status: Accepted
import sys
input = sys.stdin.readline

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    N=I()
    from collections import defaultdict
    dd = defaultdict(int)
    
    a=LI()
    for i in range(N):
        
        dd[a[i]]+=1
        dd[a[i]-1]+=1
        dd[a[i]+1]+=1
        
    ans=0
    for k,v in dd.items():
        ans=max(ans,v)
        
    print(ans)

main()
# Judge status: Accepted
n = int(input())
a = [int(input()) for _ in range(n)]
ans = [0]*n
count = 0
num = a[0]
index = 1
while ans[1] != 1:
    count += 1
    ans[index-1] += 1
    if ans[index-1] >= 2:
        print(-1)
        exit()
    index = num
    num = a[num-1]
print(count-1)
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))
B = [a-i-1 for i,a in enumerate(A)]
med = list(sorted(B))[N//2]
print(sum([abs(a-med) for a in B]))
# Judge status: Wrong Answer
import math

n, h = 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))
maxa = max(az)
minb = min(bz)
cnt = 0
for i in bz:
    if i >= maxa and h > 0:
        h -= i
        cnt += 1
if h > 0:
    cnt += math.ceil(h / maxa)
print(cnt)
# Judge status: Wrong Answer
a = input().split(' ')
b = input().split(' ')
a = [int(a) for a in a]
b = [int(b) for b in b]

b.sort(reverse=True)
v = sum(b)

ans = 'Yes'

if b[a[1]-1] / v < 1 / 20:
    ans = 'No'
            
print(ans)
# Judge status: Wrong Answer
s = input()
a = s[:2]
b = s[2:4]
a = int(a)
b = int(b)
ok_a = True
ok_b = True
if a == 0 or b == 0:
    print('NA')
    exit()
if a > 12: ok_a = False
if b > 12: ok_b = False
if ok_a == 1 and ok_b == 1: print('AMBIGUOUS')
elif ok_a == 1 and ok_b == 0: print('MMYY')
elif ok_a == 0 and ok_b == 1: print('YYMM')
else: print('NA')
# Judge status: Accepted
A, B = map(int, input().split())

ans = 0
for i in range(2):
    if A >= B:
        ans += A
        A -= 1
    else:
        ans += B
        B -= 1
print(ans)
# Judge status: Accepted
X = list(input())
N = len(X)
NHALF = N // 2

def solve():
    nt, ns = 0, 0
    for i in range(N):
        if X[i] == 'S':
            ns += 1
        elif ns > 0:
            ns -= 1
        else:
            nt += 1
    return nt + ns


print(solve())
# Judge status: Wrong Answer
n,*a=map(int,open(0).read().split());t=sum(a);v=w=1
for q in a:
  if(w:=min(2*(w-q),t:=t-q))<0 and(v:=v+w):exit(print(-1))
print(v)
# Judge status: Wrong Answer
n = int(input())
s = input().split()
for i in range(n):
  for j in range(i+1, n):
    if s[i] == s[j]:
      break
      print('No')
    elif i == n:
      print('Yes')
# Judge status: Wrong Answer
n,k=map(int,input().split())
D=set(map(int,input().split()))

for i in range(n,n*10+1):
    if i>=n and len(set(str(i))&D)==0:
        print(i)
        break
# Judge status: Wrong Answer
d,n=map(int,input().split())
if d==0:
    print(n)
else:
    print((100**d)*n)
# Judge status: Wrong Answer
n,m=map(int,input().split())
ab=[list(map(int,input().split())) for _ in range(m)]
b=min(ab[i][1] for i in range(m))
a=max(ab[i][0] for i in range(m))
print(b-a+1)
# Judge status: Accepted
S = input()
T = input()

for i in T:
  if T == S:
    print('Yes')
    exit()
  T = T + T[0]
  T = T[1:]
print('No')
# Judge status: Wrong Answer
#ABC179C

n = int(input())
# N = A*B+C

counter = 0

for i in range(1,n,1):
    if i == 1:
        for j in range(1,n,1):
            if n > i*j:
                counter += 1
    elif n % i > 0:
        counter += 1


print(counter)
# Judge status: Accepted
a,b,x=map(int,input().split())
if a<=x and a+b>=x :
    print('YES')
else:
    print('NO')
# Judge status: Wrong Answer
a,b,t = map(int, input().split())
print(((t+0.5)//a)*b)
# Judge status: Accepted
x,a,b = map(int,input().split())
A = abs(x - a)
B = abs(x - b)
if A > B:
  print("B")
elif A < B:
  print("A")
# Judge status: Wrong Answer
A,B,C=map(int,input().split())
if A==C or B==C or A+B==C:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
s=input()
newstring=''.join(list(reversed(s)))

while len(newstring)>0:
    if newstring[:5]=="maerd":
        newstring=newstring[5:]

    elif newstring[:7]=="remaerd":
        newstring=newstring[7:]

    elif newstring[:5]=="esare":
        newstring=newstring[5:]

    elif newstring[:6]=="resare":
        newstring=newstring[6:]

    else:
        print("NO")
        exit()

print("YES")
# Judge status: Wrong Answer
n=int(input())
s=input()
e=s.count('E')
w=s.count('W')
if e<=w:
  print(e-1)
else:
  print(w-1)
# Judge status: Wrong Answer
a, b, c = map(int, input().split())
if a + b > c:
  print("No")
else:
  print("Yes")
# Judge status: Accepted
mod = 10**9 + 7

n = int(input())
ans = 1
for i in range(1,n+1):
    ans = ans * i % mod

print(ans)
# Judge status: Accepted
import numpy as np
from numba import njit

n, k = map(int, input().split())
arr = np.array(list(map(int, input().split())))


@njit
def solve(n, k, arr):
    for i in range(min(k, 50)):
        tmp_arr = np.zeros(n + 2, np.int64)
        for i, power in enumerate(arr):
            tmp_arr[max(0, i - power + 1)] += 1
            tmp_arr[min(n + 1, i + power + 2)] -= 1
        arr = np.cumsum(tmp_arr)[1:-1]
    return arr


print(*solve(n, k, arr))
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))
count = 0 
while all(i % 2 == 0 for i in a):
  a = [int(i/2) for i in a]
  count += 1

print(count)
# Judge status: Accepted
N = int(input())
ans = "No"
for i in range(1,10):
    for j in range(1,10):
        if N == i*j :
            ans = "Yes"
print(ans)
# Judge status: Wrong Answer
import sys
input = sys.stdin.readline

N = int(input())
ans = -1
for i in range(1, N + 1):
    cnt = 0
    while i % 2 == 0:
        cnt += 1
        i //= 2
    ans = max(ans, cnt)
print(ans)
# Judge status: Wrong Answer
n=int(input())
a=list(map(int,input().split()))
ans=[0]*n
for i in range(n):
    j=a[i]
    ans[j-1]=i+1
print(ans)
# Judge status: Accepted
S = input()
T = input()
for _ in range(len(S)):
    if S == T:
        print('Yes')
        break
    S = S[-1] + S[:-1]
else:
    print('No')
# Judge status: Accepted
S = list(input())
T = list(input())

LT = len(T)
same = 0
if len(S) - LT != 0:
    for i in range(len(S) - LT):
        tS = S[i:i+LT]
        tmp = 0
        for j in range(LT):
            if T[j] == tS[j]:
                tmp += 1
        same = max(same,tmp)
    print(LT - same)
else:
    ans = 0
    for i in range(LT):
        if T[i] == S[i]:
            ans += 1
    print(LT - ans)
# Judge status: Accepted
from collections import Counter

def undivisible(A):
    m = max(A)
    dp = [True] * (m+1)
    A.sort()
    for a in A:
        if dp[a]:
            k = a * 2
            while k <= m:
                dp[k] = False
                k += a
    cnt = Counter(A)
    ans = 0
    for a in A:
        if dp[a] and cnt[a] == 1:
            ans += 1
    return ans

n = int(input())
A = list(map(int, input().split()))
print(undivisible(A))
# Judge status: Wrong Answer
n, k = map(int, input().split())
r, s, p = map(int, input().split())
d = {"r":p, "s":r, "p":s}
t = list(input())
dp = [0]*n
for i in range(n):
  if i>k and dp[i-k]==d[t[i]]:
    dp[i] = 0
    t[i] = "x"
  else:
    dp[i] = d[t[i]]
print(sum(dp))
# Judge status: Wrong Answer
N,X = map(int,input().split())
L = [int(i) for i in input().split()]
D = 0
count = 1
for n in L:
    if D > X or count > N + 1:
        break
    D += n
    count += 1
print(count)
# Judge status: Accepted
s=input()
t=input()
t=t[::-1]
if s==t:
  print("YES")
else:
  print("NO")
# Judge status: Accepted
import numpy as np

#  入力
n, k = list(map(int, input().split()))
h = np.array(list(map(int, input().split())))

#  方針
#  i番目の足場にいるという状態に対して
#  その足場に最も少ないコストを記録する．

dp = np.zeros(n, dtype=np.int)
for i in range(1, n):
    st = max(0, i - k)
    dp[i] = np.min(dp[st:i] + np.abs(h[i] - h[st:i]))

print(dp[-1])
# Judge status: Wrong Answer
A, B, X = map(int, input().split())
print("YES" if B >= X else "NO")
# Judge status: Accepted
N = int(input())

ans = ""

digit_count = 1
check = 26

while N > check:
    digit_count += 1
    check += 26 ** digit_count

offset = check - 26 ** digit_count

N -= offset + 1

while digit_count > 0:
    ans = "" + chr(ord("a") + N % 26) + ans
    N //= 26
    digit_count -= 1

print(ans)
# Judge status: Wrong Answer
n = int(input())

answer = False
for num_4 in range(n//4+1):
  if (n-num_4*4)%7 == 0:
    answer = True 
    break
  
print(answer)
# Judge status: Wrong Answer
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():
    a, b = map(int, readline().split())

    vec = [False] * 499501
    s = 0
    for i in range(1, 1000):
        s += i
        vec[s] = True

    for h in range(1, 499500):
        if vec[h + a] and vec[h + b]:
            print(h)
            break

    return


if __name__ == '__main__':
    main()
# Judge status: Accepted
import fractions
a, b, c = map(int, input().split())
if c % fractions.gcd(a, b) == 0:
  print('YES')
else:
  print('NO')
# Judge status: Accepted
# A
x = list(map(int, input().split()))
ans = 0
for i in range(5):
    if x[i] != i + 1:
        ans = i + 1
print(ans)
# Judge status: Wrong Answer
s=input()
a=''

for i in s:
  if i=='B':
    a=a[:-1]
    
  else:
    a+=i
print(a)
# Judge status: Accepted
N,R=map(int,input().split())
if N < 10:
    ans=R+(10-N)*100
else:
    ans=R
print(ans)
# Judge status: Accepted
import math
n=int(input())
l=[int(input()) for i in range(5)]
print(math.ceil(n/min(l))+4)
# Judge status: Accepted
from collections import defaultdict

n = int(input())
s = [input() for _ in range(n)]
m = int(input())
t = [input() for _ in range(m)]

ds = defaultdict(int)
dt = defaultdict(int)

for e in s:
    ds[e] += 1

for e in t:
    dt[e] += 1

ans = 0
for k, v in ds.items():
    money = v - dt[k]
    ans = max(ans, money)

print(ans)
# Judge status: Wrong Answer
X=int(input())
if X>=5:
	div500=X//500
	X=X-div500*500
	div5=X//5
	print(div500*1000+div5*5)
# Judge status: Accepted
N, X, T = map(int, input().split())
print(-(-N//X)*T)
# Judge status: Accepted
x = int(input())
import math
ans = 0
ans = (x // 11)*2
ans += math.ceil((x%11)/6)
print (ans)
# Judge status: Accepted
S, U = map(str, input().split())
s, u = map(int, input().split())
n = input()

if n == S:
    s -= 1
else:
    u -= 1

print(s, u)
# Judge status: Wrong Answer
S = input()

if S[0] == 0:
    head = "0"
    re_head = "1"
else:
    head = "1"
    re_head = "0"

cnt = 0
for i in range(1, len(S)):
    if i % 2 == 1:
        if S[i] != re_head:
            cnt += 1
    elif i % 2 == 0:
        if S[i] != head:
            cnt += 1
print(cnt)
# Judge status: Accepted
import math
A, B, N = map(int,input().split(' '))

def f(x):
    return math.floor(A*x/B)-A*math.floor(x/B)


def main():
    if N >= B:
        print(f(B-1))
    else:
        print(f(N))

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

print("Christmas",end="")
if d<25:
        print(" Eve",end="")
if d<24:
        print(" Eve",end="")
if d<23:
        print(" Eve",end="")
# Judge status: Accepted
def f(num,N,S):
    alphabet = ["a","b","c","d","e","f","g","h","i","j"]
    if N == num:
        for i in range(len(S)):
            print(S[i])
        return
    else:
        tmp = []
        length = len(S)
        for i in S:
            ttmp = sorted(list(i))
            for j in range(alphabet.index(ttmp[-1])+2):
                tmp.append(i+alphabet[j])
        f(num+1,N,tmp)
 
N = int(input())
f(1,N,["a"])
# Judge status: Wrong Answer
ip = raw_input().split()
k = int(ip[0])
x = int(ip[1])
if(500*k >= x): print('yes')
else: print('no')
# Judge status: Accepted
a,b = map(int, input().split())
if a*b % 2 == 1:
    print('Odd')
else:
    print('Even')
# Judge status: Accepted
import sys

readline = sys.stdin.readline
N = int(readline())
A = []
B = []
for _ in range(N):
    a, b = map(int, readline().split())
    A.append(a)
    B.append(b)
A.sort()
B.sort()
if N % 2 == 0:
    mi = A[N//2-1]+A[N//2]
    ma = B[N//2-1]+B[N//2]
else:
    mi = A[N//2]
    ma = B[N//2]
print(ma-mi+1)
# Judge status: Wrong Answer
n,q=map(int, input().split())
s=input()
lr = [list(map(int,input().split())) for _ in range(q)]

cum = [0]*(n+1)
pre = s[0]
cnt=0
for i in range(1,n):
    now = s[i]
    if pre=="A" and now=="C":
        cnt+=1
    cum[i+1] = cnt
for l,r in lr:
    print(cum[r]-cum[l])
# Judge status: Wrong Answer
x = int(input())
ans=0
for i in range(1, x+1):
    if i**2<=x:
        ans=i**2
print(ans)
# Judge status: Accepted
N = int(input())
d = {}
for i in range(N):
    s = input()
    if s in d.keys():
        d[s] += 1
    else:
        d[s] = 1
Max = max(d.values())
keys = [k for k, v in d.items() if v == Max]
keys.sort()
for k in keys:
    print(k)
# Judge status: Wrong Answer
from heapq import heappop,heappush,heapify
n,m=map(int,input().split())
work=[set() for _ in range(m+1)]
for _ in range(n):
    a,b=map(int,input().split())
    if a<=m: work[a].add(b)

ans=0
q=[]
for i in range(1,m+1):
    for x in work[i]:
        heappush(q,-x)
    if q!=[]: ans+=heappop(q)
print(-ans)
# Judge status: Accepted
import sys
def input(): return sys.stdin.readline().strip()
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))

x, y, a, b, c = MAP()
p = LIST()
q = LIST()
r = LIST()
p.sort(reverse=True)
q.sort(reverse=True)
r.sort(reverse=True)
pq = p[:x] + q[:y]
pq.sort()
pqsum = 0
rsum = 0
d = 0
for i in range(min(c, x + y)):
    pqsum += pq[i]
    rsum += r[i]
    if rsum - pqsum > d:
        d = rsum - pqsum
print(sum(pq) + d)
# Judge status: Accepted
N, M = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(N)]
cd = [list(map(int, input().split())) for _ in range(M)]

for a, b in ab:
    L = 10 ** 9
    p = 0
    i = 1
    for c, d in cd:
        l = abs(a - c) + abs(b - d)
        if l < L:
            L = l
            p = i
        i += 1
    print(p)
# Judge status: Accepted
n = int(input())
x = list(map(int, input().split()))
xx = sorted(x)
a = xx[n//2-1]
b = xx[n//2]
for i in x:
	if i <= a:
		print (b)
	else:
		print (a)
# Judge status: Accepted
import math
a,b,h,m=map(int,input().split())
angle=abs(m*6-(h*30+m/60*30))
print(math.sqrt(a*a+b*b-2*a*b*math.cos(angle/180*math.pi)))
# Judge status: Accepted
r, g, b = map(int, input().split())
if (r*100+g*10+b)%4==0:
    print("YES")
else:
    print("NO")
# Judge status: Wrong Answer
s = input()
res = 1
flg = 0
i = 1
while i < len(s):
  if s[i] == s[i-1]:
    i += 2
    res += 1
  else:
    res += 1
    i += 1
print(res)
# Judge status: Accepted
def solve():
    X = int(input())

    def get_time(target_x):
        x = 0

        for i in range(0, 10**9):
            x = x + i + 1
            if target_x <= x:
                return i + 1

    res = get_time(X)

    return res


if __name__ == '__main__':
    res = solve()
    print(res)
# Judge status: Accepted
input()
from collections import *
d=deque()
s=1
for i in map(int,input().split()):
  if s>0: d.append(i)
  else: d.appendleft(i)
  s*=-1
print(*list(d)[::s])