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

all_xor = alphas[0] ^ alphas[1]
for i in range(2, N):
    all_xor = all_xor ^ alphas[i]
    
ans_list = []
for i in range(N):
    num_i = all_xor ^ alphas[i]
    ans_list.append(str(num_i))
    
ans = " ".join(ans_list)
print(ans)
# Judge status: Wrong Answer
# input
N = int(input())
W = list(map(int, input().split()))

# check
W = sorted(W)
sub_abs = [
    abs(sum(W[i:]) - sum(W[:i]))
    for i in range(N)
]

print(min(sub_abs))
# Judge status: Wrong Answer
import collections
N=int(input())
S=list(input())
s=collections.Counter(S)
m=s["R"]*s["G"]*s["B"]
for i in range(N-2):
  for j in range(i+1,N-1):
    k=2*j-i
    if k>=N:
      break
    if s[i]!=s[j] and s[j]!=s[k] and s[i]!=s[k]:
      m-=1
print(m)
# Judge status: Wrong Answer
A,B,C = map(int,input().split())
ans = 0
if A == B == C:
  print(-1)
else:
  while A % 2 == 0 and B % 2 == 0 and C % 2 == 0:
    n_A = (B + C) / 2
    n_B = (A + C) / 2
    n_C = (A + B) / 2
    A = n_A
    B = n_B
    C = n_C
    ans += 1
  print(ans)
# Judge status: Accepted
X, K, D = map(int, input().split())

X = abs(X)

K_main = X // D
K_sub = K - K_main

if (K_sub < 0):
  print(abs(X - D * K))
else:
  answer = abs(X - D * K_main)
  if (K_sub % 2 == 0):
    print(answer)
  else:
    print(abs(answer -D))
# Judge status: Accepted
a = ('SUN,MON,TUE,WED,THU,FRI,SAT')
b = a.split(',')
n = input()
for i in range(7):
    if b[i] == n:
        ans = 7 - i  
        print(ans)
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))

ruiseki = [0]
for i in range(n):
    ruiseki.append(ruiseki[i] + a[i])

ans = 10 ** 9
for i in range(1, n):
    snuk = ruiseki[i] - ruiseki[0]
    arai = ruiseki[n] - ruiseki[i]
    ans = min(ans, abs(snuk - arai))

print(ans)
# Judge status: Accepted
# A - Kenken Race

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

should_change = int(C>D)
can_change = 0
space = 1
ans = 'Yes'

for i in range(A,max(C,D)):
    if S[i]=='.':
        space += 1
        if B<=i<=D and space==3:
            can_change = 1
    else:
        if space==0:
            ans = 'No'
            break
        space = 0

if can_change<should_change:
    ans = 'No'
print(ans)
# Judge status: Accepted
W = input()
ji={}

for i in W:
    if i not in ji:
        ji[i]=1
    else:
        ji[i]+=1

for j in ji.values():
    if j % 2 ==0:
        result="Yes"
    else:
        result="No"
        break
print(result)
# Judge status: Wrong Answer
n,a,b = map(int,input().split())

if (b-a)%2 == 0:
    print(int((b-a)/2))
else:
    print(min(a,n-b+1)+int((b-a)/2))
# Judge status: Wrong Answer
N, M, K = map(int, input().split())

for k in range(N+1):
    for l in range(M+1):
        if k * (N-l) + l * (M-k) == K:
            print("Yes")
            import sys
            sys.exit()

print("No")
# Judge status: Accepted
X = int(input())

ans = 0
money = 100
for i in range(1, 10**18):
    money = (money * 101) // 100
    if money >= X:
        ans = i
        break

print(ans)
# Judge status: Wrong Answer
N, K = map(int, input().split())
A = list(map(int, input().split()))

D = {}
for a in A:
    if a not in D:
        D[a] = 1
    else:
        D[a] += 1
D = sorted(D.items())
c = 0
i = 0
l = len(D)
while l > K:
    c += D[-1 -i][1]
    l -= D[-1 -i][1]
    i += 1
print(c)
# Judge status: Wrong Answer
n = int(input())
a  = [int(i)-1 for i in input().split()]
b = [int(i) for i in input().split()]
c = [int(i) for i in input().split()]
#ここまで入力
manzoku = 0
for i in range(n):
    if a[i] ==n-1:
        manzoku += b[a[i]]
    elif i == n-1:
        manzoku += b[a[i]]
    else:
        manzoku += (b[a[i]]+c[a[i]])
print(manzoku)
# Judge status: Wrong Answer
d,x=map(int,input().split())
print(x*100**d+(x==100))
# Judge status: Accepted
def pfact(m):
	pf = {}
	for i in range(2,int(m**0.5)+1):
		while m%i == 0:
			pf[i] = pf.get(i,0) + 1
			m //= i
	if m>1 : pf[m]=1
	return pf

n = int(input())
pl = pfact(n).values()
ans = 0
for i in pl:
	k = i
	for j in range(1,41):
		k -= j
		if k < 0:
			break
		ans += 1
print(ans)
# Judge status: Accepted
import fractions
N = int(input())
T = [None] * N
for i in range(N):
  T[i] = int(input())

ans = 1
for i in range(N):
  ans = (ans * T[i]) // fractions.gcd(ans,T[i])
print(ans)
# Judge status: Wrong Answer
import sys
input = sys.stdin.readline

s = input()
if s[-1] == "s":
    s += "es"
else:
    s += "s"
print(s)
# Judge status: Accepted
import sys
input = sys.stdin.readline

X = int(input().rstrip('\n'))
if X>=1800:
  print(1)
elif X>=1600:
  print(2)
elif X>= 1400:
  print(3)
elif X>=1200:
  print(4)
elif X>=1000:
  print(5)
elif X>=800:
  print(6)
elif X>=600:
  print(7)
else:
  print(8)
# Judge status: Accepted
a,b,c,x,y=map(int,input().split())

loop=max(x*2,y*2)+1
ans=10**9

for i in range(loop):
  ab=i//2
  if x-ab>=0 and y-ab>=0:
    ans=min(ans,a*(x-ab)+b*(y-ab)+c*i)
  if x>=ab and y<ab:
    ans=min(ans,a*(x-ab)+c*i)
  if x<ab and y>=ab:
    ans=min(ans,b*(y-ab)+c*i)
  if x<ab and y<ab:
    ans=min(ans,c*i)
print(ans)
# Judge status: Accepted
a,b=map(int, input().split())
if a<=b:
  print(a)
else:
  print(a-1)
# Judge status: Wrong Answer
def gcd(x,y):
    if(y == 0):
        return x
    else:
        return gcd(y, x%y)

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

for i in range(n):
    a[i] = a[i] // 2

val = a[0]
for i in range(1,n):
    val = (val*a[i]) // gcd(val, a[i])
result = m//val - m//(val*2)
print(result)
# Judge status: Wrong Answer

N = int(input())

data = list(map(int, sorted(input().split())))
median = int(N / 2)
#print(data)
print(data[median] - data[median - 1])
# Judge status: Accepted
n=int(input())
p=list(map(int, input().split()))

count=0
for i in range(1, n-1):
    if p[i-1] < p[i] < p[i+1] or p[i-1] > p[i] > p[i+1]:
        count+=1
print(count)
# Judge status: Accepted
a,b = input().split()

c = int(a)*int(b)%2

if c==1:
    print("Odd")
else:
    print("Even")
# Judge status: Wrong Answer
a,b,k=map(int,input().split())

if k<=a:
    print(a-k,b)
elif a<=k<b:
    print(0,b-(k-a))
else:
    print(0,0)
# Judge status: Wrong Answer
s=list(input())
c1 = 0
c2 = 0
for i in range(len(s)):
    if i%2 == "0":
        if s[i] == "0":
            c1 += 1
    else:
        if s[i] != "0":
            c1 += 1
    if i%2 != "0":
        if s[i] == "0":
            c2 += 1
    else:
        if s[i] != "0":
            c2 += 1
print(min(c1,c2))
# Judge status: Accepted
n, m, k = [int(w) for w in input().split()]

cond = False

for i in range(n + 1):
    for j in range(m + 1):
        b = i * (m - j) + j * (n - i)
        if b == k:
            cond = True
            break
    if cond:
        break

print("Yes" if cond else "No")
# Judge status: Accepted
n = int(input())
S = input()

idx = n//2
x = S[:idx]
y = S[idx:]
if x == y:
    print(1)
    exit()

cs = 0
for i in range(idx):
    x = S[:idx-i]
    y = S[idx-i:]
    cs = max(cs, len(set(x) & set(y)))

    x = S[:idx+i]
    y = S[idx+i:]
    cs = max(cs, len(set(x) & set(y)))

print(cs)
# Judge status: Wrong Answer
x, y = map(int, input().split())
al = []
a = x
al.append(a)
for i in range(int(x)):
  a *= 2
  if a >= y:
    break
  al.append(a)
print(len(al))
# Judge status: Wrong Answer
# -*- coding: utf-8 -*-
N = int(input())
g = N // 2
k = ( N + 1 ) // 1
if N % 2 == 0:
    print(g)
else:
    print(k)
# Judge status: Wrong Answer
a,b = map(int,input().split())
if a==b:
  print('yes')
else: print('no')
# Judge status: Accepted
x=int(input())
t=0
while x>=0:
  if x%7==0:
    t=1
  x-=4
if t==0:
  print('No')
else: print('Yes')
# Judge status: Accepted
l = [int(input()) for i in range(5)]
k = int(input())
if l[4] - l[0] > k:
    print(":(")
else:
    print("Yay!")
# Judge status: Wrong Answer
S = input().strip()
#-----

i=0
while i <= len(S)-5:

    if S[i:(i+7)] == "dreamer":
        i=i+7
    elif S[i:(i+6)] == "eraser":
        i=i+6
    elif S[i:(i+5)] == "dream" or S[i:(i+5)] == "erase":
        i=i+5
    else:
        print("NO")
        break
# Judge status: Accepted
N, M = map(int, input().split())

KA = list(map(int, input().split()))
like = set(KA[1:])
for i in range(1, N):
    KA = list(map(int, input().split()))
    A = KA[1:]
    like = like & set(A)

print(len(like))
# Judge status: Wrong Answer
# -*- coding: utf-8 -*-
 
import math
import itertools
import sys
import copy
 
# 入力
#A, B, C, D = map(int, input().split())
#L = list(map(int, input().split()))
#N = int(input())
A, B, K = map(int, input().split())

if B-A <= K*2 :
  for i in range(A, B+1) :
    print (str(i))
else :
  for i in range(A, A+K) :
    print (str(i))
  for i in range(B-K+1, B+1) :
    print (str(i))
# Judge status: Accepted
import math
a,b=map(int,input().split())
print(math.ceil(a/(b*2+1)))
# Judge status: Wrong Answer
n = int(input())
s = [input() for _ in range(n)]
for i in range(n):
  s[i] = ''.join(sorted(s[i]))
t = {}
for i in range(n):
  if s[i] in t:
    t[s[i]] += 1
  else:
    t[s[i]] = 1
print(t)
print(sum(t[k] * (t[k] -1) // 2 for k in t))
# Judge status: Wrong Answer
import sys

A = [[0] for _ in range(3)]
for i in range(3):
    A[i] = list(map(int, input().split()))
N = int(input())
B = []
for i in range(N):
    B.append(int(input()))

for i in range(3):
    if A[i] <= B or (A[0][i] in B and A[1][i] in B and A[2][i] in B):
        print('Yes')
        sys.exit()

if (A[0][0] in B and A[1][1] in B
        and A[2][2] in B) or (A[0][2] in B and A[1][1] in B and A[2][0] in B):
    print('Yes')
    sys.exit()

print('No')
# Judge status: Wrong Answer
N,A,B = map(int,input().split())
if B < A:
  print(0)
  exit()
num = B-A+1
mi = A*(N-1) + B
ma = B*(N-1) + A
ans = ma - mi + 1

print(ans)
# Judge status: Wrong Answer
N,K = map(int,input().split())
import fractions

if N==0:
    print(K)
elif K == 1:
    print(0)
elif N*2 == K or N == K*2:
    print(0)
else:
    print(fractions.gcd(N,K))
# Judge status: Accepted
def resolve():
    a, b, c, d = map(int, input().split())
    print(max(a * c, b * d, a * d, b * c))

resolve()
# Judge status: Accepted
import math

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


print(math.ceil( (n-k)/(k-1) )+1)
# Judge status: Wrong Answer
N=int(input())
A=int(input())

for x in range(A-1):
  if N%500<=A:
    print("Yes")
    break
else:
  print("No")
# Judge status: Wrong Answer
a=input()
if(a[3]==a[2] and a[4]==a[5]):
  print("YES")
else:
  print("NO")
# Judge status: Accepted
from sys import stdin
input = stdin.readline

N, K = map(int, input().split())
D = set(map(int, input().split()))

while True:
    tmp = set(str(N))
    b = True
    for x in tmp:
        if int(x) in D:
            b = False
            break 
    if b == True:
        break
    else:
        N += 1

print(N)
# Judge status: Accepted
N, M = map(int, input().split())
accepted = [0] * N
penalties = [0] * N
for _ in range(M):
    p, ac = input().split()
    p, ac = int(p) - 1, ac == "AC"
    accepted[p] |= ac
    penalties[p] += not accepted[p]
print(sum(accepted), sum(p for ac, p in zip(accepted, penalties) if ac))
# Judge status: Wrong Answer
O = input()
E = input()

for i in range(len(E)):
    print(O[i],end="")
    print(E[i],end="")

if O>E:
    print(O[-1])
# Judge status: Accepted
n,k = map(int,input().split())
p = list(map(int,input().split()))

p.sort()

ans = 0

for i in range(k):
	ans += p[i]

print(ans)
# Judge status: Accepted
import math
R = int(input())
print(R*2*math.pi)
# Judge status: Wrong Answer
#!/usr/bin/env python
"""AtCoder Beginner Contest 167: A - 
https://atcoder.jp/contests/abc167/tasks/abc167_a
"""

__author__ = 'bugttle <bugttle@gmail.com>'


def main():
    S = input()
    T = input()

    if S == T[0:-1]:
        print('YES')
    else:
        print('NO')


if __name__ == '__main__':
    main()
# Judge status: Accepted
a, b, c, d= map(int, input().split())
if (abs(b - a) <= d and abs(c - b) <= d) or abs(c - a) <= d:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
A, B = map(int,input().split())
if (A+B)%2 == 0:
  print( (A+B)//2 )
else:
  print("IMPOSSIBLE")
# Judge status: Wrong Answer
N = int(input())
ansewr = 0
if  N % 2 != 0 :
  answer = N//2 + 1
else:
  answer = N / 2

print(answer)
# Judge status: Accepted
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
from functools import reduce

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()))
inf = float('inf')
mod = 10**9 + 7

a, b, x = rm()
x /= a
if a*b / 2 >= x:
    a = 2*x / b
    print(90 - math.degrees(math.atan(a/b)))
else:
    x = a*b - x
    b = 2*x / a
    print(math.degrees(math.atan(b/a)))
# Judge status: Accepted
M=120
c=M*M
exec(c*2*f'i,j=c%M,c//M;c-=i**5-j**5!={input()}or exit(print(i,j));')
# Judge status: Accepted
a,b,c,d=map(int,input().split())
if abs(a-c)<=d or (abs(a-b)<=d and abs(c-b)<=d):print("Yes")
else:print("No")
# Judge status: Wrong Answer
ipt = str(input())
S = ipt.split()
gs = 1
ks = 0
rtu = "Yes"
while gs <= len(S) - 1:
    if S[ks] == "L":
        rtu = "No"
        break
    elif S[gs] == "R":
        rtu = "No"
        break
    gs += 1
    ks += 1
print(rtu)
# Judge status: Wrong Answer
n = int(input())
a = sorted(list(map(int, input().split())))[::-1]
ans = 0
min_a = a[0]

for i in range(len(a)-1):
    ans += min_a
    if min_a > a[i+1]:
        min_a = a[i+1]

print(ans)
# Judge status: Accepted

n = int(input())
x = 1

while x ** 2 <= n:
    x += 1
print((x-1) ** 2)
# Judge status: Accepted
'''
問題：
    今、日本は 9 月 9 日です。
    二桁の整数 N が与えられるので、十進法で N に 9 が含まれるか答えてください。
'''
'''
制約：
10 ≦ N ≦ 99
'''

# 標準入力から N を取得する
n = int(input())

result = ""
if n % 10 == 9: # 1の位が 9
    result = "Yes"
elif 90 <= n % 100 < 100:   # 10の位が 9
    result = "Yes"
else:
    result = "No"

print(result)
# Judge status: Accepted
a,b,red,green,cl = map(int,input().split())
r = sorted(list(map(int,input().split())))[::-1]
g = sorted(list(map(int,input().split())))[::-1]
c = sorted(list(map(int,input().split())))[::-1]
s = sorted(r[:a]+g[:b]+c)[::-1]
print(sum(s[:a+b]))
# Judge status: Accepted
n,a,b=map(int,input().split())
mod=10**9+7
A=1
for i in range(n,n-a,-1):
    A*=i
    A%=mod
y=1
for i in range(1,a+1):
    y*=i
    y%=mod
A*=pow(y,10**9+5,mod)
A%=mod
B=1
for i in range(n,n-b,-1):
    B*=i
    B%=mod
y=1
for i in range(1,b+1):
    y*=i
    y%=mod
B*=pow(y,10**9+5,mod)
B%=mod


print((pow(2,n,mod)-1-A-B)%mod)
# Judge status: Wrong Answer
n,q=map(int,input().split())
s=input()
cnt=[0]*(n+1)
for i in range(1,n+1):
  cnt[i]=s.count('AC',0,i)
for _ in range(q):
  l,r=map(int,input().split())
  print(cnt[r]-cnt[l-1])
# Judge status: Accepted
a,b,c=map(int,input().split())
ans=a*b//2
print(ans)
# Judge status: Accepted
n = int(input())
def ok(x):
    return x*(x+1)//2 >= n
for x in range(1,n+1):
    
    if ok(x):
        ans = []
        v = x*(x+1)//2 - n
        
        for i in range(1,x+1):
            if i == v:continue
            
            ans.append(i)
        break
            
        
        
        
    else:continue
print(*ans)
# Judge status: Accepted
k = int(input())
if k % 2 == 0:
    odd = k // 2
    even = k // 2
else:
    odd = k // 2
    even = k // 2 + 1

print(odd * even)
# Judge status: Wrong Answer
k, a, b = map(int,input().split())

if b - a <= 2:
    print(k+1)
else:
    if ((k-(a-1))//2) <= 2:
        print(((k-(a-1))//2)*(b)+((k-(a-1))//2)%2)
    else:
        print(((k-(a-1))//2)*(b-a)+((k-(a-1))//2)%2)
# Judge status: Accepted
N, x = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
n = 0

if x > sum(a):
    print(N-1)
    exit()

for i in a:
    if x >= i:
        x -= i
        n += 1
    else:
        break
print(n)
# Judge status: Accepted
n,k=map(int,input().split())
p=list(map(int,input().split()))
print(sum(sorted(p)[:k]))
# Judge status: Accepted
inf = float('inf')
n = int(input())
s = input()

right_e = s.count("E")
left_w = 0
cnt = inf

for e in s:
  if e == "W":
    cnt = min(cnt, right_e + left_w)
    left_w += 1
  else:
    right_e -= 1
    cnt = min(cnt, right_e + left_w)
print(cnt)
# Judge status: Accepted
s = input()
t = input()

l0 = len(s)
l = len(t)


def chk(n):
    x = s[n:n+l]
    flg = True
    for j in range(l):
        if x[j] != t[j] and x[j] != "?":
            flg = False
    return flg


res = []
for i in range(l0 - l + 1):
    if chk(i):
        res.append(i)

ans = []
if not res:
    print("UNRESTORABLE")
else:
    p = res[-1]
    y = s[:p] + t + s[p+l:]
    z = y.replace("?", "a")
    print(z)
# Judge status: Accepted
#C
#入力
N=int(input())
S=[input() for i in range(N)]

#処理
result={}
for i in S:
    if i in result:
        result[i]+=1
    else:
        result[i]=1

x=max(result.values())

Z=[]
for i in result.items():
    if i[1]==x:
        Z.append(i[0])
Z.sort()
for i in Z:
    print(i)
# Judge status: Wrong Answer
from queue import deque
n = int(input())
a = deque([int(input()) for _ in range(n)])
point = 0
while len(a) >= 2:
    point += 1
    li = []
    now = a.popleft()
    for i in range(1,len(a)+1):
        j = a.popleft()
        if j <= now:
            li += [j]
    a = deque(li[:])
if a:
    point += 1
print(point)
# Judge status: Accepted
a, b= map(int, input().split())
if (a==1)or(b==1):
    print('1') 
elif a*b%2==0:
    c=(a*b)//2
    print(c)
else:
    c=((a*b)//2)+1
    print(c)
# Judge status: Accepted
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
A, B, C = map(int, input().split())
# 文字列の入力
#s = input()
#print(s[0:K-1]+s[K-1].lower()+s[K:N])
if A*B*C == 5*5*7:
    print("YES")
else:
    print("NO")
# Judge status: Wrong Answer
#!/usr/bin/env python3
from math import ceil

EPS = 1e-8
n, k = map(int, input().split())
a = list(map(int, input().split()))


def f(p):
    c = 0
    for x in a:
        c += (x + p - 1) // p - 1
    return c


ok, ng = 0, max(a)
while abs(ok - ng) > 1:
    m = (ok + ng) / 2
    if f(m) > k:
        ok = m
    else:
        ng = m
print(ceil(ok) + 1)
# Judge status: Accepted
N,X,Y=map(int,input().split())

k=[0]*(N-1)
for i in range(N):
  for j in range(i+1,N):
    k[min(j-i,abs(j+1-Y)+1+abs(i+1-X))-1]+=1
    
for i in range(N-1):
  print(k[i])
# Judge status: Wrong Answer
MOD = 998244353
N = int(input())
D = list(map(int,input().split()))
lis = [0] * (max(D)+1)
for i in D:
    lis[i] += 1
if lis[0] == 0 or lis[0] > 1:
    print(0)
    exit()


ans = 1
for i in range(1,len(lis)):
    ans *= pow(lis[i-1],lis[i], MOD)
    ans %= MOD
print(ans)
# Judge status: Accepted
def f(n):
    res = []
    for p in range(2, int(n**0.5)):
        k = 0
        while(n % p == 0):
            n //= p
            k += 1
        if k:
            res.append((p, k))
    if n != 1:
        res.append((n,1))
    return res


n = int(input())
ans = 0
r = f(n)
for p,k in r:
    tmp = 0
    cur = 1
    while(k>=cur):
        tmp += 1
        k -= cur
        cur += 1
    ans += tmp
print(ans)
# Judge status: Wrong Answer
n = int(input())
a = [int(input()) for i in range(n)]

cnt = 0
ans = 0
for i in range(1,n):
  if a[i] <= a[i-1]:
    cnt += 1
  else:
    ans = max(ans, cnt)
    cnt = 0
ans = max(ans, cnt)
print (ans + 1)
# Judge status: Accepted
def resolve():
    N = int(input())
    S = [str(input()) for _ in range(N)]
    words = dict(zip(set(S), [0] * len(S)))
    for s in S:
        if s in words:
            words[s] += 1

    words = sorted(words.items(), key=lambda x: x[1], reverse=True)
    mx = words[0][1]
    words = sorted(words, key=lambda x: x[0])
    for word in words:
        if word[1] == mx:
            print(word[0])

    return


resolve()
# Judge status: Wrong Answer
N = int(input())
S = input()
max_w = S.count(".")
ans = float("inf")
b, w = 0, max_w
for s in S:
  if s == "#":
    b += 1
  else:
    w -= 1
  ans = min(ans, b+w)
print(ans)
# Judge status: Accepted
x,n=map(int,input().split())

import sys
if n==0:
    print(x)
    sys.exit()
p=list(map(int,input().split()))
if x not in p:
    print(x)
    sys.exit()
min=x
max=x

while True:
    min-=1
    max+=1
    if min not in p:
        ans=min
        break
    if max not in p:
        ans=max
        break
print(ans)
# Judge status: Accepted
S = input()
count = 0
mcount = 0
for i in range(len(S)):
	if(S[i] == 'S'):
		count = 0
	elif(S[i] == 'R'):
		count += 1
		if(count>mcount):
			mcount = count
print(mcount)
# Judge status: Accepted
S = input()

if S == "keyence":
    print("YES")
    exit()

for i in range(len(S)-1):
    for j in range(i+1, len(S)):
        if S[:i]+S[j:] == "keyence":
            print("YES")
            exit()

print("NO")
# Judge status: Accepted
import sys
lines = [s.rstrip("\n") for s in sys.stdin.readlines()]
k, x = [int(num) for num in lines.pop(0).split(" ")]
lis = [str(n) for n in range(x - k + 1, x + k)]
print(" ".join(lis))
# Judge status: Wrong Answer
from sys import stdin
input = stdin.readline

N = int(input())
ab = [list(map(int, input().split())) for _ in range(N)]

ab.sort()

ran = []

for a, b in ab:
    ran.append(b - a + 1)

ran.sort()

if N % 2 == 0:
    print(ran[N // 2] * 2 - 1)

else:
    print(ran[N // 2])
# Judge status: Accepted
A,B,M=map(int,input().split())
Rcost=list(map(int,input().split()))
Lcost=list(map(int,input().split()))
ans=min(Rcost)+min(Lcost)
for i in range(M):
    x,y,c=map(int,input().split())
    tmp=Rcost[x-1]+Lcost[y-1]-c
    ans=min(tmp,ans)
print(ans)
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))

from collections import defaultdict
d = defaultdict(int)

for num in a:
    d[num]+=1

ans=0
for k,v in d.items():
    ans+=min(v,abs(k-v))
print(ans)
# Judge status: Wrong Answer
n,m=map(int,input().split())

ark={}
for i in range(m):
    a,b=map(int,input().split())
    ark[a]=b
    ark[b]=a

for i in range(2,n):
    if ark[1]==i and ark[i]==n:
        print('POSSIBLE')
        exit()

print('IMPOSSIBLE')
# Judge status: Accepted
MM = input().split()
X = int(MM[0])
Y = int(MM[1])
Z = int(MM[2])
x = 0
while True:
  if x*(Y+Z)+Z >X:
    break
  else:
    x +=1
print(x-1)
# Judge status: Accepted
n,a,b = map(int, input().split())
total = 0
for i in range(1,n+1):
  array = list(map(int,str(i)))
  if a<= sum(array) and sum(array)<=b :
    total += i
print(total)
# Judge status: Wrong Answer
import numpy as np
import functools
import math
import collections
import scipy
import fractions
import itertools

def solve():
  n = int(input())
  a = list(map(int, input().split()))
  c = collections.Counter(a)
  s = 0
  for i in list(c.values()):
    s += i*(i-1)//2
  print(c)
  for i in a:
    print(s-(c[i]-1))
  return 0
 
if __name__ == "__main__":
  solve()
# Judge status: Accepted
D = int(input())
c = list(map(int, input().split()))
s = []
for i in range(D):
    s.append(list(map(int, input().split())))

last = [0] * 26
for d in range(D):
    max = 0
    argmax = -1
    for t in range(26):
        if max < s[d][t]:
            max = s[d][t]
            argmax = t
    print(argmax + 1)
# Judge status: Wrong Answer
N,P = map(int,input().split())
A = list(map(int,input().split()))
ZeroOne = [0,0]
for a in A:
    if(a % 2 == 0):
        ZeroOne[0] += 1
    else:
        ZeroOne[1] += 1

print(2 ** (ZeroOne[0]+ZeroOne[1] - 1))
# Judge status: Accepted
X=input()
def split(w):
    return [all for all in w]
before=split(X[0:int(len(X)/2)])
after=split(X[int(len(X)/2):])
c=0
ans=0
reverse=-1
if len(X)%2==1:
    after=after[1:]
for i in after:
    if after[c]!=before[reverse]:
        ans+=1
    c+=1
    reverse-=1
print(ans)
# Judge status: Accepted
s,c=map(int,input().split())
if 2*s<=c: print((s+c//2)//2)
else: print(c//2)
# Judge status: Accepted
N,M=map(int, input().split())
H = list(map(int, input().split()))
#AB=[list(map(int,list(input().split()))) for i in range(M)]

good = list(range(1,N+1))
good = [1]*N

for j in range(M):
  a,b=map(int, input().split())
  #print(a,b)
  if H[a-1]>H[b-1]:
    #good.remove(b)
    good[b-1] = 0
  elif H[a-1]<H[b-1]:
    #good.remove(a)
    good[a-1] = 0
  elif H[a-1]==H[b-1]:
    good[a-1] = 0
    good[b-1] = 0
  #print(good)
  
print(sum(good))