peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
n=int(input())
A=list(map(int,input().split()))
zo=0 ; mi=0 ;ans=1
for i in range(n-1):
    #print(zo,mi,i)
    if zo==mi==0:
        if A[i]==A[i+1]:
            continue
        elif A[i]>A[i+1]:
            mi=1; continue
        else:
            zo=1;continue
    if zo:
        if A[i+1]<A[i]:
            zo=0; ans+=1
    if mi and A[i]<A[i+1]:
        mi=0 ; ans+=1
print(ans)
# Judge status: Accepted
import sys
import itertools
# import numpy as np
import time
import math
import heapq
from collections import defaultdict
sys.setrecursionlimit(10 ** 7)
 
INF = 10 ** 18
MOD = 10 ** 9 + 7
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

# map(int, input().split())

N, K = map(int, input().split())
X = list(map(int, input().split()))

left = 0
right = K - 1

ans = INF
while right < len(X):
    val1 = abs(X[left]) + abs(X[right] - X[left])
    val2 = abs(X[right]) + abs(X[right] - X[left])
    ans = min(ans, val1, val2)
    left += 1
    right += 1
print(ans)
# Judge status: Wrong Answer
from fractions import gcd

N = int(input())
lisA = list(map(int,input().split()))

lisA.sort()

ans = gcd(lisA[0],lisA[1])

print(ans)
# Judge status: Wrong Answer
N, A, B = map(int, input().split())
someSums = 0
for i in range(1, N+1):
    if A <= (i // 1000) % 10 + (i // 100) % 10 + (i // 10) % 10 + (i % 10) <= B:
        someSums += i
print(someSums)
# Judge status: Accepted
X, Y = list(map(int, input().split()))
ans = 0
while X <= Y:
    ans += 1
    X = X * 2
print(ans)
# Judge status: Wrong Answer
import numpy as np

n,m,x=map(int,input().split())
li=[list(map(int,input().split())) for i in range(n)]
li=np.array(li)
y=np.sum(li, axis=0)
if(np.min(y[1:])<x):
    print(-1)

for i in range(n):
    for j in range(n):
        pass
# Judge status: Wrong Answer
N = int(input())

ans = []
N = -N
while N != 0:
    ans.append(N%2)
    N //= -2

ans.reverse()
print(*ans, sep="")
# Judge status: Accepted
#!/usr/bin/env python3
import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf') ;mod = 10**9+7
mans = inf ;ans = 0 ;count = 0 ;pro = 1

h=int(input())
w=int(input())
n=int(input())
k=max(h,w)
print(math.ceil(n/k))
# Judge status: Accepted
#import itertools
#import fractions
#import numpy as np
#mod = 10**4 + 7
"""def kiri(n,m):
  r_ = n / m
  if (r_ - (n // m)) > 0:
    return (n//m) + 1
  else:
    return (n//m)"""

# Written by NoKnowledgeGG @YlePhan

#import math
#mod = 10**9+7

def main():
  a,b,x = map(int,input().split())
  print(b//x - (a-1)//x)
if __name__ == '__main__':
  main()
# Judge status: Wrong Answer
import math

S = int(input())
if S < 3:
    print(0)
    exit()


def check(s, i):
    re = (i ** s) % (10 ** 9 + 7)
    return re


n = S // 3

ans = 0
for i in range(n):
    S_i = S - (3 * (i + 1))
    ans += check(S_i, i)
print(ans % (10 ** 9 + 7))
# Judge status: Accepted
n=int(input())
abc_li=[0]*26
S=input()
for i in range(len(S)):
    abc_li[ord(S[i])-97]+=1

for i in range(n-1):
    S=input()
    tmp_abc_li=[0]*26
    for j in range(len(S)):
        tmp_abc_li[ord(S[j])-97]+=1
    for k in range(26):
        abc_li[k]=min(abc_li[k],tmp_abc_li[k])

ans=''
for i in range(26):
    if abc_li[i]>0:
        ans=ans+(chr(i+97)*abc_li[i])
print(ans)
# Judge status: Accepted
X = int(input())
ans = 1
while(True):
    if (X*ans) %360 == 0:
        break
    else:
        ans += 1
print(ans)
# Judge status: Accepted
n = int(input())
A = list(map(int, input().split()))

import fractions
#import math
from functools import reduce

def gcd(*numbers):
    return reduce(fractions.gcd, numbers)
    #return reduce(math.gcd, numbers)

def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)
    #return reduce(math.gcd, numbers)

g = gcd_list(A)
print(g)
# Judge status: Accepted
t=int(input())
if t>=30:
  print("Yes")
else: print("No")
# Judge status: Wrong Answer
N, x = [int(z) for z in input().split()]
children = [int(z) for z in input().split()]

children.sort()
sum = 0

for i in range(N):
    sum += children[i]
    if sum >= x:
        print(i + 1)
        break
    elif i == N - 1:
        print(N - 1)
# Judge status: Wrong Answer
N=int(input())
H=list(map(int, input().split()))
no = False
for i in range(N-1):
#  print(H[i],H[i+1])
  if H[i]>H[i+1]+1:
    no = True
    break
  elif H[i]==H[i+1]+1:
    H[i] -= 1
#print(H)
if H != H.sort():
  no = True
print(['Yes','No'][no])
# Judge status: Accepted
from math import sqrt
n,d = map(int,input().strip().split())
cnt = 0
for i in range(n):
	x,y = map(int,input().strip().split())
	# print(x,y)
	if x*x+y*y <= d*d:
		# print(x,y)
		cnt+=1
print(cnt)
# Judge status: Accepted
n,m,k = map(int,input().split())
for i in range(0,n+1):
    for j in range(0,m+1):
        if n*j+m*i-2*i*j == k:
            print("Yes")
            exit(0)
print("No")
# Judge status: Wrong Answer
s = input()
blk = len(s) 
while len(s) > 2:
    s = s.replace("01","")
    s = s.replace("10","")
print(blk - len(s))
# Judge status: Wrong Answer
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
# print(N, A, B)
d1 = 0
d2 = 0
for i in range(N):
    a = A[i]
    b = B[i]
    if a > b:
        d1 += a - b
    elif a < b:
        d2 += b - a
# print(d1, d2)
if d1 * 2 > d2:
    print('No')
else:
    print('Yes')
# Judge status: Wrong Answer
n = int(input())
d = map(int, input().split())
dist = [0] * n
mod = 998244353
dp = [0] * n
if next(d) == 0:
    dp[0] = 1
    dist[0] += 1
for i in d:
    dist[i] += 1

for i in range(n-1):
    dp[i+1] = (dp[i] * pow(dist[i], dist[i + 1], mod)) % mod
print(max(dp))
# Judge status: Accepted
N,K=map(int,input().split())
P=[0]+list(map(int,input().split()))

S=[0]*(N+1)
for i in range(1,N+1):
    S[i]=S[i-1]+P[i]

M=-1
for j in range(N-K+1):
    M=max(M,S[j+K]-S[j])
print((M+K)/2)
# Judge status: Accepted
N, P = map(int, input().split())
A = list(map(int, input().split()))

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

for i in range(N):
    rem = A[i] % 2
    if rem == 0:
        dp[i+1][0] = dp[i][0] * 2
        dp[i+1][1] = dp[i][1] * 2
    else:
        dp[i+1][0] = dp[i][0] + dp[i][1]
        dp[i+1][1] = dp[i][1] + dp[i][0]

print(dp[N][P])
# Judge status: Wrong Answer
n = int(input())
print(n*3.14)
# Judge status: Accepted
n,d=map(int,input().split())
hitori=2*d+1
if n%hitori==0:
  print(n//hitori)
else:
  print(n//hitori+1)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))

even = sum([1 for i in a if i % 2 == 0])
odd = sum([1 for i in a if i % 2 != 0])
multiple4 = sum([1 for i in a if i % 4 == 0])

flag = False
if even - multiple4 == 0:
    if multiple4 >= odd - 1:
        flag = True
else:
    if multiple4 >= odd:
        flag = True

print('Yes') if flag else print('No')
# Judge status: Wrong Answer
import math
X = 1
t = 360 - (180 - X)
g = math.gcd(t, 360)
print(360 * t // g // t)
# Judge status: Wrong Answer
N_ID, M_gate = map(int, input().split())
mini = float('inf')
MAX = 0

for i in range(M_gate):
    L, R = map(int, input().split())
    MAX = max(MAX, L)
    mini = min(mini, R)

answer = mini - MAX + 1
print(answer)
# Judge status: Accepted
N = int(input())

words = []
words.append(input())
for i in range(N-1):
    word = input()
    if word in words:
        print('No')
        break
    else:
        if word[0] != words[-1][-1]:
            print('No')
            break
        else:
            words.append(word)

if len(words) == N:
    print('Yes')
# Judge status: Accepted
N,K = map(int,input().split())
D = set(input().split())

while len(set(str(N))&D)>0:
  N+=1

print(N)
# Judge status: Wrong Answer
#input
a, b= map(int, input().split())

if a > b:
  B = ""
  for i in range(a):
    B += str(b)
  print(B)  
elif a < b:
  A = ""
  for i in range(b):
    A += str(a)
  print(A)
else:
  C = ""
  for i in range(a):
    C += str(a)
  print(C)
# Judge status: Accepted
x = str(input())
cnt = 0
tmp = 0
for i in x:
    if i == 'T':
        if tmp > 0:
            tmp -= 1
        else:
            cnt += 1
    else:
        tmp += 1
else:
    print(cnt + tmp)
# Judge status: Accepted
x = input()
if "7" in x:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
N = int(input())
ans = 0
for i in range(1, N+1):
    for j in range(i, N+1, i):
        ans += j
print(ans)
# Judge status: Accepted
D, N = map(int, input().split())
if D > 0:
  if N < 100:
    print( N * 100**D )
  else:
    print( 101 * 100**D )
if D == 0:
  if N < 100:
    print(N)
  else:
    print(101)
# Judge status: Accepted
from collections import defaultdict

N = int(input())
arr = list(map(int, input().split()))
a_set = sorted(set(arr), reverse=True)
a_dict = defaultdict(int)
for num in arr:
    a_dict[num] += 1
a, b = 0, 0
for num in a_set:
    if a_dict[num] > 3 and a == 0:
        a, b = num, num
        break
    elif a_dict[num] > 1 and a == 0:
        a = num
    elif a_dict[num] > 1:
        b = num
        break

print(a * b)
# Judge status: Accepted
def dig_sum(N):
    ans=0
    while N>0:
        ans+=N%10
        N=N//10
    return ans

N=int(input())
ans=100
for i in range(1,N):
    tmp=dig_sum(i)+dig_sum(N-i)
    if tmp<ans:
        ans=tmp
print(ans)
# Judge status: Accepted
S = input()

HI = "hi"

if S == "hi" or S == "hihi" or S == "hihihi" or S == "hihihihi" or S == "hihihihihi":
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
a=[int(i) for i in input().split()]
a.sort()
print(a)
ans=0
while a[1]!=a[2]:
    a[1]+=1
    a[0]+=1
    ans+=1
if a[1]%2==a[0]%2:
    ans+=(a[1]-a[0])//2
else:
    ans+=(a[1]-a[0])+1
print(ans)
# Judge status: Accepted
N,M,X = map(int, input().split())
A = [list(map(int, input().split())) for _ in range(N)]

ans = float('inf')
for i in range(1<<N):
  tmp = [0]*(M+1)
  for j in range(N):
    if i&(1<<j)==0: continue
    for k,l in enumerate(A[j]):
      tmp[k] += l
  if all(e>=X for e in tmp[1:]):
    ans = min(ans, tmp[0])
if ans==float('inf'):
  ans = -1
print(ans)
# Judge status: Wrong Answer
A,B = map(int,input().split())
print((A+B)/2) if (A+B) % 2 == 0 else print('IMPOSSIBLE')
# Judge status: Wrong Answer
n, k, q = map(int, input().split())
answers = []
for _ in range(q):
    answers.append(int(input()))

cnt_list = [(k-q)]*n
if q < k:
    for _ in range(n):
        print('Yes')
else:
    for i in answers:
        cnt_list[i-1] += 1

for i in cnt_list:
    print('Yes') if i > 0 else print('No')
# Judge status: Wrong Answer
from collections import Counter
n = int(input())
c = Counter(input())
ans = 1
for k,v in c.items():
  ans *= (v+1)
  
print(ans-1)
# Judge status: Wrong Answer
N, T=map(int, input().split())

aux, j, k=[0, 0], 0, 0
for i in range(N):
	c, t = map(int, input().split())
	
	if(T==t):
		aux[0],aux[1]=c, t
		k+=1
	elif(k==0):
		if (j == 0 and t<=T):
			aux[0],aux[1]=c, t
			j+=1
		elif(aux[1]>t):
			aux[0],aux[1]=c, t

if (aux[1]==0):
	print("TLE")
else: 
	print(aux[0])
# Judge status: Accepted
def yaku(n):
    A = []
    for i in range(1,int(n**0.5)+1):
        if n%i==0:
            A.append(i)
            A.append(n//i)
    return len(A)
N = int(input())
cnt = 0
for i in range(1,N+1,2):
    if yaku(i)==8:
        cnt += 1
print(cnt)
# Judge status: Accepted
n = input()
k = int(input())
ans = 1

for i in range(k):
  
  if n[i] != "1":
    ans = n[i]
    break

print(ans)
# Judge status: Accepted
n=int(input())
ab = []
for _ in range(n):
    a=int(input())
    ab.append(a)

ans = 0

for i in range(n):
    ans += ab[i]//2
    if i == n-1:
        break
    elif ab[i]%2 == 1 and ab[i+1] > 0:
        ans += 1
        ab[i+1] -= 1
print(ans)
# Judge status: Wrong Answer
#! python3
# coding:utf-8

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

cnt=0

for i in range(len(numlist)):
    if (i%2==1) and (numlist[i]%2==1):
        cnt+=1  

print(cnt)
# Judge status: Accepted
x, y, a, b, c = map(int, input().split())
p = list(map(int, input().split()))
q = list(map(int, input().split()))
r = list(map(int, input().split()))

p.sort(reverse=True)
q.sort(reverse=True)
r.sort(reverse=True)

eat = p[:x] + q[:y] + r
eat.sort(reverse=True)
ans = eat[:x+y]

print(sum(ans))
# Judge status: Wrong Answer
s= str(input())
t= str(input())

if len(t) == len(s) + 1 and len(s) >=1 and len(s) <= 10 and s.islower() and t.islower():
  for i in range(len(s)):
    if s[i]!=t[i]:
      print("No")
      break
  print("Yes")
else:
  print("No")
# Judge status: Accepted
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

a, b = map(int, readline().split())

print(a if a <= b else a-1)
# Judge status: Accepted
s = input()

cnt = 0
if 'RRR' in s:
    print(3)
elif 'RR' in s:
    print(2)
elif 'R' in s:
    print(1)
else:
    print(0)
# Judge status: Wrong Answer
N, M = map(int, input().split())

AC = [False for _ in range(N)]

n_AC = 0
n_WA = 0

for _ in range(M):
    p, S = input().split()
    p = int(p) - 1
    if not AC[p]:
        if S == "AC":
            AC[p] = True
            n_AC += 1
        elif S == "WA":
            n_WA += 1
        else:
            raise ValueError

print(n_AC, n_WA)
# Judge status: Wrong Answer
x,y,z= map(int,input().split())
print(x*y/2)
# Judge status: Accepted
N=input()
if '7' in N:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
S = input()
check = now = ''
ans = 0
for s in S:
    now += s
    if check != now:
        ans += 1
        now, check = '', now
print(ans)
# Judge status: Wrong Answer
# 今日の天気を入力
today_weather = input()

# 今日の天気から明日の天気をSunny,Cloudy,Rainyの周期で予測して出力
if today_weather == "Sunny":
    print("Cloudy")
elif today_weather == "Cloudy":
    print("Rainy")
else:
    print("Rainy")
# Judge status: Accepted
n = int(input())
nums = set(input().split())

if n == len(nums):
  print("YES")
else:
  print("NO")
# Judge status: Wrong Answer
a,b,c,d = map(int,input().split())

import math

if math.ceil(c/b)>=math.ceil(a/d):
    print('Yes')
else:
    print('None')
# Judge status: Accepted
#!/usr/bin/env python3
import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf') ;mod = 10**9+7
mans = inf ;ans = 0 ;count = 0 ;pro = 1

a = int(input())
b = int(input())
print(6-a-b)
# Judge status: Accepted

# D Road to Millionaire
N = int(input())
A = list(map(int, input().split()))
i = 0
M =1000
while i in range(N - 1):
    if A[i] >= A[i+1]:
        i = i + 1   
    else:
        m = (A[i+1] - A[i]) * (M // A[i])
        M = M + int(m)
        i = i + 1
print(M)
# Judge status: Accepted
t = list(input())

for i in range(len(t)):
    if t[i] == "?":
        t[i] = "D"

t = "".join(t)

print(t)
# Judge status: Wrong Answer
N = int(input())
D = sorted([int(i) for i in input().split()])
D = [D[i]*2**max(0,i-1) for i in range(N)]
print(D)
print(sum(D)/2**(N-1))
# Judge status: Wrong Answer
n,m = map(int,input().split())
s = []
c = []
ans = [0]*n
for _ in range(m):
  st,ct = map(int,input().split())
  s.append(st)
  c.append(ct)

f = 1
for i in range(m):
  if s[i] == 1 and c[i] == 0:
    f = 0
    break
  if ans[s[i]-1] != 0 and ans[s[i]-1] != c[i]:
    f = 0
    break
  ans[s[i]-1] = c[i]
if f == 0:
  print(-1)
else:
  print(''.join(map(str,ans)))
# Judge status: Wrong Answer
sx, sy, tx, ty = map(int, input().split())
ans = []
for _ in range(tx-sx):
    ans.append("R")
for _ in range(ty-sy):
    ans.append("D")
for _ in range(tx-sx):
    ans.append("L")
for _ in range(ty-sy):
    ans.append("U")
ans.append("U")
for _ in range(tx-sx+1):
    ans.append("R")
for _ in range(ty-sy+1):
    ans.append("D")
ans.append("L")
ans.append("D")
for _ in range(tx-sx+1):
    ans.append("L")
for _ in range(ty-sy+1):
    ans.append("U")
ans.append("R")
print("".join(ans))
# Judge status: Accepted
n = int(input())
ls = list(map(int, input().split()))

for i in range(n):
    if ls[i] % 2 == 1:
        if i == n - 1:
            print("APPROVED")
    elif ls[i] % 2 == 0:
        if ls[i] % 3 == 0 or ls[i] % 5 == 0:
            if i == n - 1:
                print("APPROVED")
        else:
            print("DENIED")
            break
# Judge status: Accepted
s=input();print(min(abs(int(s[i:i+3])-753)for i in range(len(s)-2)))
# Judge status: Accepted
# B - Box and Ball
si = lambda: input()
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))
n,m=nm()
rb=[False]*n
rb[0]=True
ball=[1]*n
for i in range(m):
    x,y=nm()
    x-=1
    y-=1
    ball[x]-=1
    ball[y]+=1
    if rb[x]==True:
        rb[y]=True
    if ball[x]==0:
        rb[x]=False
ans=0
for r in rb:
    if r:
        ans+=1
print(ans)
# Judge status: Accepted
x=input()
x_list=x.split()
N=int(x_list[0])
K=int(x_list[1])

Z=set()

for i in range(K):
  s=int(input())
  c=input()
  c_list=c.split()
  for r in c_list:
    Z.add(r)
  
print(N-len(Z))
# Judge status: Accepted
n = int(input())
x = list(input())
sta = 0
left = 0
for i in range(n):
    if x[i] == '(':
        sta += 1
    else:
        if sta == 0:
            left += 1
        else:
            sta -= 1
s = []
for i in range(left):
    s.append('(')
for i in range(n):
    s.append(x[i])
for i in range(sta):
    s.append(')')
print(''.join(s))
# Judge status: Accepted
import sys
input = sys.stdin.readline
n = int(input())
a = list(map(int, input().split()))
a1 = []
a2 = []
for i in range(n):
    if i % 2 == 0:
        a1.append(a[i])
    else:
        a2.append(a[i])
if n % 2 == 0:
    a2.reverse()
    print(*a2+a1)
else:
    a1.reverse()
    print(*a1+a2)
# Judge status: Accepted
n,m=map(int, input().split())
if n>=m:
    for i in range(n):
        print(m, end="")
else:
    for i in range(m):
        print(n, end="")
# Judge status: Accepted
import numpy as np
n,m = map(int, input().split())
X = sorted(np.array(input().split(), dtype = np.int64))
X = sorted(np.diff(X))
if m-n >= 0:
    ans = sum(X[:m-n])
else:
    ans = 0
print(ans)
# Judge status: Accepted
x, y = map(int, input().split())
res = 99999999999999
# そのまま
c = y - x
if c >= 0:
    res = min(res, c)

# 最初に1かい押す
c = y - (-x)
if c >= 0:
    res = min(res, c + 1)

# 最後に1かい押す
c = (-y) - (x)
if c >= 0:
    res = min(res, c + 1)

# 2回押す
c = (-y) - (-x)
if c >= 0:
    res = min(res, c + 2)

print(res)
# Judge status: Wrong Answer
import itertools
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

def time(n):
  t = 0
  if n % 10 == 0:
    t = 0
  else:
    t = 10 - n % 10
  return t

dic = {a: time(a), b:time(b), c:time(c), d:time(d), e:time(e)}
dic = sorted(dic.items(), key=lambda x:x[1])
dic = list(itertools.chain.from_iterable(dic))
print(sum(dic[:-1]))
# Judge status: Accepted
k, a, b = (int(x) for x in input().split())
if b - a <= 1 or k <= a: print(1+k)
else:
    k -= a - 1
    div_2 = k // 2
    m = k % 2
    print((b - a) * div_2 + m + a)
# Judge status: Wrong Answer
S = input()
print(S)
print("x"*len(S))
# Judge status: Accepted
N = int(input())

def solve(N):
    if 6 >= N:
        return 1
    
    ans = 0
    a = (N // 11) * 2
    b = N % 11

    if b == 0:
        ans = a
    elif 0 < b <= 6:
        ans = a + 1
    else:
        ans = a + 2
    return ans

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

if A >= 3 or B >= 3 or A + B >= 3 :
    print('Possible')
else:
    print('Impossible')
# Judge status: Accepted
a,b = map(int, input().split())
if abs(a-b) > a:
    print(a)
else:
    if a%b == 0:
        print(0)
    else:
        print(abs(a%b-b))
# Judge status: Wrong Answer
def main():
    s = input().strip()
    if s[2] == s[3] and s[4] == s[5]:
        print('True')
    else:
        print('False')


if __name__ == '__main__':
    main()
# Judge status: Accepted
n=int(input())
x=list(map(int,input().split()))
s=sorted(x)
b1=s[n//2-1]
b2=s[n//2]
for v in x:
    print(b2 if v<b2 else b1)
# Judge status: Wrong Answer
N,M = map(int,input().split())
P = [input().split() for m in range(M)]
S = []
a = 0

for p,s in P:
  if p not in S:
    if s=="AC":
      S.append(p)
    else:
      a+=1

print(len(S),a)
# Judge status: Accepted
N = int(input())
a = list(map(int, input().split()))

right = sum(a)
left = 0
ans = float("inf")

for i in a:
    left += i
    right -= i
    # print(right-left)
    ans = min(ans, abs(right-left))
print(ans)
# Judge status: Accepted
n = int(input())
s = list(map(int, input().split()))
sx = sorted(s)
a = sx[(n//2)-1]
b = sx[n//2]
for i in s:
  if i <= a:
    print(b)
  else:
    print(a)
# Judge status: Accepted
s=input()
t=input()
import sys
m=[-1]*26
mrev=[-1]*26
for i,j in enumerate(s):
    x=ord(j)-ord('a')
    y=ord(t[i])-ord('a')
    if m[x]==-1:
        m[x]=y
    elif m[x]!=y:
        print('No')
        sys.exit()
for i,j in enumerate(t):
    x=ord(j)-ord('a')
    y=ord(s[i])-ord('a')
    if mrev[x]==-1:
        mrev[x]=y
    elif mrev[x]!=y:
        print('No')
        sys.exit()
print('Yes')
# Judge status: Wrong Answer
s = input()
d = {}
for letter in s:
  if letter in d:
    d[letter] += 1
  else:
    d[letter] = 1
flag = 1
for key in d:
  if d[key] % 2 != 0:
    print("No")
    flag = 0
if(flag == 1):
	print("Yes")
# Judge status: Accepted
n = int(input())
dp = [[0 for _ in range(3)] for _ in range(n+1)]
ls  = [[1,2],[0,2],[0,1]]
for i in range(1,n+1):
    day = list(map(int,input().split()))
    dp[i][0] = day[0] + max(dp[i-1][1],dp[i-1][2])
    dp[i][1] = day[1] + max(dp[i-1][0],dp[i-1][2])
    dp[i][2] = day[2] + max(dp[i-1][0],dp[i-1][1])
print(max(dp[n]))
# Judge status: Accepted
n = int(input())
s = list(input())
t = list(input())


ans = 0
for i in range(n):
    ans = 0
    if t[n - i - 1] == s[-1]:
        for j in range(n - i - 1):
            if s[n - 1 - j] == t[n - i - 1 - j]:
                continue
            else:
                ans = 1
        if ans == 0:
            print(len(s + t[n - i :]))
            break
    else:
        ans = 1
if ans == 1:
    print(len(s + t))
# Judge status: Wrong Answer
N = int(input())

Sum = (1+N)*N/2
Fizz = ((1+N//3)*N//3)/2*3
Buzz = ((1+N//5)*N//5)/2*5
FizzBuzz = ((1+N//15)*N//15)/2*15

print (int(Sum-Fizz-Buzz+FizzBuzz))
# Judge status: Wrong Answer
K = int(input())
a = []
def dfs(x):
    if x > 3234566667:
        return
    a.append(x)
    for i in range(10):
        if abs(x%10-i) <= 1:
            dfs(x*10+i)

for i in range(1,11):
    dfs(i)
a = sorted(a)
print(a[K-1])
# Judge status: Wrong Answer
s = input().split()

a = int(s[0])
b = int(s[1])
c = int(s[2])
d = int(s[3])

answer = 0

if a < c and d < b:
    answer = d - c
elif c < a and b < d:
    answer = b - a
elif c > b or a > d:
    answer = 0
elif b > c:
    answer = b - c
elif d > a:
    answer = d - a


print(answer)
# Judge status: Wrong Answer
if len(set(input())) >= 2:
	print('yes')
else:
	print('No')
# Judge status: Wrong Answer
n = input()

if len(n) == 1:
  print(n)
  exit()

ok = False
ans = ""
for i, c in enumerate(n):
  x = int(c)
  if x == 9:
    ans += "9"
  else:
    if ok:
      ans += "9"
    else:
      if i == len(n)-1:
        ans = ans[:-1]
        ans += str(int(n[i-1])-1)
        ans += "9"
      else:
        ans += str(x-1)
    ok = True
    
t = 0
for c in ans:
  x = int(c)
  t += x
print(t)
# Judge status: Accepted
n = int(input())
s = input()

ans = 0
mx = 0

for i in range(n):
    if s[i] == 'I':
        ans += 1
        if ans >= mx:
            mx = ans
    else:
        ans -= 1

print(mx)
# Judge status: Wrong Answer
n=int(input())
a=0
for i in range(n):
  if i**2>=n:
    break
  else:
    a=i**2
print(a)
# Judge status: Accepted
a = int(input())
b = int(input())
c = int(input())

print(int((a+b)*c/2))
# Judge status: Accepted
s=list(input())
a=0
t='?'
ch=0
l=len(s)
for i in range(l):
    if ch==1:
        ch=0
        continue
    if s[i]!=t:
        a+=1
        t=s[i]
    else:
        if i<l-1:
            t=s[i]+s[i+1]
            a+=1
            ch=1
print(a)
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))
ans = 1000000
for i in range(n):
    counter = 0
    while(a[i] % 2 == 0):
        a[i] //= 2
        counter += 1
    ans = min(ans,counter)
print(ans)
# Judge status: Accepted
a,b = map(int, input().split())

if a%3 == 0 or b%3 == 0 or (a+b)%3 == 0:
  print('Possible')
else:
  print('Impossible')