peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
import copy
N = int(input())
Listx = list(map(int,input().split()))

for i in range(N):
    Copy_Listx = copy.deepcopy(Listx)
    Copy_Listx.remove(Listx[i])
    print(Copy_Listx[N//2-1])
# Judge status: Accepted
N = int(input())
H = input().split(' ')
H = [int(H[i]) for i in range(N)]
max = 0
count = 0
for i in range(N-1):
  if H[i]>=H[i+1]:
    count += 1
    if max<count:
      max=count
  else:
    count = 0
print(max)
# Judge status: Accepted
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque

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

if __name__ == '__main__':
    a = [int(i) for i in input().split()]

    if a[0] <= a[1]:
        print(a[0])
    else:
        print(a[0]-1)
# Judge status: Accepted
print(len([0 for i in range(int(input())) if len(str(i+1))%2 == 1]))
# Judge status: Accepted
n=int(input())
l=list(map(int,input().split()))
ok=0
for i in range(n-2):
    for j in range(i,n-1):
        for k in range(j,n):
            p=l[i]
            q=l[j]
            r=l[k]
            if p!=q and q!=r and r!=p and p+q>r and r+q>p and p+r>q:
                ok+=1
print(ok)
# Judge status: Wrong Answer
print('ABC' if int(input()) < 999 else 'ABD')
# Judge status: Wrong Answer
l,r=map(int, input().split())
l%=2019
r%=2019
res = 100000000
for i in range(min(l,r),max(l,r)):
    for j in range(i+1, max(l,r)+1):
        res = min(res,(i*j)%2019)
print(res)
# Judge status: Accepted
n = int(input())
a = int((-0.5+(0.5**2+2*(n-1))**0.5)+1)
for i in range(a,0,-1):
  if n >= i:
    n-=i
    print(i)
# Judge status: Wrong Answer
p,q = input().split()
q_ = int(q) -1 
n = input()
print(n.replace(n[q_], n[q_].lower(), 1))
# Judge status: Accepted
import math
n=int(input())
a=[0]*5
for i in range(5):
  a[i]=math.ceil(n/int(input()))
print(max(a)+4)
# Judge status: Accepted
n=int(input())
l=list(map(int,input().split()))
l.sort()
a=0
b=0
c=0
ans=0
for i in range(n-2):
  a=l[i]
  for j in range(i+1,n-1):
    if l[j]!=a:
      b=l[j]
      for k in range(j+1,n):
        if l[k]!=b:
          c=l[k]
          if a+b>c:
            ans+=1
print(ans)
# Judge status: Wrong Answer
def gcd(a,b):
    if b == 0:
        return a
    else:
        return gcd(b,a%b)

def lcm(a,b):
    return a*b // gcd(a,b)

n = int(input())
a = list(map(int,input().split()))
l = [0]
r = [0]
for i in range(n):
    l.append(gcd(a[i],l[-1]))
    r.append(gcd(a[(n-1)-i],r[-1]))
r = r[::-1]
ans = r[0]
for i in range(n-1):
    ans = max(ans,gcd(l[i],r[i+1]))
print(ans)
# Judge status: Accepted
n, m = map(int, input().split())

ans = {1}
l = [1] * n

for i in range(m):
    x, y = map(int, input().split())
    l[x - 1] -= 1
    l[y - 1] += 1

    if x in ans:
        if l[x - 1] == 0: ans.remove(x); ans.add(y)
        else: ans.add(y)
print(len(ans))
# Judge status: Wrong Answer
K, S = list(map(int, input().split()))

res = 0

for x in range(K+1):
  for y in range(K+1):
    z = S - x - y
    if 0 > z and z <= K:
      res += 1

print(res)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
q = int(input())
ans = sum(a)

l = [0] * 100001

for i in a:
  l[i] += 1
  
for j in range(q):
  b, c = map(int,input().split())
  l[c] += l[b]
  ans += l[b] * (c-b)
  l[b] = 0
  print(ans)
# Judge status: Accepted
import sys

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

while A > 0 and C > 0:
    C -= B
    if C <= 0:
        print("Yes")
        sys.exit()
    A -= D

print("No")
# Judge status: Accepted
p=eval(input().replace(" ","+"));print(p-24if p>23else p)
# Judge status: Accepted
k,a,b = map(int,input().split())
if b <= a+1:
  print(1+k)  
else:
  if k <= a:
    print(1+k)
  else:   
    ans = (k-a+1)//2*(b-a) + (k-a+1)%2 + a
    print(ans)
# Judge status: Accepted
n,d = map(int,input().split())
ans = (n+2*d)//(2*d+1)
print(ans)
# Judge status: Accepted
a=int(input())
b=int(input())
c=int(input())
if c%max(a,b)==0:
  print(c//max(a,b))
else:
  print(c//max(a,b)+1)
# Judge status: Wrong Answer
a,b = map(int,input().split())
t = 0

for i in range(a,b+1):
    if i % 100 == i // 1000:
        t += 1
    if i % 100 * 10 == i // 1000:
        t += 1

print(t)
# Judge status: Wrong Answer
# AtCoder Beginner Contest 100
# B - Ringo's Favorite Numbers

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

L=[]

for i in range (1,105):
    n=i*100**D
    L.append(n)

print(L[N-1])
# Judge status: Accepted
x = int(input())

a = (x // 500)
b = (x - 500 * a) // 5

happy = a * 1000 + b * 5

print(happy)
# Judge status: Wrong Answer
input = open(0).readline
s = {}
s['A'] = list(input().strip())
s['B'] = list(input().strip())
s['C'] = list(input().strip())

def play(player):
    
    next_play = s[player].pop()
    if s[player] == []:
        print(player)
        return player
    #print(next_play)
    play(next_play.upper())
        
play('A')
# Judge status: Accepted
W, a, b = map(int,input().split())
if b > a+W:
    print(abs(b-(a+W)))
elif b <= a+W and b+W >= a:
    print(0)
else:
    print(abs(b+W-a))
# Judge status: Accepted
n,m = map(int, input().split())
arr = [0]+list(map(int,input().split()))
g = [[] for i in range(n+1)]
for i in range(m):
  a,b = map(int, input().split())
  g[a].append(b)
  g[b].append(a)
  
ans = 0

for v in range(1, n+1):
  for u in g[v]:
    if arr[u]>=arr[v]:
      break
  else:
    ans+=1
    
print(ans)
# Judge status: Accepted
n = int(input())
b = True
k = 0 #カウント用
i = 0
if n == 0:
    print(0)
elif n % 2 == 1:
    print(0)
else:
    while n // (10  * (5 ** i)) > 0:
        k += n // (10 * (5 ** i))
        i += 1
    print(k)
# Judge status: Accepted
from heapq import heappop, heappush, heapify

N, M = map(int,input().split())
A = list(map(int, input().split()))
A = list(map(lambda x: x*(-1), A))
heapify(A)

for i in range(M):
    temp = int(heappop(A)/2)
    heappush(A, temp)

print(-sum(A))
# Judge status: Accepted
s = input()

ans=0
slist= [int(i) for i in s]

for i in range(len(s)-1):
    if slist[i] == slist[i+1]:
        ans += 1
        if slist[i+1] == 1:
            slist[i+1] = 0
        else:
            slist[i+1] = 1

print(ans)
# Judge status: Accepted
def main():
    n = int(input())
    # t, a = map(int, input().split())
    # h = list(map(int, input().split()))
    # s = input()

    if n == 25:
        print("Christmas")
    elif n== 24:
        print("Christmas Eve")
    elif n==23:
        print("Christmas Eve Eve")
    elif n==22:
        print("Christmas Eve Eve Eve")


if __name__ == '__main__':
    main()
# Judge status: Accepted
N=int(input())
A=list(map(int,input().split()))
ans=['']*N
for i in range(N): ans[A[i]-1]=str(i+1)
print(' '.join(ans))
# Judge status: Wrong Answer
N,K = [int(x) for x in input().split()]
N = N-1
kosuu = 1
for i in range(1,1000):
    kosuu += N
    if kosuu >= K:
        print(i)
        break
# Judge status: Accepted
t = 0
for i in range(1, int(input()) + 1):
  if len(str(i)) % 2 == 1:
    t += 1
print(t)
# Judge status: Wrong Answer
N = int(input())
ans = []
l = [input().split() for i in range(N)]
for i in range(N):
  l[i] = list(map(int, l[i]))

back = -1
for i in range(N):
  tmp = l
  if back != -1:
    tmp[i][back] = 0
  ans.append(max(tmp[i]))
  back = l[i].index(max(tmp[i]))

print(sum(ans))
# Judge status: Wrong Answer
import fileinput
 
lines = list(fileinput.input())
 
for x in lines:
	print(x[-3:])
# Judge status: Wrong Answer
n = str(input())

if len(n) % 2 == 1:
  print('No')
else:
  a = n[0 : len(n)//2]
  b = n[len(n)//2 : len(n)]
  if a == b:
    print('Yes')
  else:
    print('No')
# Judge status: Accepted
s=input()
k=0
t=''
u=''
for i in s:
  t+=i
  if not t==u:
    k+=1
    t,u='',t
print(k)
# Judge status: Accepted
sixexp=[6**i for i in range(1,7)]
nineexp=[9**i for i in range(1,6)]
lis=[1]+sixexp+nineexp

n=int(input())

dp=[1000000 for i in range (n+1)]
dp[0]=0

for i in range(n):
    for j in lis:
        if i+j<=n:
            dp[i+j]=min(dp[i+j],dp[i]+1)

print(dp[n])
# Judge status: Accepted
H1, M1, H2, M2, K = map(int, input().split())
T1, T2 = (H1 * 60 + M1), (H2 * 60 + M2)
print("{}".format((T2 - K) - T1))
# Judge status: Accepted
A,B,C=map(int,input().split())
count=0
while B>0:
   if A>B:
      break
   B=B-A
   count+=1
   if count>=C:
      break
print(count)
# Judge status: Wrong Answer
n = input()
for i in range(2):
    if len(set(n[i:i+2])) == 1:
        print("Yes")
        break
else:
    print("No")
# Judge status: Accepted
N = int(input())
robots, count = [], 0
for x in range(N):
    X, L = map(int, input().split())
    robots.append((X+L, X-L))
robots.sort()
node = -10**12
for end, start in robots:
    if start >= node:
        node = end
        count += 1
print(count)
# Judge status: Accepted
a,b=map(int,input().split())
n=[1,3,5,7,8,10,12]
m=[4,6,9,11]
o=[2]
p=[n,m,o]
if (a in n and b in n) or (a in m and b in m) or (a in o and b in o):
  print('Yes')
else:
  print('No')
# Judge status: Accepted
n, h = map(int, input().split())
AB = [list(map(int, input().split())) for i in range(n)]
A,B = zip(*AB)
a = max(A)
B = [b for b in B if b > a]
B.sort(reverse=True)
ans = 0
hp = h
attack_cnt = 0
for b in B:
    if hp <= 0:
        break
    attack_cnt += 1
    hp -= b
if hp > 0:
    attack_cnt += (hp - 1) // a + 1
print(attack_cnt)
# Judge status: Accepted
N = int(input())
N1 = N + 1
N2 = N1 * N
S0 = N2 / 2
# print(int(S0))

Na = N//3
N1a = Na + 1
N2a = N1a * Na
S0a = 3 * N2a / 2
# print(int(S0a))

Nb = N//5
N1b = Nb + 1
N2b = N1b * Nb
S0b = 5 * N2b / 2
# print(int(S0b))

Nc = N//15
N1c = Nc + 1
N2c = N1c * Nc
S0c = 15 * N2c / 2
# print(int(S0c))

S = S0 - S0a - S0b + S0c

print(int(S))
# Judge status: Accepted


import numpy as np

a,b=input().split()
c=a+b
x=int(c)
if((int)(x**0.5)**2==x):
    print("Yes")
else:print("No")
# Judge status: Accepted
n=int(input())
x=list(map(int,input().split()))
sortx=sorted(x)
mida=sortx[n//2-1]
midb=sortx[n//2]
for i in range(n):
    if mida==midb:
        print(mida)
    elif mida>=x[i]:
        print(midb)
    else:
        print(mida)
# Judge status: Accepted
List=[int(input()) for i in range(5)]
num=[10,20,30,40,50,60,70,80,90,100,110,120,130]
time=0
table=[]
for i in range(5):
    subtract=0
    for j in range(len(num)):
        if List[i]<=num[j]: 
            subtract=num[j]
            break
    table.append([subtract-List[i],List[i]])
table.sort()
for i in range(5):
    time+=table[i][0]+table[i][1]
time-=table[4][0]
print(time)
# Judge status: Wrong Answer
# ABC066c
from collections import deque
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 6)


n = int(input())
a = list(map(int, input().split()))
b = deque()
for i in range(n):
    if i % 2 == 0:
        b.append(a[i])
        continue
    b.appendleft(a[i])
print(*b)
# Judge status: Accepted
import sys
input = sys.stdin.readline
N = int(input())
ekis = []
for _ in range(N - 1):
  c, s, f = map(int, input().split())
  ekis.append((c, s, f))

for ikimasuyo in range(N):
  t = 0
  for i in range(ikimasuyo, N - 1):
    c, s, f = ekis[i]
    if t < s:
      t = s + c
    elif t >= s:
      t = -((s - t) // f) * f + s + c
    #print(ikimasuyo, t)
  print(t)
# Judge status: Wrong Answer
X, Y = map(int, input().split())

if X % Y == 0:
    print(-1)
else:
    for i in range(10**18):
        X1 = int(X*i)
        if X1 % Y != 0:
            print(X1)
        break
# Judge status: Accepted
N = int(input()) 
A1 = list(map(int, input().split()))
A2 = list(map(int, input().split()))

dp = [[0] * N for i in range(2)]
dp[0][0] = A1[0]
dp[1][0] = A1[0] + A2[0]

for i in range(1, N):
  dp[0][i] = dp[0][i - 1] + A1[i]

for i in range(1, N):
  dp[1][i] = max(dp[1][i - 1], dp[0][i]) +  A2[i] 
  
#for i in range(2):
#  print(dp[i])

print(dp[-1][-1])
# Judge status: Wrong Answer
n,m = map(int,input().split())

if n-m == 0:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
import math
x, y = map(int, input().split())
print(int(math.log(y//x, 2))+1)
# Judge status: Wrong Answer
s = map(int, input().split())
if(max(s) == (sum(s)//2)):
  print("Yes")
else:
  print("No")
# Judge status: Accepted
A,B = map(int,input().split())
S = input()
ans = "Yes"
for i in range(len(S)):
  if i == A:
    if S[i] != "-":
      ans = "No"
  else:
    if S[i] == "-":
      ans = "No"
print(ans)
# Judge status: Accepted
N=int(input())
A = []

for i in range(N):
    new = int(input())
    A.append(new)

A.sort()
A.append(0)

start=A[0]
cnt=1
anscnt=0

for i in range(1,len(A)):

    if A[i]==start:
        cnt+=1
    elif A[i]!=start:
        if cnt%2==0:
            anscnt+=cnt
        elif cnt%2!=0:
            anscnt+=cnt-1    
        cnt=1
        start=A[i]


print(N-anscnt)
# Judge status: Accepted
n=int(input())
a=[int(v) for v in input().split()]
check=1
a.sort()
for i in range (0,n-1):
    if a[i]==a[i+1]:
        check=0
        break
if check==0:
    print("NO")
else:
    print("YES")
# Judge status: Accepted
N = int(input())
* P, = map(int, input().split())
minimun = N+1
count = 0
for p in P:
    if p < minimun:
        minimun = p
        count += 1
print(count)
# Judge status: Accepted
H,N = map(int, input().split())
A = list(map(int, input().split()))

sum_a = sum(A)
if H <= sum_a:
  ans = 'Yes'
else:
  ans = 'No'
  
print(ans)
# Judge status: Wrong Answer
N = int(input())

i = 1
while i < N:
  i = i*2

if i < N:
  print(i)
else:
  print(i / 2)
# Judge status: Accepted
n = int(input())
print(abs(1-n))
# Judge status: Accepted
def mi():
    return map(int, input().split())

def ii():
    return int(input())

def main():
    X, Y, Z = mi()
    k = X//(Y+Z)
    r = X%(Y+Z)
    if r < Z:
        print(k-1)
    else:
        print(k)


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
candi_num, can_exist_num = list(map(int, input().split()))
A = list(map(int, input().split()))

ans = 0
for i in range(1, candi_num):
  two_sum = A[i - 1] + A[i]
  ofs = max(0, two_sum - can_exist_num)
  A[i] -= ofs
  ans += ofs

print(ans)
# Judge status: Accepted
from sys import stdin

s = sum([int(x) for x in stdin.readline().rstrip().split()])

ans = "win"
if s > 21: ans = "bust"
print(ans)
# Judge status: Wrong Answer
n, m = map(int,input().split())
if n == m:
    print("Yes")
else:
    print("no")
# Judge status: Accepted
N = int(input())
S = input()

s = list(S)
for i in range(len(S)):
    if (ord(s[i]) - 64 + N) % 26 == 0:
        p = 90
    else:
        p = (ord(s[i]) - 64 + N) % 26 + 64

    s[i] = chr(p)

print("".join(s))
# Judge status: Accepted
S = input()
A = 0
B = 0
for i in range(len(S)):
  if S[i] == "0":
    A += 1
  else:
    B += 1
print(min(A,B)*2)
# Judge status: Accepted
import sys
input = sys.stdin.readline

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

transit = []
transit_ = []

for a,b in (map(int, input().split()) for _ in range(m)):
    if a == 1:
        transit.append(b)
    if b == n:
        transit_.append(a)

if set(transit)&set(transit_):
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")
# Judge status: Accepted
a, b = map(int, input().split())
point = [13,1,2,3,4,5,6,7,8,9,10,11,12]
alice = point[a-1]
bob = point[b-1]
if alice > bob:
    print('Alice')
elif alice < bob:
    print('Bob')
else:
    print('Draw')
# Judge status: Accepted
N=int(input())
X=list(map(int,input().split()))
M=max(X)
X.remove(M)
m=min([abs(2*x-M) for x in X])
if (M+m)//2 in X:
    m=(M+m)//2
else:
    m=(M-m)//2
print(M,m)
# Judge status: Accepted
N, K = map(int, input().split())
H = list(map(int, input().split()))
 
if N <= K:
	print(0)
else:
	H.sort()
 
	res = 0
	for i in range(N - K):
		res += H[i]
	print(res)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
S = 0
ans = 0
for k in range(N):
  S = S + A[k]

for i in range(N-1):
  S = S - A[i]
  ans = ans + S * A[i]

ans = ans % (10**9 + 7)
print(ans)
# Judge status: Accepted
myinput = input()
mylist = list(map(int, myinput.split(" ")))
H = mylist[0]
A = mylist[1]
x = 0
while H > 0:
  H -= A
  x += 1
print(x)
# Judge status: Accepted
n = list(input())

n = list(set(n))
if len(n)>1:
	print("Yes")
else:
	print("No")
# Judge status: Wrong Answer
d=int(input())
c=list(map(int,input().split()))
c_days=[0]*26

fir_ans=0
for i in range(d):
    s=list(map(int,input().split()))
    ss=sorted(s, reverse=True)
    for k in range(26):
        num=ss[k]
        n=s.index(num)
        if c_days[n]==0:

            fir_ans+=num
            continue 
    c_days[n]=i+1
    for l in range(26):
        los=c[l]*(i+1-c_days[l])
        fir_ans-=los
    print(fir_ans)
# Judge status: Wrong Answer
from sys import stdin,stdout


if __name__=="__main__":

    n=int(stdin.readline())
    n-=1
    b=[int(x) for x in stdin.readline().split()]

    s=b[0]

    for i in range(n-1):
        s+=min(b[i],b[i+1])
    s+=b[n-1]

    stdout.write(str(s)+"\0")
# Judge status: Wrong Answer
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


def main():
    N = int(input())
    S = list(input())
    result = []
    for i, s in enumerate(S):
        result.append(S[:i].count('I') - S[:i].count('D'))
    print(max(result))


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
T = input()
l = len(T)
before = 'D'
ans = ''

for i in range(l):
    if i == l - 1:
        if T[i] == '?':
            j = 'D'
        else:
            j = T[i]
        ans = ans + j
        continue
    if T[i] == '?':
        if before == 'P':
            j = 'D'
        else:
            j = 'P'
    else:
        j = T[i]
    ans = ans + j
    before = j
print(ans)
# Judge status: Accepted
N, M = map(int, input().split())
 
a = N * (N - 1)/2
b = M * (M - 1)/2
 
print(int(a + b))
# Judge status: Accepted
l=sorted(list(map(int,input().split())))
print("YES" if l[0]==l[1]==5 and l[2]==7 else "NO")
# Judge status: Accepted
from bisect import bisect_left,bisect_right
n=int(input())
INF=float('inf')
l=[INF]*n
a=[int(input()) for _ in range(n)]
for i in a[::-1]:
    l[bisect_right(l,i)]=i
print(bisect_left(l,INF))
# Judge status: Wrong Answer
N = int(input()) + 1

ans_list = [[0 for i in range(10)] for j in range(10)]
print(ans_list)

for i in range(N):
    s = str(i)
    ans_list[int(s[0])][int(s[-1])] += 1

ans = 0
for i in range(0,10):
    for j in range(0,10):
        ans += ans_list[i][j]*ans_list[j][i]

print(ans)
# Judge status: Wrong Answer
from collections import Counter
N = int(input())
s = list(str(dict(Counter(sorted(input())))) for i in range(N))

def comb(n,k):
    nCk = 1
    MOD = 10**9+7

    for i in range(n-k+1, n+1):
        nCk *= i
        nCk %= MOD

    for i in range(1,k+1):
        nCk *= pow(i,MOD-2,MOD)
        nCk %= MOD
    return nCk
  
ans = 0
for i in Counter(s).keys():
    ans += comb(Counter(s)[i], 2) 
print(ans)
# Judge status: Accepted
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
ans = 0
m = abs(A - T + H[0] * 0.006)
for i in range(N):
  d = T - H[i] * 0.006
  a = abs(A - d)
  if m >= a:
    m = a
    ans = i + 1
print(ans)
# Judge status: Accepted
#ABC051
sx,sy,tx,ty = list(map(int,input().split()))
x,y = [tx-sx,ty-sy]
s = "U"*y+"R"*x+"D"*y+"L"*x + "L"+"U"*(y+1)+"R"*(x+1)+"D"+"R"+"D"*(y+1)+"L"*(x+1)+"U"
print(s)
# Judge status: Accepted
n = int(input())

if n == 0:
    print(0)
    quit()
base = []
while n != 1:
    if n % -2 == 0:
        base.append('0')
        n //= -2
    else:
        base.append('1')
        n -= 1
        n //= -2
base.append('1')
base.reverse()
ans = ''.join(base)
print(ans)
# Judge status: Accepted
N = int(input())
XYs = [[],[]]
for _ in range(N):
  x,y = map(int, input().split())
  XYs[0].append(x-y)
  XYs[1].append(x+y)
  
print(max(max(XYs[0])-min(XYs[0]), max(XYs[1])-min(XYs[1])))
# Judge status: Accepted
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7

def main():
    N = int(readline())
    A = list(map(int, readline().split()))
    B = list(map(abs, A))
    minus = 0
    for i in range(N):
        if A[i]<0:
            minus += 1
    if minus%2==0:
        ans = sum(B)
    else:
        ans = sum(B) - min(B)*2
    print(ans)
if __name__ == '__main__':
    main()
# Judge status: Accepted
def read():
    N = int(input().strip())
    P = list(map(int, input().strip().split()))
    return N, P

def solve(N, P):
    min_value = P[0]
    count = 0
    for i in range(N):
        min_value = min(min_value, P[i])
        if P[i] == min_value:
            count += 1
    return count


if __name__ == '__main__':
    inputs = read()
    print("%s" % solve(*inputs))
# Judge status: Wrong Answer
def myAnswer(N:int,s:str,t:str) -> int:
   if(s == t): return N
   if(N == 1): return 2
   total = N * 2
   for start,end in zip(s[::-1],t):
      # print(start,end)
      if(start == end):
         total -= 1
   return total

def modelAnswer():
   return
def main():
   N = int(input())
   s = input()
   t = input()
   print(myAnswer(N,s,t))
if __name__ == '__main__':
   main()
# Judge status: Wrong Answer
if __name__ == '__main__':
    a = input()
    count = 0

    for i in range(25):
        s = chr(97+i)
        if s in a:
            count+=1
        else:
            print(s)
            break

    if count == 25:
        print("None")
# Judge status: Accepted
A, B = map(int, input().split())
S = input()
print("YNeos"[not(len(S)==A+B+1 and S[A]=="-" and all(s.isdigit() for i,s in enumerate(S) if i != A))::2])
# Judge status: Accepted
s = input()

if ("RRS" == s) or ("SRR" == s) :
    print(2)
elif ("RSS" == s) or ("SRS" == s) or ("SSR" == s) or ("RSR" == s):
    print(1)
elif ("SSS" == s):
    print(0)
elif ("RRR" == s):
    print(3)
# Judge status: Accepted
al=[chr(ord('a') + i) for i in range(26)]
s=input()
N=len(s)
K=int(input())

for i in range(N):
  if i<N-1:
    a=26-al.index(s[i])
    if K>=a and s[i]!="a":
      K -= a
      s=s[0:i]+al[(al.index(s[i])+a)%26]+s[i+1:]
  else:
    K %= 26
    p= (K+al.index(s[i]))% 26
    s=s[0:N-1]+al[p]
    K=0
    
print(s)
# Judge status: Accepted
n  = int(input())
ac = 0
wa = 0
tle = 0
re = 0
for i in range(n):
    tmp = input()
    if tmp == 'AC':
        ac +=1
    elif tmp == 'WA':
        wa  +=1
    elif tmp == 'TLE':
        tle +=1
    else:
        re +=1
print('AC x ' + str(ac))
print('WA x ' + str(wa))
print('TLE x ' + str(tle))
print('RE x ' + str(re))
# Judge status: Wrong Answer
a=int(input())
if a>=3200:
  print("red")
else:
  print("pink")
# Judge status: Wrong Answer
n,k = map(int,input().split())

mod = 10**9 + 7
# k個選ぶときからn-1個選ぶとき
ans = 0
for i in range(k, n+1):
  min = 1/2 * (i-1) * i
  max = 1/2 * (n-i+1+n) * (n-(n-i+1)+1)
  ans += (max - min + 1) % mod
print(int(ans + 1))
# Judge status: Accepted
N = int(input())
x = N//1.08
y = x+1

if N % 1.08 == 0:
    print(int(x))
else:
    if y * 1.08 >=  N+1 and x * 1.08 < N:
        print(':(')
    else:
        print(int(y))
# Judge status: Accepted
L, R, d = map(int, input().split())

ans = 0
for i in range(L, R+1):
  if i % d == 0:
    ans += 1
print(ans)
# Judge status: Wrong Answer
a,b,c = map(int,input().split())
ans = 3
if a == b:
    ans = 2
elif a == c:
    ans = 2
elif b == c:
    ans = 2
elif a == b == c:
    ans = 1

print(ans)
# Judge status: Accepted
N = int(input())
print((N//2+N%2)/N)
# Judge status: Wrong Answer
# -*- coding: utf-8 -*-

D,N = list(map(int, input().rstrip().split()))
#-----

if D==0:
    ans = 1 * N
else:
    ans = (100**D) * ( N + N//100 )

print(ans)
# Judge status: Accepted
X = list(map(int,input().split()))
print(X.index(0)+1)
# Judge status: Wrong Answer
n, m = map(int, input().split())
lr = [[int(i) for i in input().split()] for _ in range(m)]
mi, ma = 0, n
for l, r in lr:
    mi, ma = max(mi, l), min(ma, r)
print(ma - mi + 1)
# Judge status: Accepted
import math
a,b,c = map(int,input().split())
l = 4*a*b
r = (c-a-b)**2
if (a+b >= c):
    print("No")
else:
    if(l < r):
        print("Yes")
    else:
        print("No")
# Judge status: Accepted
import bisect
n=int(input())
L=sorted(list(map(int,input().split())))
c=0
for i in range(n-1,1,-1):
    for j in range(i-1,0,-1):
        a=j-bisect.bisect(L,L[i]-L[j])
        if a>0:
            c+=a
print(c)
# Judge status: Wrong Answer
A,B=map(int, input().split())
if A<=5:
    print(0)
elif A<=12:
    print(B/2)
else:
    print(B)
# Judge status: Accepted
s = input()
print(s.replace('2017', '2018'))