peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
a=int(input().replace(" ",""))
for i in range(20000):
  if i**2==a:
    print("Yes")
    break
  if i**2>a:
    print("No")
    break
# Judge status: Accepted
T=input()

print(T.replace("?","D"))
# Judge status: Wrong Answer
n = int(input())
ans=((n+1//2)/n)
print(ans)
# Judge status: Accepted
x,y=map(int,input().split())
count=0
while x<=y:
  count+=1
  x*=2
print(count)
# Judge status: Wrong Answer
n,m = map(int, input().split())
A = []
B = []
ans = 0
H = list(map(int,input().split()))
for i in range(m-1):
    a, b = map(int, input().split())
    A.append(int(a))
    B.append(int(b))
for i in range(m-1):
  if H[(A[i])-1] < H[(B[i])-1]:
    ans += 1
for i in range(m-1):
  if A.count(i) == 0 and B.count(i) == 0:
    ans += 1
for i in range(m-1):
  for j in range(m-1):
    if A[i] == B[j] and B[i] == A[j]:
      ans += 1
print(ans)
# Judge status: Accepted
n=int(input())
ans=0
for i in range(n+1):
  for j in range(n+1):
    if i*4+j*7==n:
      ans=1
print(["No","Yes"][ans])
# Judge status: Accepted
def isKaibun(str):
    isKaibun = True
    length = len(str)
    for i in range(length):
        if str[i] != str[length - i - 1]:
            isKaibun = False
            break
    return isKaibun

# 整数の入力
S = input()

N = len(S)

output = "No"

flag1 = isKaibun(S)
flag2 = isKaibun(S[0 : int(((N-1)/2))])
flag3 = isKaibun(S[int(((N+3)/2)-1): N])

if flag1 and flag2 and flag3:
    output = "Yes"

###########　出力
print(output)
# Judge status: Wrong Answer
n, m, xx, yy = map(int, input().split())
x = list(map(int , input().split()))
y = list(map(int , input().split()))
x.sort()
y.sort()

zx = max(x[-1], xx)
zy = min(y[0], yy)

if yy == x[-1]:
    print('War')
    exit()
if xx == y[0]:
    print('War')
    exit()
if x[-1] == y[0]:
    print('War')
    exit()
print('No War')
# Judge status: Accepted
N,K = map(int,(input().split()))
h = [int(input())for _ in range(N)]
h.sort()

print(min(h[i+K-1]-h[i] for i in range(N-K+1)))
# Judge status: Accepted
s = input()
t = input()

n = len(s)

ans = 'No'

for a in range(0, n):
    if s == t:
        ans = 'Yes'
        break
    t = t[1:] + t[0]

print(ans)
# Judge status: Wrong Answer
import numpy as np
N = int(input())
X_arr = np.empty(N - 1, dtype = int)
ans = 0
for c in range(1, N):
  np.append(X_arr, N - c)

for b in range(1, N):  
  ans += np.count_nonzero(X_arr % b == 0)
print(ans)
# Judge status: Wrong Answer
n, k = map(int, input().split())
wp, wr, ws = map(int, input().split())
hand = {"p":wp, "r":wr, "s":ws}
t = input()
lst = []
for i in range(k):
  lst.append([t[j] for j in range(len(t)) if j%k==i])
ans = 0
for b in lst:
  tmp = ""
  for i in b:
    if i==tmp:
      tmp=""
    else:
      ans+=hand[i]
      tmp=i
print(ans)
# Judge status: Accepted
def solver():
    A, B = [int(n) for n in input().split()]
    if A <=5:
      return 0
    if 6 <= A <= 12:
      return B//2
    if 13 <= A:
      return B

if __name__=='__main__':
  print(solver())
# Judge status: Wrong Answer
n = int(input())
s = list(input())
half = int(n/2)

max1 = 0
for i in range(half):
  f = set(s[:half-i])
  b = set(s[half-i:])
  union = len(f&b)
  if max1 <= union:
    max1 = union
  else:
    break

max2 = 0
for i in range(half):
  f = set(s[:half+i])
  b = set(s[half+i:])
  union = len(f&b)
  if max2 <= union:
    max2 = union
  else:
    break
    
ans = max1 if max1>max2 else max2
print(ans)
# Judge status: Wrong Answer
d, n = map(int, input().split())
print(100**d*n)
# Judge status: Accepted
n = int(input())
ll = list(map(int, input().split()))
cnt = 0
for i in range(n):
    for j in range(i+1,n):
        for k in range(j+1,n):
            a,b,c = ll[i], ll[j], ll[k]
            if a == b or b == c or c == a:
                continue
            vs = [a,b,c]
            vs.sort()
            if vs[0] + vs[1] > vs[2]: 
                cnt += 1
                # print(vs)

print(cnt)
# Judge status: Accepted
s = input()[::-1]
t = input()[::-1]
sl, tl = len(s), len(t)
for i in range(sl - tl + 1):
    for j in range(tl):
        if s[i + j] != "?" and s[i + j] != t[j]:
            break
    else:
        print((s[:i] + t + s[i + tl:]).replace("?", "a")[::-1])
        break
else:
    print("UNRESTORABLE")
# Judge status: Wrong Answer
n = int(input())
trans = [int(input()) for _ in range(5)]
x = min(trans)
t = n-1 // x
t += 4
print(t)
# Judge status: Wrong Answer
N,D = map(int, input().split())
print(N//D+1)
# Judge status: Wrong Answer
import sys
stdin = sys.stdin
from itertools import product

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))

n, x = na()
a = na()
b = list()

apre = a[0]
ans = 0
for ai in a:
    eat = max(0, apre + ai - x)
    ans += eat
    apre = ai - eat
print(ans)
# Judge status: Wrong Answer
import re
S,T=open(0)
S=S.replace('?','.')
s=len(S)
t=len(T)
for i in range(s-t,-1,-1):
 if re.match(S[i:i+t],T):
  print((S[:i]+T+S[i+t:]).replace('.','a'))
  exit()
print('UNRESTORABLE')
# Judge status: Accepted
s, w = list(map(int,input().split()))
if s > w:
    print('safe')
else:
    print('unsafe')
# Judge status: Wrong Answer
S = str(input())
x = len(S)
if '0' in S:
  y0 = S.count('0')
else:
  y0 = 0
if '1' in S:
  y1 = S.count('1')
else:
  y1 = 0
  
d = abs(y0 - y1)
print(x - d)
# Judge status: Wrong Answer
s = input()
l1 = len(s)
res = 0
if l1%2 ==0:
    for i in range(l1%2+1):
        if s[i]!=s[-i-1]:
            res +=1
else :
    for i in range(l1//2):
        if s[i]!=s[-i-1]:
            res +=1
print(res)
# Judge status: Wrong Answer
import math
n = int(input())

for i in range (n,1,-1):
    ans= math.sqrt(i)
    sq= int(ans)
    sq=float(sq)
    #print(ans,sq)
    if sq==ans:
        print(i)
        break
# Judge status: Accepted
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

def main():
    N = int(input())
    p = list(map(int, input().split()))

    s_p = sorted(p)

    c = 0
    for i in range(N):
        if p[i] != s_p[i]:
            c += 1
            if c > 2:
                print('NO')
                exit()

    print('YES')

if __name__ == "__main__":
    main()
# Judge status: Accepted
import bisect
n = int(input())
*a, = sorted(map(int, input().split()))
*b, = sorted(map(int, input().split()))
*c, = sorted(map(int, input().split()))

ans = 0
for _b in b:
    _a = bisect.bisect_left(a, _b)
    _c = bisect.bisect_right(c, _b)

    ans += _a*(len(c)-_c)

print(ans)
# Judge status: Accepted
A,B,K = map(int, input().split(" "))
count = 0
for i in range(1,A+1)[::-1]:
    if A%i==0 and B%i==0:
        count+=1
        if count==K:
            print(i)
            break
# Judge status: Accepted
a = input()
test = ''
for i in range(len(a)):
  if a[i] == '0':
    test += '0'
  elif a[i] == '1':
    test += '1'
  else:
    if len(a) == 0:
      pass
    else:
      test = test[:-1]
    
print(test)
# Judge status: Accepted
n = int(input())
ab = []
for i in range(n):
    ab.append(tuple(map(int,input().split())))
ab.sort(key=lambda x: x[1])
m = 0
ans = "Yes"
for ai,bi in ab:
    m += ai
    if m > bi:
        ans = "No"
print(ans)
# Judge status: Accepted
import copy
n=int(input())
tmp=0
a=[]
for i in range(n):
    a.append(int(input()))
s=copy.deepcopy(a)
s.sort(reverse=True)
t=s[0]
tt=s[1]
for i in range(n):
    if a[i]==t:
        print(tt)
    else:
        print(t)
# Judge status: Accepted
s = int(input())
arr = []
m = 1
while s not in arr:
    arr.append(s)
    if s % 2 == 0:
        s //= 2
    else:
        s = 3 * s + 1
    m += 1
print(m)
# Judge status: Accepted
s = raw_input()
if 'a' in s and 'b' in s and 'c' in s:
    print 'Yes'
else:
    print 'No'
# Judge status: Accepted
s = input()
t = input()

for i in range(len(s)):
    s = s[-1] + s[:-1]
    #print(s)
    if s == t:
        print('Yes')
        exit()
print('No')
# Judge status: Accepted
n = int(input())
d = []
for i in range(n):
    s, p = input().split()
    d.append((s,int(p),i+1))
d.sort(key = lambda x: x[1], reverse = True)
d.sort(key = lambda x: x[0])
for i in range(n):
    print(d[i][2])
# Judge status: Accepted
import math
x = int(input())
if (x >= 100) & (math.ceil(((x % 100) / 5)) <= x // 100):
    print(1)
else:
    print(0)
# Judge status: Wrong Answer
S = list(input())
if S[-1] == S[-2]:
    if S[-3] == S[-4]:
        print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
S = input()
n = len(S) + 1
num = [0] * n
for i in range(n-1):
    if S[i] == '<':
        num[i + 1] = max(num[i] + 1, num[i + 1])
for i in range(n - 2, -1, -1):
    if S[i] == '>':
        num[i] = max(num[i + 1] + 1, num[i])
print(sum(num))
print(num)
# Judge status: Accepted
n,m=map(int,input().split())
if n >2 and m >2:
    ans = (n-2)*(m-2)
elif n ==2 or m ==2:
    ans = 0
elif n == 1 and m == 1:
    ans = 1
elif n == 1:
    ans = m-2
else:
    ans = n-2

print(ans)
# Judge status: Accepted
"""
author : halo2halo
date : 24, Jan, 2020
"""

import sys

# import numpy as np

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
A, B = map(int, input().split())

if A <= 8 and B <= 8:
  print('Yay!')
else:
  print(':(')
# Judge status: Accepted
import numpy as np

A,B,M = map(int,input().split())
a = input().split()
b = input().split()

num = int(min(a)) + int(min(b))

for _ in range(M):
    m1,m2,m3 = map(int,input().split())
    res = int(a[m1-1])+int(b[m2-1]) - m3
    num = min(num,res)

print(num)
# Judge status: Wrong Answer
a, b = map(int, input().split())
if a >= 13:
    print(b)
elif 12 >= a >= 6:
    print(b / 2)
else:
    print(0)
# Judge status: Accepted
n = int(input())
a = []
for i in range(n):
    a.append(list(map(int, input().split())))
dp = [[0 for i in range(3)] for i in range(n+10)]
#print(a)
#print(dp)
for i in range(1,n+1):
    dp[i][0] = max(dp[i-1][1] + a[i-1][0],dp[i-1][2] + a[i-1][0])
    dp[i][1] = max(dp[i-1][0] + a[i-1][1],dp[i-1][2] + a[i-1][1])
    dp[i][2] = max(dp[i-1][0] + a[i-1][2],dp[i-1][1] + a[i-1][2])
print(max(dp[n][0],dp[n][1],dp[n][2]))
# Judge status: Wrong Answer
import sys
input = sys.stdin.readline
x = input().split()
print("A" + x[0] + "C")
# Judge status: Accepted
s = input()
print("2018" + s[4:])
# Judge status: Accepted
N=input("")
N=N.split(" ")
K=int(N[1])
N=N[0]
s=str(input(""))
print(s[0:K-1]+s[K-1].lower()+s[K:])
# Judge status: Accepted
import fractions

N,X = map(int,input().split())
x = list(map(int,input().split()))
x = sorted([abs(i - X) for i in x])

ans = x[0]
for i in x[1:]:
    ans = fractions.gcd(ans,i)
print(ans)
# Judge status: Accepted
import sys
a = int(sys.stdin.readline().rstrip())
print(a**2)
# Judge status: Accepted
a = input()
for aa in a:
    if aa == '7':
        print('Yes')
        break
else:
    print('No')
# Judge status: Accepted
s_a = list(input())[::-1]
s_b = list(input())[::-1]
s_c = list(input())[::-1]
 
person = "a"
 
try:
  while True:
    if person == "a":
      person = s_a.pop()
    elif person == "b":
      person = s_b.pop()
    else:
      person = s_c.pop()
except IndexError:
  print(person.upper())
# Judge status: Accepted
n, x = map(int,input().split())
l = list(map(int,input().split()))

SUM = 0
cnt = 1
for i in l:
    SUM += i
    if SUM > x:
        print(cnt)
        exit()
    cnt += 1
else:
    print(cnt)
# Judge status: Accepted
a,b,c,d = [int(_n) for _n in input().split()]
print(max([a*c, a*d, b*c, b*d]))
# Judge status: Accepted
from bisect import bisect_left, bisect_right, bisect
n = int(input())
alis = sorted(list(map(int, input().split())))
blis = list(map(int, input().split()))
clis = sorted(list(map(int, input().split())))
ans = 0
for b in blis:
    up = bisect_left(alis, b)
    down = n - bisect(clis, b)
    ans += up*down
print(ans)
# Judge status: Accepted
#n=int(input())
n,k=map(int,input().split())
#l=list(map(int,input().split()))
#l=[list(map(int,input().split())) for i in range(n)]

mod=10**9+7
ans=0
for kval in range(k,n+2):
    mx=kval*(2*n-kval+1)//2
    mn=kval*(kval-1)//2
    add=mx-mn+1
    ans=(ans+add) % mod

print(ans)
# Judge status: Wrong Answer
n,m,x = map(int,input().split())
c = []
a = []
for i in range(n):
  l = list(map(int,input().split()))
  c.append(l[0])
  a.append(l[1:])
result = -1
for i in range(2 ** n):
  ct = 0
  at = [0] * m
  for b in range(1, n + 1):
    if i & b > 0:
      ct += c[b - 1]
      for j in range(0, m):
        at[j] += a[b - 1][j]
  if result == -1 or ct < result:
    r = 1
    for ati in at:
      if ati < x:
        r = 0
    if r == 1:
      result = ct
print(result)
# Judge status: Accepted
from math import sqrt
from sys import stdin
X = int(stdin.readline().rstrip())

def is_prime(x):
    if x == 2:
        return True

    if x < 2 or x % 2 == 0:
        return False

    i = 3
    while i <= sqrt(x):
        if x % i == 0:
            return False
        i = i + 2
    
    return True

while not is_prime(X):
    X += 1

print(X)
# Judge status: Wrong Answer
n  = int(input())
li = list(map(int,input().split()))
li.sort()
print(sum(li[n+1:2*n+1]))
# Judge status: Accepted
from sys import stdin, setrecursionlimit
from collections import defaultdict


def main():
    input = stdin.readline
    n = int(input())
    dic = defaultdict(list)
    for i in range(1, n + 1):
        s, p = map(str, input().split())
        dic[s].append([int(p), i])
        dic[s].sort(reverse=True)
    s_dic = sorted(dic.items(), key=lambda x: x[0])

    for k, arr in s_dic:
        for ai in arr:
            print(ai[1])


if __name__ == "__main__":
    setrecursionlimit(10000)
    main()
# Judge status: Wrong Answer
import numpy as np
from collections import Counter

# 最頻値
def mode(list):
    c = Counter(list)
    freq_scores = c.most_common()
    max_count = freq_scores[0][1]
    modes = []
    for num in freq_scores:
        if num[1] == max_count:
            modes.append(num[0])
    return(modes)

n = int(input())
p_list = list(map(int, input().split()))
ans = 1
min = p_list[0]
for i in range(n - 1):
  if min >= p_list[i + 1]:
    ans += 1
    min =p_list[i]
print(ans)
# Judge status: Wrong Answer
n, m, k = map(int, input().split())

if k == 0 or k == n * m:
    print("Yes")
    exit()

for i in range((n + 1) // 2):
    for j in range((m + 1) // 2):
        if i * j + (n - i) * (m - j) == k:
            print("Yes")
            exit()
print("No")
# Judge status: Wrong Answer
n,m = map(int, input().split())
pairs = [input().split() for _ in range(n)]
pairs.sort()
ans = 0
k = 0
while m>0:
    x = min(m,int(pairs[k][1]))
    ans += int(pairs[k][0])*x
    m -= x
    k += 1
print(ans)
# Judge status: Wrong Answer
n = input()

n = int()

if n == 7:
  print("yes")
else:
    if n == 5:
        print("yes")
    else:
            if n == 3:
                print("yes")
            else:
                print("no")
# Judge status: Accepted
a, b = map(str, input().split())

K = int(a+b)

Nobless = 0

for i in range (0, K+1):
	if i**2 == K:
		Nobless+=1
	else:
		continue

if Nobless >= 1:
	print('Yes')
else:
	print('No')
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
c = [0]*(n+1)
for i in a:
  c[i] += 1
ans = 1
for i in range(n+1):
    if c[-1] == 0:
        c.pop()
    else:
        break

mod = 998244353
for i in range(len(c)-1):
    ans *= pow(c[i], c[i+1], mod)
    ans %= mod

if a[0] != 0:
    ans *= 0
if c[0] != 1:
    ans *= 0
print(ans)
# Judge status: Accepted
n, k = map(int, input().split())

d = [0] * k
a = [0] * k
sunuke = [0] * n

for i in range(k):
    d[i] = int(input())
    a[i] = list(map(int, input().strip().split()))
    for j in range(len(a[i])):
        sunuke[a[i][j]-1] = sunuke[a[i][j]-1] + 1

print(sunuke.count(0))
# Judge status: Accepted
W, a, b = map(int,input().split())
# N = int(input())
# al = list(map(int,input().split()))


if a <= b:
    if b-(a+W) >= 0:
        print(b-(a+W))
    else:
        print(0)
else:
    if a - (b+W) >= 0:
        print(a - (b+W))
    else:
        print(0)
# Judge status: Accepted
def solve():
    N = int(input())
    X = list(map(int, input().split()))
    
    sorted_X = sorted(X)
    mid_l = sorted_X[N // 2 - 1]
    mid_r = sorted_X[N // 2]
    
    for xi in X:
        if xi <= mid_l:
            print(mid_r)
        else:
            print(mid_l)


if __name__ == '__main__':
    solve()
# Judge status: Wrong Answer
K=int(input())

seven=0
m=1
while m!=0:
	seven=seven*10+7
	m=seven % K

print(seven)
# Judge status: Accepted
S = int(input())

mod = 1000000007

if S < 3:
    print(0)
else:
    sums = [0,0,0]
    vals = [0,0,0]
    runningsum = 0
    i = 3
    while(i<=S):
        val = (1+sums[i-3])%mod
        vals.append(val)
        sums.append((sums[-1]+val)%mod)
        i+=1
    print(vals[-1])
# Judge status: Accepted
a,b = map(int, input().split())
ans = 0
ans += max(a,b)
ans += max(max(a,b)-1, min(a,b))
print(ans)
# Judge status: Wrong Answer
import sys
import os

def file_input():
    f = open('CODE_FESTIVAL_2017Final/input.txt', 'r')
    sys.stdin = f

def main():
    #file_input()
    S=input()

    a=b=c=0

    for s in S:
        if s=='a':
            a+=1
        elif s=='b':
            b+=1
        else:
            c+=1

    if max(a,b,c)-min(a,b,c)<=1:
        print('Yes')
    else:
        print('No')

if __name__ == '__main__':
    main()
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
x = int(0)
y = int(-1)
while  x < 1:
  for i in range(N):
    if A[i]%2 == 1:
      x = 1
    A[i] =int(A[i]/2)
  y = y+1
print(y)
# Judge status: Accepted
from collections import Counter
n,k=map(int,input().split())
a=list(map(int,input().split()))
d=Counter(a).most_common()
ans=0
for i in range(k,len(d)):
    ans+=d[i][1]
print(ans)
# Judge status: Wrong Answer
data = [int(x) for x in input().split(" ")]

for i in range(len(data)):
  if data[i] == 0: print(i)
# Judge status: Wrong Answer
a, b, x = map(int, input().split())
 
if b-a < x or b < x:
    print(0)
else:
    ans = (b//x+1)-(a//x+1)
    print(ans)
# Judge status: Accepted
N,K=map(int,input().split())
A=list(map(int,input().split()))
from collections import Counter
A=Counter(A)
ret=N
for i in A.most_common(K):
  ret-=i[1]
print(ret)
# Judge status: Accepted
# -*- coding: utf-8 -*-
N, A, B, C, D = map(int, input().split(' '))
A -= 1
B -= 1
C -= 1
D -= 1


S = input()
if S[A:C+1].count('##') or S[B:D+1].count('##'):
    print('No')
    exit(0)

if C > D:
    if not S[B-1: D+2].count('...'):
        print('No')
        exit(0)

print('Yes')
# Judge status: Wrong Answer
def s(num):
    yakusuu_array = []
    for i in range(1,num):
        if num % i == 0:
            yakusuu_array.append(i)
    return len(yakusuu_array)
N = int(input())
count = 0
for i in range(N):
    count = (i + 1) * s(i + 1) + count
print(count)
# Judge status: Accepted
import sys
from collections import Counter

N = int(input())
A = list(map(int, sys.stdin.readline().rsplit()))
A.sort()
B = [0] * (A[-1] + 1)
C = Counter(A)

res = 0
for a in A:
    if B[a] == 0 and C[a] == 1:
        res += 1
    for i in range(a, A[-1] + 1, a):
        B[i] += 1

print(res)
# Judge status: Accepted
S = input()
print(1+S.rfind("Z")-S.find("A"))
# Judge status: Accepted
x = int(input()) % 1000

if x == 0:
    print(0)
else:
    print(1000 - x)
# Judge status: Accepted
print('YNeos'['2'in input()::2])
# Judge status: Accepted
A,B,N=map(int,input().split())

ans=-100000
for x in range(A):
  #print(A//B,x//B,A*x//B,A*x//B-A*(x//B))
  ans=max(ans,(A*x//B)-A*(x//B))
  if x==N:break
x=B-1
if x>N:x=N
ans=max(ans,(A*x//B)-A*(x//B))
print(ans)
# Judge status: Accepted
N = int(input())

ans = 0
for i in range(1, N):
    for j in range(1, N):
        if i * j < N:
            ans += 1
        else:
            break

print(ans)
# Judge status: Accepted
n, m = map(int, input().split())
a = list(map(int, input().split()))
s = sum(a)
cnt = 0
for i in range(n):
    if a[i] >= s / (4 * m):
        cnt += 1

if cnt >= m:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
s=list(input())
a=list("abcdefghijklmnopqrstuvwxyz")
a=[i for i in a if i not in s]
if a:
    a.sort()
    print(a[0])
else:
    print("None")
# Judge status: Accepted
s = input()[::-1]
size = len(s)
s += "4"

ans = 0
bef = 0

for i in range(size):
    v1 = int(s[i])
    v2 = int(s[i+1])
    if v1+bef>=6 or (v1+bef>=5 and v2>=5):
        ans += 10-(v1+bef)
        bef = 1
    else:
        ans += (v1+bef)
        bef = 0

ans += bef
print(ans)
# Judge status: Wrong Answer
N = input()
L=len(N)

DP=[[N]*2 for _ in range(L+1)]
DP[0][0]=0
DP[0][1]=0

for i,n in enumerate(N,1):
    DP[i][0]= min(DP[i-1][0]+int(n),DP[i-1][1]+10-int(n))
    DP[i][1] = min(DP[i-1][0]+int(n)+1,DP[i-1][1]+9-int(n))


print(DP[L][0])
# Judge status: Wrong Answer
N = 10**6
mod = 10**9 + 7
fact = [1]
for i in range(1, N+1):
    fact.append(fact[-1]*i%mod)

n, m = map(int, input().split())
ans = 0
if n - m > 1 or m - n > 1:
    ams = 0
elif n - m == 0:
    ans = 2 * (fact[n])**2
else:
    ans = fact[n] * fact[m]
print(ans)
# Judge status: Accepted
n , k = map(int,input().split())
ans = 0
for i in range(1,n+1):
    for j in range(10000):
        if i*2**j >= k:
            ans += (1/n)*(0.5**j)
            break
print(ans)
# Judge status: Wrong Answer
K=int(input())
S=str(input())
if K>1 and K<100 and len(S)>1 and len(S)<100:
    if len(S)==K or len(S)<K:
        print(S)
    else:
        print(S[:7]+'...')
# Judge status: Accepted
n = int(input())
if n % 2 == 0:
    print(n / 2 / n)
else:
    print((n // 2 + 1) / n)
# Judge status: Wrong Answer
# coding: utf-8
S = list(input())

if ('N' in S and 'S' in S) or ('N' not in S and 'S' not in S) and ('W' in S and 'E' in S) or ('W' not in S and 'E' not in S):
    print('Yes')
else:
    print('No')
# Judge status: Accepted
import sys
import itertools
import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N, *a = map(int, read().split())
a.sort()

A = [0] * (10**5 + 1)
for i in a:
    A[i] += 1
cnt = 0
for i in range(1, 10**5 - 1):
    cnt = max(cnt, A[i - 1] + A[i] + A[i + 1])
print(cnt)
# Judge status: Accepted
a, b = map(str, input().split())
a = int(a)
c, d = map(int, b.split('.'))
b = c * 100 + d
b *= a
print(int(("00" + str(b))[:-2]))
# Judge status: Accepted
if __name__ == "__main__":
    ans = 6
    a = int(input())
    b = int(input())
    print(6 // a // b)
# Judge status: Accepted
#!/usr/bin/env python3
n = int(input())
s = list(input())
s = list(map(lambda x: ord(x), s))
for i in range(len(s)):
    if s[i] + n > 90:
        s[i] = s[i] + n - 90 + 64
    else:
        s[i] = s[i] + n
s = list(map(lambda x: chr(x), s))
print(''.join(s))
# Judge status: Wrong Answer
s = input()
a = 0

for i in range(len(s)):
    if s[i] == 'A':
        if a == 0:
            a = i
    elif s[i] == 'Z':
        z = i

print(z - a + 1)
# Judge status: Accepted
X = int(input())
ans = (X // (5 + 6)) * 2
X %= 5 + 6
if X == 0:
    pass
elif X <= 6:
    ans += 1
else:
    ans += 2
print(ans)
# Judge status: Accepted
N,S = open(0).read().split()
N=int(N)
S=[s == "." for s in list(S)]

w = sum([1 if s else 0 for s in S])
b = 0
m = w + b
for s in S:
    if s:
        w -= 1
    else:
        b += 1
    m = min(m, w + b)
print(m)
# Judge status: Wrong Answer
n = int(input())
S = [int(input()) for _ in range(n)]
S.sort()

score = sum(S)
while score > 0 and score % 10 == 0:
    S = S[1:]
    score = sum(S)
print(score)
# Judge status: Accepted
arr = []
for _ in range(int(input())):
  arr.append(int(input()))
arr2 = arr.copy()
arr2.sort()
z = arr2[-1]
zz = arr2[-2]
for k in arr:
  if k != z:
    print(z)
  else:
    print(zz)
# Judge status: Accepted
s=str(input())
l=[]
for i in range(len(s)):
  l.append(s[i])
if len(set(l))==len(s):
  print('yes')
else:
  print('no')
# Judge status: Accepted
ALPHABET = "abcdefghijklmnopqrstuvwxyz"

s = input()
for i in range(26):
    if s.count(ALPHABET[i]) == 0:
        print(ALPHABET[i])
        break
else:
    print("None")
# Judge status: Wrong Answer
n = int(input())
an = list(map(int,input().split()))
zyunban = []
t = 1

for x in an:
  zyunban.insert(x-1,t)
  t += 1
  

zyunban = list(map(str,zyunban))

print(" ".join(zyunban))
# Judge status: Wrong Answer
N = int(input())
a = list(map(int, input().split()))
ans = [0]
for i in range(N-1):
  ans.append(ans[-1]^a[i]^a[i+1])
print(" ".join(map(str,ans)))