peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
def LI():return list(map(int,input().split()))

# for i in range(10):
#     print(i&1^0)

x=int(input())
m=100
for i in range(5000):
    m=int(m*1.01)
    if m>=x:
        print(i+1)
        exit()
# Judge status: Accepted
n=int(input())
dic={}
for i in range(n):
  a=input()
  if a not in dic.keys():dic[a]=1
  else:dic[a]+=1
max_value=max(dic.values())
dic_max=[k for k, v in dic.items() if v==max_value]
dic_s=sorted(dic_max)
[print(i) for i in dic_s]
# Judge status: Wrong Answer
S = input()

if S[:2] == '00' or S[2:] == '00':
    print('NA')
elif int(S[:2]) <= 12 and int(S[2:]) <= 12:
    print('AMBIGUOUS')
elif int(S[:2]) <= 12:
    print('MMYY')
elif int(S[2:]) <= 12:
    print('YYMM')
else:
    print('NA')
# Judge status: Accepted
N = int(input())
B = list(map(int,input().split()))
A = [0]*N
for i in range(N):
  if i == 0:
    A[i] = B[i]
  elif i < N-1:
    A[i] = min(B[i],B[i-1])
  elif i == N-1:
    A[i] = B[i-1]
#  print("i:",i,", A[i]:",A[i])
print(sum(A))
# Judge status: Accepted
s = input()
k = int(s[-1])
if k == 3:
  print('bon')
elif k in [0, 1, 6, 8]:
  print('pon')
else:
  print('hon')
# Judge status: Accepted
print("Yes" if list(map(int,input().split()))[0] <= sum(map(int,input().split())) else "No")
# Judge status: Accepted
s=list(input())
mn=len(s)

for x in ['0','1']:
  bef=x
  ret=0
  for c in s: 
 
    if bef==c:

      if bef=='1':

        bef="0"
      elif bef=='0':

        bef="1"
      ret+=1
    else:
      bef=c

  if ret<mn:
    mn=ret

print(mn)
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))
ans = sum(B)
for i in range(0,N-1):
    if A[i]+1 == A[i+1]:
        ans += C[A[i]-1]
print(ans)
# Judge status: Accepted
x, a, b = list(map(int, input().split()))
if b <= a:
    print('delicious')
elif a < b <= x + a:
    print('safe')
else:
    print('dangerous')
# Judge status: Accepted
T = input()
ans = []
for i in range(len(T)):
    if T[i] == "?":
        ans.append("D")
    else:
        ans.append(T[i])
print(*ans,sep="")
# Judge status: Wrong Answer
import itertools as it

n,m,q = map(int, input().split())
l = [list(map(int, input().split())) for i in range(q)]
ans = 0

for v in list(it.product(range(1,m+1),repeat=n)):
    num = 0
    for w in l:
        x,y,z = w[0]-1,w[1]-1,w[2]
        if v[y] - v[x] == z:
            num += w[3]
    if num > ans:
        ans = num
print(ans)
# Judge status: Wrong Answer
s = input()
if s == 'Sunny':
    print('Cloudy')
elif s == 'Cloudy':
    print('Rainy')
else:
    print('sunny')
# Judge status: Accepted
N,K=map(int,input().split())
A=list(map(int,input().split()))
l,r=1,10**9+1
while r-l>1:
    t=(l+r)//2
    k=sum([(a+t-2)//(t-1)-1 for a in A])
    if K<k:
        l=t
    else:
        r=t
print(l)
# Judge status: Accepted
s = input()
t = input()

if t[:len(t)-1] == s:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
import sys
n = int(sys.stdin.readline().rstrip("\n"))
i = 0
while 2**i <= n:
    i += 1
print(2**(i-1))
# Judge status: Accepted
import numpy as np
n,k = map(int,input().split())
s = input()
lr_cnt = 0
rl_cnt = 0
mnt = 0
for i in range(len(s)-1):
    if s[i] == 'L' and s[i+1] == 'R':
        lr_cnt += 1
        
    if s[i] == 'R' and s[i+1] == 'L':
        rl_cnt += 1
mnt  = rl_cnt + lr_cnt+1
mnt = np.max([1,mnt-2*k])
if mnt == 1:
    print(n-1)
else:
    print(n-rl_cnt-lr_cnt+2*k-1)
# Judge status: Accepted
def main():
  n ,mods = 0, [1]+[0]*2019
  for i, j in enumerate(reversed(input())):
    n = (n+int(j)*pow(10, i, 2019))%2019
    mods[n] += 1
  print(sum([i*(i-1)//2 for i in mods]))
main()
# Judge status: Wrong Answer
n=int(input())
a=sorted(list(map(int,input().split())))
c=1
x=[]
for i in range(n-1):
    if a[i]!=a[i+1]:
        if c>=2:
            x.append(a[i])
        c=1
    else:
        c+=1
if c>=2:
    x.append(a[n-1])
if len(x)<=1:
    print(0)
else:
    print(x[-1]*x[-2])
# Judge status: Wrong Answer
s =input()

if s[-1] == s:
  print('es')
else:
  print('s')
# Judge status: Accepted
a, b = map(int,input().split())
if a == 1:
    a = 14
if b == 1:
    b = 14
ans = "Draw" if a == b else "Alice" if a > b else "Bob"
print(ans)
# Judge status: Accepted
_,s,_=input().split()
print("A"+s[0]+"C")
# Judge status: Accepted
n = int(input())
s = input()
if n % 2 != 0:
	print('No')
else:
	if s[:n // 2] == s[n // 2:]:
		print('Yes')
	else:
		print('No')
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
res = [0] * n
for i,val in enumerate(a):
  res[val-1] = i+1
print(*res)
# Judge status: Wrong Answer
# ABC169 E

N=int(input())
AB=[tuple(map(int,input().split())) for _ in [0]*N]

def med(A):
    N=len(A)
    if N%2:
        return A[(N+1)//2-1]
    else:
        return (A[N//2-1]+A[N//2])//2
    
A=[i[0] for i in AB]  
B=[i[1] for i in AB]
medA=med(sorted(A))
medB=med(sorted(B))

if N%2:
    print(medB-medA+1)
else:
    print(2*medB-2*medA+1)
# Judge status: Accepted
N=int(input())
for i in range(N,1112):
  str_i=str(i)
  if all(str_i[i]==str_i[0] for i in range(1,len(str_i))):
    print(i)
    break
# Judge status: Wrong Answer
# A Lucky 7

N = input()

for n in N:
  if n == "7":
    print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
k, x = map(int, input().split())
','.join([str(i) for i in range(x-k+1, x+k-1+1)]).replace(',', ' ')
# Judge status: Accepted
S = input().strip()

ans = [""]
prev = ""
for i, s in enumerate(S):
    prev += s
    if ans[-1] != prev:
        ans.append(prev)
        prev = ""
    else:
        if i == len(S) - 1:
            ans.append(prev)

result = len(ans) - 1
if ans[-1] == ans[-2]:
    result -= 1

print(result)
# Judge status: Accepted
S=input()
if S[0]==S[1]==S[2] or S[1]==S[2]==S[3]:
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
S = input()

if S == "ABC":
    print("ABC")

if S == "ARC":
    print("ARC")
# Judge status: Wrong Answer
x, y, z = map(int,input().split())
print(x*y/2)
# Judge status: Wrong Answer
A = sorted(list(map(int, input().split())))
print(A[0]*A[1]/2)
# Judge status: Wrong Answer
N = int(input())
ans = ["a"]
for i in range(N-1):
    new = []
    for j in range(len(ans)):
        l = ord(ans[j][-1])-95
        add = [chr(ord("a") + idx) for idx in range(l)]
        for k in add :
            new.append(ans[j] + k)
    ans = new

for p in ans:
    print(p)
# Judge status: Accepted
x,y=list(map(int,input().split()))
a=[1,3,5,7,8,10,12]
b=[4,6,9,11]
c=2

if x in a and y in a:
    print("Yes")
    exit()

if x in b and y in b:
    print("Yes")
    exit()

if x==c and y==c:
    print("Yes")
    exit()

print("No")
# Judge status: Accepted
n,k = map(int,input().split())
ans = 1
while n >= k**ans:
    ans += 1
print(ans)
# Judge status: Accepted
x, y, z = input().split()
print(x[0] + y[0] + z[0])
# Judge status: Accepted
n = int(input())
power = 1
for i in range(1,n+1):
    power *= i
    power = power % (10**9 + 7)
print(power)
# Judge status: Accepted
x, y, z = map(int, input().split())

ans = 0
x -= z
for i in range(100000):
    if x >= y + z:
        ans += 1
        x -= y + z
    else:
        break

print(ans)
# Judge status: Wrong Answer
import numpy as np


def main():
    n = int(input())
    As = list(map(int, input().split()))
    As_set = list(set(As))
    std = int(np.around(np.mean(As_set)))

    ans = 0
    for a in As:
        ans += (std - a) ** 2
    print(ans)


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
icase=0
if icase==0:
    import sys
    a,b=map(int,input().split())
    for i in range(1,999):
        isum=(i*(i+1))//2-a
        for j in range(i,1000):
            jsum=(j*(j+1))//2-b
            if jsum==isum and 1<=jsum:
                print(jsum)
                sys.exit()
# Judge status: Accepted
c = 0
s = input()
t = input()
for i in range(0,len(s)):
  if s[i]!=t[i]:
    c = c+1
print(c)
# Judge status: Accepted
x = int(input())

if 400 <= x <= 599:
    print('8')
elif 600 <= x <= 799:
    print('7')
elif 800 <= x <= 999:
    print('6')
elif 1000 <= x <= 1199:
    print('5')
elif 1200 <= x <= 1399:
    print('4')
elif 1400 <= x <= 1599:
    print('3')
elif 1600 <= x <= 1799:
    print('2')
elif 1800 <= x <= 1999:
    print('1')
# Judge status: Accepted
n, t = map(int, input().split())
ans = 100000
for i in range(n):
    c, tt = map(int, input().split())
    if tt <= t:
        ans = min(ans, c)
if ans == 100000:
    print("TLE")
else:
    print(ans)
# Judge status: Accepted
from collections import deque

n = int(input())
a = list(map(int, input().split()))
b = deque([a[0]])
rev = 1

for i in range(1, n):
    if rev % 2 == 0:
        b.append(a[i])
    else:
        b.appendleft(a[i])
    rev += 1

if rev % 2 == 1:
    b.reverse()

print(*b)
# Judge status: Accepted
def main():
    N = int(input())
    A = int(input())
    if N % 500 <= A :
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
a, b, c = list(map(int, input().split()))

s = a / c + 1

n = 1

while True:
  if s * c < b:
    n += 1
    s += 1
  else:
    break

print(n + 1)
# Judge status: Accepted
A,B,C=[list(input()) for i in range(3)]
now="a"
while True:
    if now=="a":
        if len(A)==0:
            print("A")
            break
        now=A.pop(0)
    elif now=="b":
        if len(B)==0:
            print("B")
            break
        now=B.pop(0)
    else:
        if len(C)==0:
            print("C")
            break
        now=C.pop(0)
# Judge status: Wrong Answer
we = str(input())
r = we.split(" ", -1)

A = r[0]
B = r[1]
C = r[2]
K = r[3]
A = int(A)
B = int(B)
C = int(C)
K = int(K)

def max_sum(A, B, C, K):
	if (A and B and C and K) >= 0:   
		if A >= K:
			print(A)
		elif A < K:
			R = K - A
			if B >= R:
				print(A)
			elif B < R:
				S = R - B
				print(A + S*(-1))
max_sum(A, B, C, K)
# Judge status: Accepted
input()
x=0
a=[0]
for i in input():a+=a[-1]+1-2*(i=='D'),
print(max(a))
# Judge status: Wrong Answer
import re
Sa = list(input())
Sb = list(input())
Sc = list(input())
player = 'a'
while True: 
    if player == 'a':
        if len(Sa) == 0:
            print('A')
            break
        player = Sa.pop()
    elif player == 'b':
        if len(Sb) == 0:
            print('B')
            break
        player = Sb.pop()
    elif player == 'c':
        if len(Sc) == 0:
            print('C')
            break
        player = Sc.pop()
# Judge status: Wrong Answer
n = int(input())
def bub(n,l):
  tot = 0
  for _ in range(n):
    for i in range(n-1):
      if l[i+1] > l[i]:
        l[i],l[i+1] = l[i+1],l[i]
        tot += 1
  return tot
p = list(map(int, input().split()))
q = list(map(int, input().split()))
print(abs(bub(n,p)-bub(n,q)))
# Judge status: Wrong Answer
h1, m1, h2, m2, K = list(map(int, input().split()))
if abs(h1-h2)*60 + abs(m1-m2) <= 120:
    print('{}'.format(0))
else:
    print('{}'.format(abs(h1-h2)*60 + abs(m1-m2) - K))
# Judge status: Accepted
a = int(input())
b = int(input())
h = int(input())
s = (a + b) * h / 2
print(int(s))
# Judge status: Wrong Answer
A,B,C = input().split()
A = int(A)
B = int(B)
C = int(C)
if A == B == C :
    print('No')
else :
    print('Yes')
# Judge status: Wrong Answer
N = ("0"+input())[::-1]

ans = 0
carry = 0
for i in range(len(N)-1):
    n = int(N[i])
    nextn = int(N[i+1])
    if carry == 1:
        carry = 0
        n += 1

    if n <=4:
        ans += n
    elif n >= 6:
        ans += 10-n
        carry = 1
    else: # n==5
        if nextn <= 4:
            ans += n
        else:
            ans += 10-n
            carry = 1

print(ans)
# Judge status: Accepted
w = input()
from collections import Counter
wc = Counter(w)

for c in wc.values():
    if c%2 == 1:
        print('No')
        break
else:
    print('Yes')
# Judge status: Wrong Answer
import sys
import heapq, math
from itertools import zip_longest, permutations, combinations, combinations_with_replacement
from itertools import accumulate, dropwhile, takewhile, groupby
from functools import lru_cache
from copy import deepcopy

A, B = map(int, input().split())
if A == B:
    print("Draw")
elif B == 1 or A < B:
    print("Bob")
else:
    print("Alice")
# Judge status: Wrong Answer
n, m = map(int, input().split())
for i in range(n):
    a = list(input())

for j in range(m):
    b = list(input())

for x in range(n-m+1):
    for y in range(n-m+1):
        for z in range(m):
            if a[x+z][y:y+m] != b[z]:
                break
            else:
                print('Yes')
                exit()
print('No')
# Judge status: Accepted
import re
print(re.match("A[a-z]+C[a-z]+$", input()) and "AC" or "WA")
# Judge status: Wrong Answer
N = int(input())
A = [int(input()) for _ in range(N)]
ans = 0
for i in range(N):
    ans += A[i] // 2
    N %= 2
    if N == 1 and i < N-1 and A[i+1] > 0:
        A[i+1] -= 1
        ans += 1
print(ans)
# Judge status: Accepted
A,B = map(int, input().split())
if A <= 8 and B <= 8:
    print('Yay!')
else:
    print(':(')
# Judge status: Wrong Answer
a,b,c,d=map(int,input().split())
print(max(a*c,b*c,a*d,b*d,0))
# Judge status: Accepted
a, b, c = (int(n) for n in input().split())
if b // a <= c: print(b // a)
else: print(c)
# Judge status: Accepted
import sys
sys.setrecursionlimit(10**7)
input = lambda: sys.stdin.readline().strip()

def main():
    S,W = map(int,input().split())
    print("unsafe" if S<=W else "safe")

main()
# Judge status: Accepted
s = input()
cont = len(s)//2
if s == "hi"*cont:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
num = list(map(int, input().split()))
i = sorted(num)
print(i[2]*10+i[1]+i[0])
# Judge status: Accepted
a=int(input())
b=int(input())
c=int(input())
x=int(input())

ans=0
for i in range(a+1):
  for j in range(b+1):
    for k in range(c+1):
      if 500*i+100*j+50*k==x:
        ans+=1

print(ans)
# Judge status: Accepted
n,k=map(int,input().split())

a1=n%k
a2=abs(a1-k)
print(min(a1,a2))
# Judge status: Accepted
a,b,c = map(int,input().split())
k = int(input())
print(a+b+c+max(a,b,c)*(2**k-1))
# Judge status: Wrong Answer
S = input()
S_inv = S[::-1]

out = 0
for i in range(len(S)):
  print(S[:-i])
  #if S[i] != S[:-i]:
#    out = out + 1
#
#out = out // 2
#print(out)
# Judge status: Accepted
SX,SY,TX,TY=map(int,input().split())
NX=TX-SX
NY=TY-SY
ans=[]
for i in range(NX):
  ans.append('R')
for i in range(NY):
  ans.append('U')
for i in range(NX):
  ans.append('L')
for i in range(NY):
  ans.append('D')
ans.append('D')
for i in range(NX+1):
  ans.append('R')
for i in range(NY+1):
  ans.append('U')
ans.append('L')
ans.append('U')
for i in range(NX+1):
  ans.append('L')
for i in range(NY+1):
  ans.append('D')
ans.append('R')
print(''.join(ans))
# Judge status: Wrong Answer
n = int(input())

now_answer = 0
upper = int(n**0.5)
for i in range(1, upper):
  if n % i == 0:
    now_answer = i + n//i - 2

print(now_answer)
# Judge status: Wrong Answer
import numpy as np
s = list(map(int,input().split()))
n=s[0]
k=s[1]
s = list(map(int, input().split()))
s.sort()
print(s)
s=np.array(s[0:k])
print(np.sum(s))
# Judge status: Wrong Answer
N,K = map(int,input().split())
H = list(map(int,input().split()))
H.sort()
H.reverse()
if K==0:
        pass
elif K==1:
        del H[0]
else:
   del H[0:K-1]
a = 0

for i in H:
        a+=i
print(a)
# Judge status: Accepted
# -*- coding: utf-8 -*-
import sys

N = int(input().strip())
#-----

if N <= 104:
    print(0)
    sys.exit()
elif N == 105:
    print(1)
    sys.exit()
else:
    ans_list=[105]
    for i in range(107,N+1,2):
        cnt=0
        for j in range(1,N+1):
            if i % j == 0:
                cnt += 1
        
        if cnt == 8:
            ans_list.append(i)

print(len(ans_list))
# Judge status: Accepted
n = list(map(int, input()))
if sum(n) % 9 == 0:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
N=int(input())
C=0
for i in range(N):
  if i**2<=N:
    C=i**2
  elif i**2>N:
    break
print(C)
# Judge status: Accepted
from collections import Counter

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

cnt = Counter(A)
rect = []

for i,j in zip(cnt.keys(),cnt.values()):
    if j >= 2:
        rect.append([i,j])

rect.sort(reverse=True)
##print(rect)
ans = 0
flag = False
finished = False
for i,j in rect:
    if flag:
        ans *= i
        finished = True
        break
    elif j < 4:
        ans = i
        flag = True
    else:
        ans = i**2
        finished = True
        break

print(0 if not finished else ans)
# Judge status: Wrong Answer
H, N = map(int, input().split())
count = 0
A = list(map(int, input().split()))
for i in range(N):
    Ai = A[i]
    count += Ai
if H <= Ai:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
def main():
    h, n = [int(i) for i in input().split()]
    num = [int(i) for i in input().split()]
    for j in range(n):
        h -= num[j]
        if h <= 0:
            return "Yes"
    if h > 0:
        return "No"

print(main())
# Judge status: Wrong Answer
import sys
readline = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
#mod = 998244353
INF = 10**18
eps = 10**-7

n = int(readline())

p = [list(map(int,readline().split())) for i in range(n)]

xmin = INF
ymin = INF

for (x,y) in p:
    xmin = min(x,xmin)
    ymin = min(y,ymin)

for i in range(n):
    p[i][0] -= xmin
    p[i][1] -= ymin

dmax = -INF
dmin = INF

for (x,y) in p:
    dmax = max(dmax, x+y)
    dmin = min(dmin, x+y)

print(dmax-dmin)
# Judge status: Accepted
print(2**int(input()).bit_length()-1)
# Judge status: Accepted
input()
a = list(map(int, input().split()))
print("Yes" if sum(a) > max(a)*2 else"No")
# Judge status: Wrong Answer
N = int(input())

_sum = 0
for i in range(1, N):
    if i % 3 != 0 and i % 5 != 0:
        _sum += i

print(_sum)
# Judge status: Wrong Answer
A = list(input())
sign = ['+','-']
for i in range(2):
    for j in range(2):
        for k in range(2):
            if eval(A[0]+sign[i]+A[1]+sign[j]+A[2]+sign[k]+A[3]) == 7:
                print('{}{}{}{}{}{}{}'.format(A[0],sign[i],A[1],sign[j],A[2],sign[k],A[3]))
                exit()
# Judge status: Accepted
import math

N, D = map(int, input().split())
x = [0] * N
y = [0] * N
count = 0
for i in range(N):
    x[i], y[i] = map(int, input().split())
    if math.sqrt(x[i] * x[i] + y[i] * y[i]) <= D:
      count += 1
    else:
      pass
print(count)
# Judge status: Accepted
K = int(input())
A,B = map(int,input().split())

for i in range(A,B+1):
    if i % K == 0:
        print("OK")
        exit()

print("NG")
# Judge status: Accepted
n  = int(input())
a = list(map(int, input().split()))
a.sort(reverse=True)

ans = a[0]
if n >2:
    for i in range(2,n,1):
        j = i//2
        ans += a[j]

print (ans)
# Judge status: Accepted
from math import ceil

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

x = min((a - 1) % 10, (b - 1) % 10, (c - 1) % 10, (d - 1) % 10, (e - 1) % 10) + 1
ans = ceil(a / 10) * 10 + ceil(b / 10) * 10 + ceil(c / 10) * 10 + ceil(d / 10) * 10 + ceil(e / 10) * 10
ans -= (10 - x)
print(ans)
# Judge status: Wrong Answer
o=str(input())
e=str(input())
r=[]
if len(o)==len(e):
  for i in range(len(o)):
    r.append(o[i]+e[i])
    i+=1
else:
  for i in range(len(e)):
    r.append(o[i]+e[i])
    i+=1
    r.append(o[len(o)-1])
print(''.join(r))
# Judge status: Wrong Answer
n,k = map(int, input().split())
A = list(map(int, input().split()))

def f(X):
  L = [0] * len(X)
  for k in range(len(X)):
    for j in range(len(X)):
      if max(0,j-X[j]) <= k <= max(j+X[j],n-1):
        L[k] += 1
      else:
        pass
  return [L[i]+X[i] for i in range(len(X))]
   
X = A
for i in range(k):
  X = f(X)
  
P = [str(X[i]) for i in range(n)]
print(" ".join(P))
# Judge status: Accepted
N,X=map(int,input().split())

if N%(X*2+1)==0:
    ans=N//(X*2+1)
else:
    ans=N//(X*2+1)+1
print(ans)
# Judge status: Wrong Answer
n,x = map(int,input().split())
a = sorted(map(int,input().split()))
c=0
d=0
for i in a:
    if c+i<x:
        c+=i
        d+=1
else:
    if c<x:
        d-=1
print(d)
# Judge status: Accepted
k=input()
n=int(k)
s=input()
a=len(s)

if a>n:
    print(s[0:n] +"...")

else:
    print(s)
# Judge status: Accepted
import sys


# \n
def input():
    return sys.stdin.readline().rstrip()


def main():

    X =int(input())
    if X==1:
        print("NO")
        exit()
    if 105 % X ==0:
        print("YES")
    else:
        print("NO")





if __name__ == "__main__":
    main()
# Judge status: Accepted
n,m = map(int,input().split())

s = [0]*n

for i in range(m):
    keta, num = map(int,input().split())
    if keta == 1 and num == 0 and n != 1:
        print(-1)
        exit()
    if s[keta-1] == 0 or s[keta-1] == num:
        s[keta-1] = num
    else:
        print(-1)
        exit()

if s[0] != 0:
    print(*s, sep ="")
elif s[0] == 0 and n == 1:
    print(0)
elif s[0] == 0 and n != 1:
    s[0] = 1
    print(*s, sep ="")
else:
    print(-1)
# Judge status: Accepted
a, b = map(int, input().split())
if a >= 13:
    print(b)
elif 6 <= a <= 12:
    print(int(b/2))
else:
    print(0)
# Judge status: Wrong Answer
n,k=(int(x) for x in input().split())
total=0
j=0
count=0
while k>(2**j):
    j=j+1
for i in range(j,1,-1):
    pro=(1/n)*((1/2)**i)
    total=total+pro
    count=count+1
while(count!=n):
    total=total+1/n
    count=count+1
print(round(total,12))
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))

l = [0] * (n + 1)
for i in range(n):
    if a[i] == i + 1:
        l[i] = 1
count = 0
for i in range(n):
    if l[i] == 1:
        l[i] = 0
        l[i + 1] = 0
        count += 1
print(count)
# Judge status: Wrong Answer
A,B,C=map(int,input().split())
L=[A,B,C]
L=sorted(L)
ans=0
ans+=L[2]-L[1]
L[0]+=L[2]-L[1]
ans+=(L[2]-L[0])//2
print(ans)
# Judge status: Accepted
N, K = map(int, input().split())
A = set(map(int, input().split()))
while 1:
  B = set(map(int, list(str(N))))
  if len(A & B) == 0:
    print(N)
    break
  N += 1
# Judge status: Wrong Answer
a,b=map(int,input().split())

if a>=13:
    print(b)
elif 6<a<=12:
    print(b//2)
else:
    print(0)
# Judge status: Wrong Answer
N=int(input())
L=list(map(int,input().split()))

for i in range(N):
    if max(L)<sum(L)-max(L):
        print('Yes')
    else:
        print('No')
# Judge status: Accepted
N = int(input())
S = list(input())
c = 0
l = []
for i in S:
    if i == "(":
        c += 1
    else:
        c -= 1
    l.append(c)

m = min(l)
if m < 0:
    for i in range(N):
        l[i] += (-m)

    M = l[-1]
    ans = ["("] *(-m) + S + [")"] *M
    
else:
    M = l[-1]
    ans = S + [")"] *M

output = "".join(ans)
print(output)
# Judge status: Accepted
n, k = map(int, input().split())

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

n2=abs(n1-k)

if n1<n2:
    print(n1)
else:
    print(n2)
# Judge status: Wrong Answer
N = int(input())
l = [(i+1, int(input())) for i in range(N)]
l.sort(key=lambda x:(x[1],x[0]))

v = 0
a = 0
for i in range(N-1):
    if l[i][0] >= l[i+1][0] or l[i][1] == l[i+1][1]:
        a += 1
    else:
        a = 0
    v = max(v, a)

print(v+1)
# Judge status: Accepted
a,b=map(int,input().split())
if a==b:
    print('Draw')
elif a > b and b != 1:
    print('Alice')
elif a==1:
    print('Alice')
else:
    print('Bob')
# Judge status: Accepted
A, B = map(int, input().split())
cnt = 0
for n in range(A, B+1):
    if str(n) == str(n)[::-1]:
        cnt += 1
print(cnt)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
c2 = sum([a % 2 == 0 and a % 4 != 0 for a in A])
c4 = sum([a % 4 == 0 for a in A])
cp = sum([a % 2 != 0 for a in A])
print('Yes' if cp+c4 == N and cp - c4 ==
      1 or cp <= c4 and c4+cp+c2 == N else 'No')
# Judge status: Wrong Answer
n = int(input())
com=[]
for i in range(n):
    s=list(input())
    if com:
        tmp = com.copy()
        for j in s:
            if j in tmp:
                tmp.remove(j)
        for k in tmp:
            com.remove(k)
    else:
        com=s
com.sort()
print(''.join(com))
# Judge status: Wrong Answer
s = input()
l = ['SUN', 'MON', 'TUR', 'WED', 'THU', 'FRI', 'SAT']
m = [7, 6, 5, 4, 3, 2, 1]

for i in range(7):
    if s == l[i]:
        print(m[i])
# Judge status: Wrong Answer
s = input()
x = [ '0', 'SAT', 'SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI']
for i in range(len(x)):
     if s == x[i]:
          print(i)