peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))
#l = [list(map(int,input().split())) for i in range(n)]
#a = [list(input()) for _ in range(n)]
#a = [int(input()) for _ in range(n)]

a,b,c = map(int, input().split())
k = int(input())

ans = sum([a,b,c]) - max(a,b,c) + max(a,b,c) * 2**k
print(ans)
# Judge status: Wrong Answer
n, m = map(int,input().split())
if m >= 3 and n >= 3:
    print((m-2) * (n-2))
elif m >= 3 or n >= 3:
    print((max(m,n)-2) * min(m,n))
else:
    if (m * n) % 2 == 0:
        print(0)
    else:
        print(m * n)
# Judge status: Wrong Answer
a,b,c,d = map(int,input().split())
print(0 if c >= b else min(b,d)-c)
# Judge status: Accepted
n = int(input())
A=list(map(int,input().split()))
cnt=0
B=[]
C=[]
for i,a in enumerate(A):
    B.append(A[i]+i)
    C.append(A[i]-i)
from collections import Counter
Bd=dict(Counter(B))
Cd=dict(Counter(C))
cnt=0
for k in Bd.keys():
    try:
        cnt+=Bd[k]*Cd[-k]
    except KeyError:
        continue
print(cnt)
# Judge status: Accepted
N = int(input())

rlt = 0
dic = {}

for _ in range(N):
  a = input()
  if a not in dic:
    dic[a] = 1
  else:
    dic[a] += 1
    
for k in dic:
  if dic[k] % 2 == 1:
    rlt += 1
    
print(rlt)
# Judge status: Accepted
import sys
import math
input = sys.stdin.readline
sys.setrecursionlimit(10**6)


def main():
    a, b = map(int, input().split())

    ans = 2000
    for i in range(1, 1001):
        if a == math.floor((i * 1.08)) - i and b == math.floor((i * 1.10)) - i:
            ans = min(ans, i)
    if ans == 2000:
        print('-1')
    else:
        print(ans)


main()
# Judge status: Wrong Answer
a = int(input())

print(a+a^2+a^3)
# Judge status: Wrong Answer
N=int(input())
A=list(map(int,input().split()))
A.sort(reverse=True)
A.append(0)
i=0
ans=1
d=0
while i<N:
  b=A[i]
  c=0
  while i<N and b==A[i]:
    i+=1
    c+=1
  if 2<=c<=3:
    d+=1
    ans*=b
    if d==2:
      break
  elif 4<=c:
    ans*=b*b
    d=2
    break
if d!=2:
  print(0)
else:
  print(ans)
# Judge status: Wrong Answer
a ,b =map(int,input().split())

if (a*b)%2 ==0:
    print("even")
else:
    print("odd")
# Judge status: Accepted
x,y=map(int,input().split())
if (x+y)%3!=0:
    print(0)
    exit()
if x<y:
    x,y=y,x
if 2*y<x:
    print(0)
    exit()
mod=10**9+7
a=(2*y-x)//3
b=(2*x-y)//3
mx=10**6
k=[1]*(mx+1)
def inv(n):
    return pow(n,mod-2,mod)
for i in range(mx):
    k[i+1]=k[i]*(i+1)%mod
ans=(k[a+b]*inv(k[a])*inv(k[b]))%mod
print(ans)
# Judge status: Accepted
n = int(input())
ans = 0

for i in range(1,n+1):
    if len(str(i))%2 == 1:
        ans += 1

print(ans)
# Judge status: Accepted
S = str(input())
print('Yes' if S[2]==S[3] and S[4]==S[5] else 'No')
# Judge status: Accepted
from itertools import accumulate
from bisect import *
N, X = map(int, input().split())
L = list(map(int, input().split()))
S = list(accumulate([0]+L))
print(bisect_right(S,X))
# Judge status: Wrong Answer
n,m = map(int,input().split())
ls = [i for i in range(m)]
rs = [i for i in range(m)]
cnt = 0
for _ in range(m):
    ls[_],rs[_] = map(int,input().split())

maxl = max(ls)
minr = min(rs)

for nn in range(1,n+1):
    if maxl <= nn or minr >= nn:
        cnt += 1

print(cnt)
# Judge status: Accepted
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))
#l = [list(map(int,input().split())) for i in range(n)]
#a = [list(input()) for _ in range(n)]
#a = [int(input()) for _ in range(n)]



s = sorted(input())

if "".join(s) == "abc":
    print("Yes")
else:
    print("No")
# Judge status: Accepted
N = int(input())

answer = 0
number_of_digits = len(str(N))

total = 0
for nth in range(1, number_of_digits + 1):
    is_odd = nth % 2 is 1
    if not is_odd: continue
    number_of_intergers = (10 ** ((nth - 1))) * 9
    total += number_of_intergers

    if 10 ** nth -1 >= N:
        total -= 10 ** number_of_digits - 1 - N

print(total)
# Judge status: Accepted
import numpy as np

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

deg = min(abs(h*360/12+m*360/12/60-m*360/60),360-abs(h*360/12+m*360/12/60-m*360/60))
theta = deg * np.pi /180
ans = np.sqrt(np.power(a,2)+np.power(b,2)-2*a*b*np.cos(theta))

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

ans = [0] * n

def prc(L):
    res = []
    for x in L:
        res.append(chr(ord('a') + x))
    print(''.join(res))

while 1:
    prc(ans)
    for i in range(n-1, 0, -1):
        temp = max(ans[:i])
        if ans[i] <= temp:
            ans[i] += 1
            for j in range(i+1, n):
                ans[j] = 0
            break
    else:
        break
# Judge status: Wrong Answer
a,b=(input().split())
ai=int(a)
bi=int(b)
c1=(b*ai)
c2=(a*bi)  
l=[]
l.append(str(c1))
l.append(str(c2))
l.sort
print(l[0])
# Judge status: Accepted
n = int(input())
A = map(int, input().split())
L = [0] * n

for i,val in enumerate(A):
    L[val-1] = i + 1

print(*L)
# Judge status: Accepted
a,b = map(int,input().split())
print(a * b)
# Judge status: Accepted
from collections import Counter
n = int(input())
a = list(map(int,input().split()))
q = int(input())
num = Counter(a)
s = sum(a)
for _ in range(q):
    b,c = map(int,input().split())
    s += (c-b)*num[b]
    num[c] += num[b]
    num[b] = 0
    print(s)
# Judge status: Accepted
s=list(str(input()))
s[3]='8'
print(''.join(s))
# Judge status: Accepted
import sys
nums=input().rstrip().split(" ")
A=int(nums[0])
B=int(nums[1])
answer=0
for i in range(1,1500):
    #print(int(i*0.08))
    #print(int(i*0.1))
    if int(i*0.1)==B and int(i*0.08)==A:
        answer=i
        print(answer)
        sys.exit()
if answer==0:
    answer=-1
print(answer)
# Judge status: Accepted
NM = list(map(int, input().split()))
N, M = NM[0],NM[1]
a = list(map(int, input().split()))
x = 0
for i in range(M):
    x += a[i]

if x > N:
    print(-1)
else:
    print(N - x)
# Judge status: Wrong Answer
import heapq
n = int(raw_input())
heap = [map(int, raw_input().split(' '))[::-1] for _ in range(n)]
heapq.heapify(heap)
#(deadline, duration)
def f(heap):
	t = 0
	while(heap):
		nd,ct = heapq.heappop(heap)
		gap = nd - t
		while(heap and heap[0][0] == nd):
			u,v = heapq.heappop(heap) 
			t += v
			gap -= v
		if gap < 0: return False
		while(heap and heap[0][1] <= gap):
			_,v = heapq.heappop(heap)
			gap -= v
			t += v
	return True
print 'Yes' if f(heap) else 'No'
# Judge status: Accepted
k=int(input())
if k % 2 == 0:
  print(k // 2 * k // 2)
else:
  print(k // 2 * (k // 2 + 1))
# Judge status: Accepted
a,b,t = map(int,input().split())
print((t//a)*b)
# Judge status: Accepted
def odd_even():
    N,M = map(int, input().split())
    return N*(N-1)//2 + M*(M-1)//2 

print(odd_even())
# Judge status: Accepted
# -*- coding: utf-8 -*-
a, b, c = map(int,input().split())

if b - a == c - b:
    print("YES")
else:
    print("NO")
# Judge status: Accepted
n, x = map(int, input().split())
a = [0] + list(map(int, input().split()))

ans = 0
for i in range(n):
    if a[i] + a[i+1] > x:
        diff = (a[i] + a[i+1]) - x
        ans += diff
        a[i+1] -= diff
print(ans)
# Judge status: Accepted
from collections import defaultdict
p_y = defaultdict(set)

N,M = map(int,input().split())
PY = [[int(x) for x in input().split()] for _ in range(M)]
for p,y in PY:
        p_y[p].add(y)

def set_rank(retu):
        return {x:i for i,x in enumerate(sorted(retu), 1)}

p_y = {p:set_rank(retu) for p,retu in p_y.items()}
for p,y in PY:
        print('{:06g}{:06g}'.format(p,p_y[p][y]))
# Judge status: Accepted
from collections import deque
def solve():
    K = int(input())
    q = deque(list(range(1,10)))
    cnt = 0

    tmp = 0
    while cnt < K:
        tmp = q.popleft()
        cnt += 1

        ones_place = tmp % 10
        if ones_place != 0:
            q.append(tmp*10+ones_place-1)
        q.append(tmp*10+ones_place)
        if ones_place != 9:
            q.append(tmp*10+ones_place+1)
    
    print(tmp)
        
if __name__ == '__main__':
    solve()
# Judge status: Accepted
n=int(input())
sm=0
for i in range(1,n):
  sm+=(n-1)//i
print(sm)
# Judge status: Wrong Answer
N,M=map(int,input().split())
A=list(map(int,input().split()))
A.pop(0)

if N>1:
    for _ in range(N-1):
        B=list(map(int,input().split()))
        for num in A:
           if num not in B[1:]:
               A.remove(num)

print(len(A))
# Judge status: Accepted
import sys
input = sys.stdin.readline

a,b,k = (int(x) for x in input().split())

if a>k:
	print(a-k,b)
elif a+b>k:
	print(0,a+b-k)
else:
	print(0,0)
# Judge status: Wrong Answer
N = int(input())
A = [int(e) for e in input().split()]

S = [0]
sum =0
for i in range(0, N):
    S.append(S[i] + A[i])
for i in range(N):
    sum = sum + (S[i+1]-A[i]) * A[i]
print(sum)
# Judge status: Accepted
N,K = map(int,input().split())
R,S,P = map(int,input().split())
T = [_ for _ in input()]
cnt = 0
for i in range(N):
    if i < K or T[i] != T[i-K]:
        if T[i] == "r":
            cnt += P
        elif T[i] == "s":
            cnt += R
        else:
            cnt += S
    else:
        T[i] = "z"
print(cnt)
# Judge status: Wrong Answer
N, M, X= map(int, input().split())
arr=[list(map(int, input().split())) for _ in range(N)]

ans=1e+15
for paint_h in range(2**N):
	temp_arr=[0]*M
	for i in range(N):
		if (paint_h>>i)&1==1:
			temp_arr=[a+b for (a, b) in zip(temp_arr, arr[i])]
	if all(i>=X for i in temp_arr[1:]):
		ans=min(ans, temp_arr[0])
if ans==1e+15:
	ans=-1
print(ans)
# Judge status: Accepted
a, b = map(int, raw_input().split())
ans = 1
for i in range(a):
    ans = ans * 100
if b == 100:
    print ans * 101
else:
    print ans * b
# Judge status: Accepted
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


n,m = list(map(int, input().split()))
a = list(map(int, input().split()))
from heapq import heappop as hpp, heappush as hp
h = []
for num in a:
    hp(h, -num)
for _ in range(m):
    val = hpp(h)
    val *= -1
    hp(h, -(val//2))
ans = -sum(h)
print(ans)
# Judge status: Wrong Answer
import math

n, d = map(int, input().split())
cnt = 0
for i in range(n):
    x, y = map(int, input().split())
    dist = math.sqrt((x * x) + (y * y))
    print(dist)
    if dist <= d:
        cnt += 1
print(cnt)
# Judge status: Accepted
def f(s):
  m,y = int(s[:2]), int(s[2:])
  return (0 < m <= 12,0 < y <= 12)

print {(0,0):'NA', (0,1): 'YYMM', (1,0): 'MMYY', (1,1):'AMBIGUOUS'}[tuple(map(int,list(f(raw_input()))))]
# Judge status: Wrong Answer
n = int(input())
a = tuple(map(int,input().split()))
b = tuple(map(int,input().split()))
l = tuple(x+1 for x in range(n))
#print(a,b,l)
c,d = 0,0
cnt = 0
from itertools import permutations
for k in permutations(l):
    #print(k)
    cnt += 1
    if a ==k:
        c = cnt
    elif b ==k:
        d = cnt
print(abs(c-d))
# Judge status: Accepted
N = int(input())
m = dict()

prev = input()
m[prev] = True
flg = True

for _ in range(N - 1):
  s = input()
  flg = all([flg, s not in m, prev[len(prev) - 1] == s[0]])
  m[s] = True
  prev = s

print("Yes" if flg else "No")
# Judge status: Wrong Answer
a, b = map(int, input().split())
if a+b<=24:
  print(a+b)
else:
  print(a+b-12)
# Judge status: Wrong Answer
i = int(input())
j= i/2
k= i/2 +1
if (i== k or i==j):
    print(int(j))
# Judge status: Wrong Answer
import math
A = [int(input()) for _ in range(5)]
B = 10
ans = 0
for i in range(5):
  if A[i] % 10 < B and A[i] > 0:
    B = A[i] % 10
    ans = -10+B
for j in A:
  ans += math.ceil(j)
print(ans)
# Judge status: Accepted
N = int(input())
for n in range(N, 1000):
    if len(set(str(n))) == 1:
        print(n)
        break
# Judge status: Wrong Answer
N,S=int(input()),input()
ans=0
for i in range(N):
    a,b,c=S[:i+1],S[i:],0
    for j in range(26):
        if chr(97+j)in a and chr(97+j)in b:c+=1
    ans=max(ans,c)
print(ans)
# Judge status: Wrong Answer
import sys
def fb(num):
    a, b = 1, 0
    for _ in range(num):
        a, b = a + b, a
    return b

n,m = map(int,input().split())
broken = []
for i in range(m):
  broken.append(int(input()))
  if(len(broken) >= 2):
    if(broken[i] - broken[i-1] == 1):
      print("0")
      sys.exit()

ans = fb(n)//(2**m) % 1000000007 
print(ans)
# Judge status: Wrong Answer
n, X = map(int, input().split())
x = list(map(int, input().split()))
x.append(X)
x = sorted(x)
y = [x[i+1]-x[i] for i in range(n)]

def eu(a, b):
    a, b = sorted([a,b])
    while a != 0:
        b, a = a, b%a
    return b
d = y[0]
for i in range(1, n-1):
    d = eu(d, y[i])
print(d)
# Judge status: Wrong Answer
N = int(input())
d = {}
for i in range(1,N+1):
    d[i] = 0
A = list(map(int,input().split()))
for i in range(N):
    a = A[i]
    d[a] += 1
s = 0
for i in range(1,N+1):
    x = d[a]
    s += (x*(x-1))//2
for i in range(N):
    y = A[i]
    z = s + 1 - d[y]
    print(z)
# Judge status: Accepted
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

n,m = iim()

if n == 1 or m == 1:
    if n*m == 1:
        print(1)
    else:
        print(n*m-2)
else:
    print((n-2)*(m-2))
# Judge status: Accepted
def solve(a, b, c):
    if any(i % 2 == 1 for i in [a, b, c]):
        return 0
    if a == b == c:
        return -1
    a, b, c = (b + c) // 2, (c + a) // 2, (a + b) // 2
    return solve(a, b, c) + 1

a, b, c = map(int, input().split())

print(solve(a, b, c))
# Judge status: Accepted
import numpy as np

N = int(input())

l = np.arange(1,N+1)

print(np.sum(l%2==1)/N)
# Judge status: Accepted
a = list(map(int, input().split()))
k = int(input())

n = sum(sorted(a)[:-1])
s = sorted(a)[-1]

for i in range(k):
	s = s * 2

print(n + s)
# Judge status: Accepted
c11, c12, c13 = map(int, input().split())

for i in range(2):
    c1, c2, c3 = map(int, input().split())
    if (c1-c11) == (c2-c12) and (c2-c12) == (c3-c13):
        c11, c12, c13 = c1, c2, c3
    else:
        print('No')
        exit()
print('Yes')
# Judge status: Accepted
string = input()
n = int(string.split()[0])
k = int(string.split()[1])

diff = n - k
n = n - (diff // k) * k

while n > k:
    n = n - k

if n == k:
    print(0)
    exit()

print(min(n,k-n))
# Judge status: Wrong Answer
n=int(input())
a=input().split()
alen=len(a)
for i in range(0,alen):
    a[i]=int(a[i])
ans=0
for i in range(0,n):
    for j in range(0,i):
        if a[i-1]+a[j-1]==i-j:
            ans+=1
        
print(ans)
# Judge status: Wrong Answer
a,b = input().split()
c = int(a+b)
ans = "No"
for i in range(101):
    print(i**2)
    if i**2 == c:
        ans = "Yes"
        break
print(ans)
# Judge status: Wrong Answer
S = input()
ans = 0
for i in range(3):
  if S[i] != S[i+1]:
    ans = 1
print('Good' if ans == 1 else 'Bad')
# Judge status: Accepted
N, K = map(int, input().split())
A = [int(a) for a in input().split()]

def chk(x):
    s = 0
    for a in A:
        s += (a - 1) // x
    return 1 if s <= K else 0

l, r = 0, 1 << 30
while r - l > 1:
    m = (l + r) // 2
    if chk(m):
        r = m
    else:
        l = m
print(r)
# Judge status: Wrong Answer
X, Y, Z = list(map(int, input().split()))

ans = 0
while True:
    X -= Z
    if X <= 0:
        print(ans)
        break
    X -= Y
    if X <= 0:
        print(ans)
        break
    ans += 1
# Judge status: Accepted
N,A,B=map(int,input().split())
if (A+B)%2==0:
    ans=(B-A)//2
else:
    ans=min(A-1,N-B)+1+(B-A-1)//2
print(ans)
# Judge status: Wrong Answer
A, B = map(int,input().split())

print("Possible" if (A + B) % 3 == 0 else "Impossible")
# Judge status: Accepted
X,A,B=map(int,input().split())

x=B-A

if x<=0:
    print("delicious")
elif x<=X:
    print("safe")
else:
    print("dangerous")
# Judge status: Wrong Answer
line = input()
sides = [int(n) for n in line.split()]
sides.sort()
area = round(sides[0] * sides[1])/2
print(area)
# Judge status: Accepted
n=int(input())
a_array=list(map(int,input().split()))
all_xor=0
for a in a_array:
    all_xor^=a
print(" ".join([str(all_xor^a) for a in a_array]))
# Judge status: Wrong Answer
s=str(input())
t=str(input())
temps=list(set(s))
tempt=list(set(t))
temps=sorted(temps)
tempt=sorted(tempt)
for i in range(0,len(temps)):
  temps[i]=s.count(temps[i])
for i in range(0,len(tempt)):
  tempt[i]=t.count(tempt[i])
if temps==tempt:
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))
c1_list = [0]*60
for i in range(n):
  b = format(a[i], '060b')
  print(b)
  for j in range(len(b)):
    if b[j] == "1":
      c1_list[j] += 1
count = 0
for i in range(60):
  count = (count + c1_list[i]*(n-c1_list[i])*2**(59-i)) % 1000000007
print(count)
# Judge status: Wrong Answer
k = int(input())
s = input()

if len(s) > k:
    print(s[:7] + "...")
else:
    print(s)
# Judge status: Accepted
N,X = map(int,input().split())
A = list(map(int,input().split()))
wa = []
ans = 0

if A[0] > X:
  ans += A[0]-X
  A[0] = X

for i in range(N-1):
  wa.append(A[i]+A[i+1])

for j in range(N-2):
  if wa[j] > X:
    ans += wa[j]-X
    wa[j+1] -= wa[j]-X

if wa[N-2] > X:
  ans += wa[N-2]-X

print(ans)
# Judge status: Wrong Answer
import sys
N=int(input())
L=list(map(int,input().split()))
for i in range(N):
  if i==0:
    L[i]-=1
  elif i==N-1:
    if L[i-1]>L[i]:
      print("No")
      sys.exit()
  else:
    if L[i]>L[i+1]:
      L[i]-=1
    if L[i-1]>L[i]:
      print("No")
      sys.exit()
print("Yes")
# Judge status: Wrong Answer
n = int(input())
x = [list(map(int,input().split())) for i in range(n)]

if n%2==0:
    min_sum = x[(n//2)-1][0]+x[(n//2)][0]/2
    max_sum = x[(n//2)-1][1]+x[(n//2)][1]/2
    print(int((max_sum-min_sum)*2))
else:
    tmp = x[n//2]
    print(tmp[1]-tmp[0]+1)
# Judge status: Accepted
#!/usr/bin/env python3
_, *s = open(0)
c = 0
for t in s[::-1]:
    a, b = map(int, t.split())
    c += (-a-c) % b
print(c)
# Judge status: Accepted
K = int(input())
A, B = map(int,input().split())

ans = "NG"
for i in range(A,B+1):
    if i % K == 0:
        ans = "OK"
        break

print(ans)
# Judge status: Accepted
k = int(input())
import math

ans = 0

for a in range(1,k+1):
    for b in range(1, k+1):
        for c in range(1,k+1):
            ans += math.gcd(math.gcd(a,b),c)
print(ans)
# Judge status: Wrong Answer
x = list(map(int, input().split()))
for i in range(len(x)):
  if x[i] == 0:
    print(i+1)
    exit()
# Judge status: Wrong Answer
import math
import random

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

def quick(x):
  pri = math.floor(A * x / B)
  lat = A * math.floor(x / B)
  return math.floor(pri - lat)

max = quick(N)
for i in range(50000):
  ran = math.floor(random.uniform(0, N))
  tem = quick(ran)
  if(max < tem):
    max = tem

print(max)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))

b = round(sum(a) / n)
ans = 0
for i in a:
    ans += (i - b) ** 2

print(ans)
# Judge status: Accepted
f=lambda:map(int,input().split())
n,m=f()
g=[[] for _ in range(n)]
for _ in range(m):
  a,b=f()
  g[a-1]+=[b-1]
  g[b-1]+=[a-1]
p=[0]*n
from collections import*
q=deque([0])
while q:
  v=q.popleft()
  for c in g[v]:
    if p[c]<1: p[c]=v+1; q.append(c)
print('Yes',*p[1:],sep='\n')
# Judge status: Accepted
S, T = input().split()
A, B = map(int, input().split())
U = input()

if U == S:
    print(A-1, B)
else:
    print(A, B-1)
# Judge status: Wrong Answer
s=input()
l=len(s)
s+='?'
ans=0
ch = 0
for i in range(l):
    if s[i]!=s[i+1] or ch==1:
        ans+=1
        ch=0
    else:
        ch=1
print(ans)
# Judge status: Accepted
A,B,C=map(int,input().split())
answer=0
answer=C-(A-B)
if answer > 0:
    print(answer)
else:
    print(0)
# Judge status: Accepted
from collections import defaultdict
from collections import deque
import itertools
import math

def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()

n = readInt()
d = {"2":0,"4":0,"other":0}
for i in readInts():
	if i%4==0:
		d["4"]+=1
	elif i%2==0:
		d["2"]+=1
	else:
		d["other"]+=1
if d["2"]>1:
	if d["4"]>=d["other"]:
		print("Yes")
	else:
		print("No")
else:
	if d["4"]+1>=d["other"]+d["2"]:
		print("Yes")
	else:
		print("No")
# Judge status: Accepted
S = input()
N = len(S)
res = False
P = []
L = []
K = []
for s in range(N):
    P.append(S[s])
L = P[:(N-1)//2]
K = P[(N+3)//2-1:N]
if L == K:
    res = True
if res:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
s, w = map(int, input().split())
if w >= s:
    print("unsafe")
else:
    print("safe")
# Judge status: Wrong Answer
a,b = map(int,input().split())
if (a+b) == 0 or (b+a) == 0:
    print("Zero")
elif (a+b) > 0:
    print("Positive")
else:
    print("Negative")
# Judge status: Accepted
n,m = map(int,input().split())

if n == 1 and m == 1:
    print(1)
elif n == 1:
    print(max(0,m-2))
elif m == 1:
    print(max(0,n-2))
else:
    a = max(0,m-2)
    b = max(0,n-2)
    print(a*b)
# Judge status: Accepted
N,D=map(int,input().split())
ans=0
A=[]
for x in range(N):
  X=list(map(int,input().split()))
  for y in range(len(A)):
    s=0
    for z in range(D):
      s+=(A[y][z]-X[z])**2
    if ((s**(1/2))*10)%10==0:
      ans+=1
  A.append(X)
print(ans)
# Judge status: Accepted
import collections

s = map(int,list(raw_input()))

count = 0
for i in range(1,len(s)):
	if s[i] == s[i - 1]:
		s[i] = 1 - s[i]
		count += 1
print count
# Judge status: Wrong Answer
a,b,c,d=list(map(int,input().split()))
print(max(max(b,d)-min(a,c),0))
# Judge status: Wrong Answer
import math
n=int(input())
t=(n//500)*1000
s=(n-t*500//5)*5
print(t+s)
# Judge status: Accepted
N, H = map(int, input().split())
A = []
B = []
for i in range(N):
  a, b = map(int, input().split())
  A.append(a)
  B.append(b)
A.sort(reverse = True)
B.sort(reverse = True)
count = 0
for b in B:
  if b > A[0]:
    H -= b
    count += 1
  else:
    break
  if H <= 0:
    break
if H > 0:
  count += (H + A[0] - 1) // A[0]
print(count)
# Judge status: Accepted
N,M = [int(i) for i in input().split()]
S = 0

if N <= M//2:
    S = N + (M - 2*N)//4
else:
    if N > M//2:
        S = M//2
    else:
        S = N

print(S)
# Judge status: Wrong Answer
from collections import Counter

n = int(input())
aa = tuple(map(int, input().split()))
actr = Counter(aa)
q = int(input())

tb = {}
for i in range(q):
    b, c = map(int, input().split())
    tb[b] = c
    for k, v in tb.items():
        if v == b:
            tb[k] = c

    ans = 0
    for a, n in actr.items():
        ans += tb.get(a, a) * n
    print(ans)
# Judge status: Wrong Answer
[N,K] = list(map(int,input().split()))
x = list(map(int,input().split()))

#連続する蝋燭を全探索
l=0
r=K-1

ans=2*(10**8)+1
for i in range(N-K+1):
    ans = min(ans, abs(x[l])+ x[r]-x[l])
    l+=1
    r+=1

print(ans)
# Judge status: Accepted
n = int(input())
l = list(map(int,input().split()))
l.sort(reverse=True)
c = 0
for i in range(n-2):
  for j in range(i+1,n-1):
    if l[i] != l[j]:
      for k in range(j+1,n):
        if l[j] != l[k]:
          if l[i] < l[j]+l[k]:
            c += 1
print(c)
# Judge status: Accepted
n = int(input())
p = list(map(int, input().split()))

MIN = 10**6
ans = 0
for i in range(n):
    if p[i] <= MIN:
        ans += 1
    MIN = min(MIN, p[i])

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

if (a + b) % 3 == 0:
    print("Possible")
else:
    print("Impossible")
# Judge status: Wrong Answer
l1 = input().strip().split()
h = int(l1[0])
n = int(l1[1])
a = sorted([int(i) for i in input().strip().split()], reverse=True)
if h < sum(a[:n-1]):
    print("Yes")
else:
    print("No")
# Judge status: Accepted
N,R=map(int, input().split()) 
if N>=10:
    print(R)
if 0<=N<10:
    print(R+100*(10-N))
# Judge status: Wrong Answer
n = int(input())

ans = 0
n_dig = len(str(n)) # Nの桁数

carry = 0
for i in range(n_dig):
    d = n % 10
    n //= 10

    if carry + d <= 5:
        ans += d + carry
        carry = 0  # 繰り上がり
    else:
        ans += 10 - d - carry
        carry = 1

print(ans + carry)
# Judge status: Accepted
N, K = map(int, input().split())
if N%K:
    print(1)
else:
    print(0)
# Judge status: Accepted
S = input()

s = list(set(S))

if len(S) == len(s):
    print('yes')
else:
    print('no')