Harryxun/stf_run huggingface dataset:
X, N = map(int, input().split())
if N == 0:
    print(X)


else:
    p = list(map(int, input().split()))
    abs_list = []
    re_list = []
    min = 1000
    min_index = 0

    for i in range(100):
        abs_list.append(i + 1)
    for j in p:
        abs_list.remove(j)
    for i in range(len(abs_list)):

        re_list.append(abs(abs_list[i] - X))
    for i in range(len(re_list)):
        if min > re_list[i]:
            min = re_list[i]
            min_index = i
    
    print(abs_list[min_index])


### FIXED CODE ###

X, N = map(int, input().split())
if N == 0:
    print(X)
elif N == 100:
    if X <= 50:
        print(0)
    else:
        print(101)

else:
    p = list(map(int, input().split()))
    abs_list = []
    re_list = []
    min = 1000
    min_index = 0

    for i in range(250):
        abs_list.append(-100+i)
    for j in p:
        abs_list.remove(j)
    for i in range(len(abs_list)):

        re_list.append(abs(abs_list[i] - X))
    for i in range(len(re_list)):
        if min > re_list[i]:
            min = re_list[i]
            min_index = i
    if re_list[min_index] > X:
        print(0)
    else:
        print(abs_list[min_index])
import sys
from collections import defaultdict, deque
from functools import reduce
import math

input = sys.stdin.readline

def chmax(a, b):
    if a > b:
        return a
    else:
        return b

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

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

def main():
    N = int(input())
    T = [int(input()) for _ in range(N)]
    print(lcm(*T))


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
from collections import defaultdict, deque
from functools import reduce
import math

input = sys.stdin.readline

def chmax(a, b):
    if a > b:
        return a
    else:
        return b
    
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

def lcm_base(x, y):
    return (x * y) // gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

def main():
    N = int(input())
    T = [int(input()) for _ in range(N)]
    print(lcm(*T))


if __name__ == '__main__':
    main()
H,W=map(int,input().split())
S=[input().split() for i in range(H)]
columns=["A","B","C","D","E","F","G","H","I","J"]
for h in range(H):
    for w in range(W):
        if S[h][w]=="snuke":
            print(columns[w]+str(h+1))

### FIXED CODE ###

H,W=map(int,input().split())
S=[input().split() for i in range(H)]
columns="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
for h in range(H):
    for w in range(W):
        if S[h][w]=="snuke":
            print(columns[w]+str(h+1))
#ABC042.B
N,L = map(int,input().split())
s = [input()for_in range(N)]
s.sort()
ans=''
for i in range(N):
    ans += s[i]
print(ans)

### FIXED CODE ###

#ABC042.B
N,L = map(int,input().split())
s = [input()for _ in range(N)]
s.sort()
ans=''
for i in range(N):
    ans =ans +s[i]
print(ans)
N,M=map(int,input().split())
ac=[0]*N
wa=[0]*N

for i in range(M):
  p,s=input().split()
  if s=="WA" and ac[int(p)-1]==0:
    wa[int(p)-1]+=1
  elif s=="AC" and ac[int(p)-1]==0:
    ac[int(p)-1]+=1

penalty=[w[k] for k in [i for i,j in enumerate(ac) if j!=0]]    
print("%d %d" %(sum(ac),sum(penalty)))


### FIXED CODE ###

N,M=map(int,input().split())
ac=[0]*N
wa=[0]*N

for i in range(M):
  p,s=input().split()
  if s=="WA" and ac[int(p)-1]==0:
    wa[int(p)-1]+=1
  elif s=="AC" and ac[int(p)-1]==0:
    ac[int(p)-1]+=1

penalty=[wa[k] for k in [i for i,j in enumerate(ac) if j!=0]]    
print("%d %d" % (sum(ac),sum(penalty)))
class SegmentTree:
    def __init__(self, n):
        n_ = 1
        while n_ < n: n_ *= 2
        self.n = n_
        self.data = [[0, -n_] for i in xrange(2*n_)]

    def add(self, k, a):
        idx = k + (self.n-1)
        data = self.data
        data[idx] = [data[idx][0] + a, -k]
        print data, idx, data[idx]
        while idx:
            idx = (idx - 1) / 2
            data[idx] = max(data[2*idx+1], data[2*idx+2])
            print idx, data[idx]

    def get(self):
        return self.data[0]

inputs = lambda: map(int, raw_input().split())
n, q = inputs()
st = SegmentTree(n)
for t in xrange(q):
    a, v = inputs()
    st.add(a, v)

    p, q = st.get()
    print -q, p

### FIXED CODE ###

from heapq import heappush, heappop
inputs = lambda: map(int, raw_input().split())
n, q = inputs()
n += 1
que = [(0, 1, -1)]
data = [0] * n
T = [-1] * n
for t in xrange(q):
    a, v = inputs()
    data[a] += v
    T[a] = t

    heappush(que, (-data[a], a, t))
    v, k, p = que[0]
    while T[k]!=p:
        heappop(que)
        v, k, p = que[0]
    print k, -v
a, b = map(int, input().split())
if a + b > 24:
	print (a+b - 24)
else:
	print (a+b)

### FIXED CODE ###

a = list(map(str, input().split()))
print ("A" + a[1][0] + "C")
def visit_tree(now, num):
    if not visited[now]:
        visited[now] = num
        if len(tree[now]) == 0:
            return 0
        for i in range(len(tree[now])):
            visit_tree(tree[now][i], num)

n, m = map(int, input().split())
tree = [[] for _ in range(n)]
for i in range(m):
    x, y, z = map(int, input().split())
    tree[x - 1].append(y - 1)
    tree[y - 1].append(x - 1)

visited = [0 for _ in range(n)]
num = 0
for i in range(n):
    if not visited[i]:
        num += 1
        visit_tree(i, num)

print(num)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10000000)

def visit_tree(now, num):
    visited[now] = num
    for i in range(len(tree[now])):
        if not visited[tree[now][i]]:
            visit_tree(tree[now][i], num)

n, m = map(int, input().split())
tree = [[] for _ in range(n)]
for i in range(m):
    x, y, z = map(int, input().split())
    tree[x - 1].append(y - 1)
    tree[y - 1].append(x - 1)

visited = [0 for _ in range(n)]
num = 0
for i in range(n):
    if not visited[i]:
        num += 1
        visit_tree(i, num)

print(num)
import sys
import numpy as np
from math import ceil
from collections import defaultdict as D

def S(): return sys.stdin.readline().rstrip().split(' ')
def Ss(): return list(S())
def I(): return _I(Ss())
def Is(): return list(I())
def _I(ss): return map(int, ss) if len(ss) > 1 else int(ss[0])

N, K = I()
xs = sorted(Is())
print(np.sum(xs[:K]))

### FIXED CODE ###

import sys
import numpy as np
from math import ceil as C, floor as F
from collections import defaultdict as D
from functools import reduce as R

ALP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
alp = 'abcdefghijklmnopqrstuvwxyz'
def _X(): return sys.stdin.readline().rstrip().split(' ')
def _S(ss): return tuple(ss) if len(ss) > 1 else ss[0]
def S(): return _S(_X())
def _Ss(ss): return list(ss) if isinstance(ss, tuple) else [ss]
def Ss(): return _Ss(S())
def _I(ss): return tuple([int(s) for s in ss]) if isinstance(ss, tuple) else int(ss)
def I(): return _I(S())
def _Is(ss): return list(ss) if isinstance(ss, tuple) else [ss]
def Is(): return _Is(I())

N, K = I()
xs = sorted(Is())
print(np.sum(xs[:K]))
n, m = map(int, input().split())
p = 2 ** n
inf = 10 ** 9
dp = [inf] * p
dp[0] = 0
for i in range(m):
  a, b = map(int, input().split())
  c = sum([2 ** (j - 1) for j in list(input().split())])
  for k in range(p):
    if dp[k|c] > dp[k] + a:
      dp[k|c] = dp[k] + a
      
if dp[-1] == inf:
  print(-1)
else:
  print(dp[-1])

### FIXED CODE ###

n, m = map(int, input().split())
p = 1 << n
dp = [float('inf')] * p
dp[0] = 0
for i in range(m):
  a, b = map(int, input().split())
  c = sum([1 << j - 1 for j in list(map(int, input().split()))])
  for k in range(p):
    if dp[k|c] > dp[k] + a:
      dp[k|c] = dp[k] + a
      
if dp[-1] == float('inf'):
  print(-1)
else:
  print(dp[-1])
N = int(input())
list =[]
for i in range(0, N):
  list = list.append(int(input()))
  
S = sum(list) - max(list)/2
print(S)

### FIXED CODE ###

N = int(input())
list = [int(input())for _ in range(N)]
print(round(sum(list) - max(list)/2))
import math

nd = input().strip().split()
n = nd[0]
d = nd[1]

inspectors = math.ceil(n / (2 * d + 1))
print(inspectors)

### FIXED CODE ###

import math

nd = [int(x) for x in input().strip().split()]
n = nd[0]
d = nd[1]

inspectors = math.ceil(n / (2 * d + 1))
print(inspectors)
n, k = input().split()
n, k = int(n), int(k)

s = input()

s1 = s[:k - 1]
s3 = s[:k - 2]
s2 = s[k:]

if s[k - 1] =='A':
  s3.append('a')
  print(s3 + s2)
elif s[k - 1] == 'B':
  s3.append('b')
  print(s3 + s2)
elif s[k - 1] == 'C':
  print(s3 + s2)

### FIXED CODE ###

n,k=map(int, input().split())
S=input()
s=S.lower()
print(S[:k-1]+s[k-1]+S[k:])
N = int(input())
a = list(map(int,input().split(" ")))

a.sort(reverse=True)

al = 0
bo = 0
for i in range(0,N,2):
	al += a[i]
	bo += a[i+1]

print(al-bo)


### FIXED CODE ###

N = int(input())
a = list(map(int,input().split(" ")))

a.sort(reverse=True)

al = 0
bo = 0

if N % 2 == 1:
	N -= 1
	al += a[-1]

for i in range(0,N,2):
	al += a[i]
	bo += a[i+1]

print(al-bo)
import numpy as np
n = int(input())
init = np.expand_dims(np.array([2, 1]), 0)
to_next = np.array([
    [1, 1],
    [1, 2],
])
for i in range(n // 2):
    init = init @ to_next
print(init[0][n & 1])


### FIXED CODE ###

import numpy as np
n = int(input())
init = np.expand_dims(np.array([2, 1]), 0)
to_next = np.array([
    [1, 1],
    [1, 2],
])
for i in range(n // 2):
    init = init.dot(to_next)
print(init[0][n & 1])
n = int(input())
hs = map(int, input().split())
count = 1
maxh = 0
for i in range(1,n):
	maxh = max(maxh, hs[i-1])
	if hs[i]>maxh:
		count += 1
print(count)

### FIXED CODE ###

n = int(input())
hs = input().split()
count = 1
maxh = 0
for i in range(1,n):
    maxh = max(maxh, int(hs[i-1]))
    if int(hs[i])>=maxh:
        count += 1
print(count)
#105b
n=int(input())
x = n//4
if n%4==0 or n%11==0:
    print('Yes')
    exit()
else:
    for i in range(x):
        for j in range(x):
            temp=4*i+7*j
            if temp==n:
                print('Yes')
                exit()
print('No')

### FIXED CODE ###

n,k=map(int,input().split())
print(0 if n%k==0 else 1)
#c
n,m = map(int,input().split())
a=[]
for i in range(m):
    a.append(int(input()) )
mod=10**9 + 7

def cmb(n, r, mod,g1,g2):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

def nCrMOD(n,r,m):
    g1 = [1, 1]
    g2 = [1, 1]
    inverse = [0, 1]
    for i in range( 2, n + 1 ):
        g1.append( ( g1[-1] * i ) % mod )
        inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
        g2.append( (g2[-1] * inverse[-1]) % mod )
    return cmb(n,r,mod,g1,g2)


c=0
for i in range(m-1):
    if a[i]==a[i+1]-1: c+=1
if c!=0:
    print(0)
else:
    b=[a[0]-1] + [a[j+1]-a[j]-2 for j in range(m-1)] + [n-a[-1]-1]
cc=[ sum( nCrMOD(bb-i,i,mod) for i in range((bb)//2+1) )%mod for bb in b ]

ans=1
for ccc in cc:
    ans = ans*ccc%mod
print(ans)

### FIXED CODE ###

#c dp version
n,m = map(int,input().split())
a=[]
for i in range(m):
    a.append(int(input()) )
from collections import deque
a=deque(a)
mod=10**9 + 7

dp=[0]*(n+2)
dp[0]=0
dp[1]=1
aa=0
if len(a)>0:
    aa=a.popleft()
for i in range(2,n+2):
    if i-1 == aa:
        dp[i]=0
        if len(a)>0:
            aa=a.popleft()
    else:
        dp[i]=( dp[i-1]+dp[i-2] )%mod
print(dp[-1])
max_sum_i = int(str(n)[0]) * 10**(len(str(n))-1) -1
max_sum = sum([int(i) for i in str(max_sum_i)])

print(max_sum)

### FIXED CODE ###

n = int(input())

def digit_sum_simple(n):
    
    max_sum = -1

    for i in range(10**(len(str(n))-1)-1, n+1):
        
        i_parts = []
        for i_part in str(i):
            i_parts.append(int(i_part))

        this_sum = sum(i_parts)
        
        if max_sum < this_sum:
            max_sum = this_sum
            max_sum_i = i

    return max_sum, max_sum_i

def digit_sum_temp(n):
    max_sum_i = int(str(int(str(n+1)[0])-1) + "9"*(len(str(n+1))-1))
    max_sum = sum([int(j) for j in str(max_sum_i)])

    return max_sum

print(digit_sum_temp(n))
import itertools
n, m, q = map(int, input().split(" "))
asset = []
for i in range(q):
    asset.append(list(map(int, input().split(" "))))
A = []


max = 0
for a in itertools.product(list(range(1, m + 1)), repeat = n):
    A.append((list(a)))
for i in range(len(A)):
    total = 0
    for j in range(0, n):
        if A[j] <= A[j - 1]:
            continue
    for j in range(q):
        if A[i][asset[j][1] - 1] - A[i][asset[j][0] - 1] == asset[j][2]:
            total += asset[j][3]
    max = total if total > max else max
print(max)

### FIXED CODE ###

import itertools

n,m,q = map(int, input().split(" "))
a,b,c,d = [],[],[],[]
for i in range(q):
  inpu = input()
  a.append((int)(inpu.split(" ")[0]))
  b.append((int)(inpu.split(" ")[1]))
  c.append((int)(inpu.split(" ")[2]))
  d.append((int)(inpu.split(" ")[3]))

balls = list(itertools.combinations_with_replacement(range(1, m + 1), n))
#print(balls)
max = 0
for i in range(len(balls)):
  temp = 0
  for j in range(q):
    if balls[i][b[j] - 1] - balls[i][a[j] - 1] == c[j]:
      temp += d[j]
  if temp > max:
    max = temp
print(max)
A,B= input().split()

if(A>=9 or b>=9):
    print(":(")
else:
    print("Yay!")

### FIXED CODE ###


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

if(A>=9 or B>=9):
    print(":(")
else:
    print("Yay!")
from itertools import accumulate
n,k = map(int,input().split())
a = list(map(int,input().split()))
a.sort()
acc = list(accumulate(a))

def maxsum(ls,k):
  l = len(ls)
  if l==0:
    return 0
  dp = [0 for i in range(l+1)]
  dp[0] = 1
  for i in range(1,l+1):
    dp[i] = (dp[i-1]|(dp[i-1]<<ls[i-1]))&1<<k
  for b in range(k-1,-1,-1):
    if dp[l] & 1<<b:
      return b

for i in range(n):
  if a[i]>=k:
    a = a[:i]
    break
n = len(a)
if acc[n-1] < k:
  print(n)
  exit()
sepa=[]
for i in range(n-1):
  if acc[i]<a[i+1]:
    sepa.append(i)
m=len(sepa)
if m==0:
  print(0)
  exit()
lf = 0
r = m-1
while lf<r:
  mid = (lf+r)//2
  x=sepa[mid]
  sumx = acc[x]
  if maxsum(a[x+1:],k)+sumx >= k:
    r = mid
  else:
    lf = mid+1
if r==0:
  t=sepa[0]
  if maxsum(a[t+1:],k)+acc[t]>=k:
    print(0)
  else:
    print(sepa[r]+1)
else:
  print(sepa[r]+1)

### FIXED CODE ###

from itertools import accumulate
n,k = map(int,input().split())
a = list(map(int,input().split()))
a.sort()
acc = list(accumulate(a))

def maxsum(ls,k):
  l = len(ls)
  if l==0:
    return 0
  dp = [0 for i in range(l+1)]
  dp[0] = 1
  for i in range(1,l+1):
    dp[i] = (dp[i-1]|(dp[i-1]<<ls[i-1]))&((1<<k)-1)
  for b in range(k-1,-1,-1):
    if dp[l] & 1<<b:
      return b

for i in range(n):
  if a[i]>=k:
    a = a[:i]
    break
n = len(a)
if acc[n-1] < k:
  print(n)
  exit()
sepa=[]
for i in range(n-1):
  if acc[i]<a[i+1]:
    sepa.append(i)
m=len(sepa)
if m==0:
  print(0)
  exit()
lf = 0
r = m-1
while lf<r:
  mid = (lf+r)//2
  x=sepa[mid]
  sumx = acc[x]
  if maxsum(a[x+1:],k)+sumx >= k:
    r = mid
  else:
    lf = mid+1
if r==0:
  t=sepa[0]
  if maxsum(a[t+1:],k)+acc[t]>=k:
    print(0)
  else:
    print(sepa[r]+1)
else:
  print(sepa[r]+1)
-*- coding: utf-8 -*-
 
import math
 
l = raw_input().split()
print(math.ceil(l[0] + l[1])

### FIXED CODE ###

# -*- coding: utf-8 -*-
 
import math
 
l = list(map(int, input().split()))
print(math.ceil((l[0] + l[1])/2))
a = list(map(input().split()))
a.sort()

print(a[0],a[1],a[2])

### FIXED CODE ###

a = list(map(int,input().split()))
a.sort()

print(a[0],a[1],a[2])
from collections import defaultdict
from collections import deque

def setD(d, N):
    for i in range(N):
        d[i] = setsub(d, i)
            
def setsub(d, i):
    tmp = deque()
    for x in d[i]:
        tmp.append(x)
        if d[x] != 0:
            tmp += setsub(d, x)
    return tmp

N, Q = map(int, input().split())
d = defaultdict(deque)

for i in range(N-1):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    d[a].append(b)

setD(d, N)

ans = [0 for i in range(N)]

for i in range(Q):
    p, x = map(int, input().split())
    p -= 1
    ans[p] += x
    for i in d[p]:
        ans[i] += x


for i in range(N):
    ans[i] = str(ans[i])
print(" ".join(ans))

### FIXED CODE ###

N, Q = map(int, input().split())
d = [0 for i in range(N)]

for i in range(N-1):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    d[b] = a
ans = [0 for i in range(N)]

for i in range(Q):
    p, x = map(int, input().split())
    p -= 1
    ans[p] += x

for i in range(1, N):
    ans[i] += ans[d[i]]

print(*ans)
while(True){
    f = input()
    s = f.split()
    if s[1] == '?':
        break
    print(eval(f))
}


### FIXED CODE ###

while(True):
    f = input()
    s = f.split()
    if(s[1] == '?'):
        break
    if(s[1] == '/'):
        print((int)(s[0]) // (int)(s[2]))
    else:
        print(eval(f))
#include <stdio.h>
int main (void){
    int i;
    char S[20], T[20];
    scanf("%s%s", S, T);
    for(i=0;S[i]!='\0';i++){
        if(S[i]==T[i]){
            printf("Yes\n");
            
        }else printf("No\n");
    return 0;
    }

### FIXED CODE ###

S = input()
T = input()
 
if T[:-1] == S:
    print('Yes')
else:
    print('No')
a,b,c,d=map(int,input().split())
while a,b>0:
  c-=b
  a-=d
if a<=0,b>0:
  print('No')
elif b<=0:
  print('Yes')

### FIXED CODE ###

a,b,c,d=map(int,input().split())
while a>0 and b>0:
  c-=b
  a-=d
if a<=0 and c>0:
  print('No')
elif c<=0:
  print('Yes')
from heapq import*
import sys
r=sys.stdin.readline
def g(n,E,S,G):
 F=[1e7]*-~n;F[S]=0;H=[(0,S)]
 while H:
  c,u=heappop(H)
  if u==G:return c
  for f,v in E[u]:
   t=c+f
   if t<F[v]:F[v]=t;heappush(H,(t,v))
 return-1
def s(n,k):
 E=[[]for _ in[0]*-~n]
 for _ in[0]*k:
  f=r()
  if'0'==f[0]:print(g(n,E,*map(int,f[2:].split())))
  else:c=[*map(int,f[2:].split())];E[c]+=[[e,d]];E[d]+=[[e,c]]
for e in iter(r,'0 0\n'):s(*map(int,e.split()))


### FIXED CODE ###

def s():
 import sys
 r=sys.stdin.readline
 I=float('inf')
 for e in iter(r,'0 0\n'):
  n,k=map(int,e.split())
  F=[[I]*-~n for _ in[0]*-~n]
  for i in range(1,n+1):F[i][i]=0
  for _ in[0]*k:
   f=r();g=map(int,f[2:].split())
   if'0'==f[0]:a,b=g;A=F[a][b];print([A,-1][A==I])
   else:
    c,d,e=g
    if e<F[c][d]:
     for i in range(2,n+1):
      for j in range(1,i):
       F[i][j]=F[j][i]=min(F[i][j],F[i][c]+e+F[d][j],F[i][d]+e+F[c][j])
s()
inf = 1e18

N = int(raw_input())
HP = sorted(sorted([map(int, raw_input().split()) for i in xrange(N)]), key = lambda x:x[1])
dp =[inf] * 5005

for i in xrange(N):
    H, P = HP[i]
    for j in xrange(N + 1, -1, -1):
        if dp[j] < inf and dp[j] <= H:
            dp[j + 1] = min(dp[j + 1], dp[j] + P)
    dp[1] = min(dp[1], P)

ans = max(i for i in xrange(N + 1) if dp[i] < inf)

print ans


### FIXED CODE ###

S = raw_input()
if "HA" not in S and "H" in S:
    S = S.replace("H", "HA")
if "BA" not in S and "B" in S:
    S = S.replace("B", "BA")
if "RA" not in S and "R" in S:
    S = S.replace("R", "RA")
if S[0] != "A":
    S = "A" + S
if S == "AKIHABARA":
    print "YES"
else:
    print "NO"
import sys
def input():
    return sys.stdin.readline()[:-1]
H,W = map(int,input().split(' '))
A = W//2+1
if W==1 or H==1:
    print(1)
    exit()
if H%2==0:
    print(W*H//2)
else:
    print(W*(H-1)//2+A)

### FIXED CODE ###

import sys
def input():
    return sys.stdin.readline()[:-1]
S = "1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51"
L = S.split(', ')
N = int(input())
print(L[N-1])
#https://atcoder.jp/contests/abc075/tasks/abc075_b?lang=ja
H, W = map(int, input().split())
s = [list(input()) for _ in range(H)]
for i in range(H):
    for j in range(W):
        count = 0
        if s[i][j] == ".":
            if i > 0 and j > 0 and s[i-1][j-1] == "#": #
                count +=1
            if i > 0 and s[i-1][j]=="#": #上
                count +=1
            if i > 0 and j <W-1 and s[i-1][j+1] =="#": #
                count +=1  
            if j < W-1 and s[i][i+1] =="#": #右
                count +=1
            if i < H-1 and j<W-1 and s[i+1][j+1] =="#":
                count +=1
            if i < H-1 and s[i+1][j] =="#": #下
                count +=1
            if i<H-1 and j<0 and s[i+1][j-1] =="#":
                count +=1
            if j > 0 and s[i][j-1] == "#":   #左
                count +=1
            s[i][j] = str(count)         
        else:
            pass
for i in range(H):
    print("".join(s[i]))
    

### FIXED CODE ###

#https://atcoder.jp/contests/abc075/tasks/abc075_b?lang=ja
H, W = map(int, input().split())
s = [list(input()) for _ in range(H)]
for i in range(H):
    for j in range(W):
        count = 0
        if s[i][j] == "#":
            pass
        else:
            if i > 0 and j > 0 and s[i-1][j-1] == "#": #左上
                count +=1
            if i > 0 and s[i-1][j]=="#": #上
                count +=1
            if i > 0 and j <W-1 and s[i-1][j+1] =="#": #右上
                count +=1  
            if j < W-1 and s[i][j+1] =="#": #右
                count +=1
            if i < H-1 and j<W-1 and s[i+1][j+1] =="#": #右下
                count +=1
            if i < H-1 and s[i+1][j] =="#": #下
                count +=1
            if i<H-1 and j>0 and s[i+1][j-1] =="#":  #左下
                count +=1
            if j > 0 and s[i][j-1] == "#":   #左
                count +=1
            s[i][j] = str(count)         
for i in range(H):
    print("".join(s[i]))
import sys
input = sys.stdin.readline

A,B,C,D=list(map(int,input().split()))
if A+B == C+D:
    print('Balanced')
elif A+B ＞ C+D:
    print('Left')
else:
    print('Right')


### FIXED CODE ###

import sys
input = sys.stdin.readline

A,B,C,D=list(map(int,input().split()))
if A+B == C+D:
    print('Balanced')
elif A+B > C+D:
    print('Left')
else:
    print('Right')
def resolve():
    N = int(input())
    x = int(N // 1.08)
    if math.floor(x * 1.08) == N:
        print(x)
    elif math.floor((x + 1) * 1.08) == N:
        print(x + 1)
    else:
        print(":(")


if __name__ == "__main__":
    resolve()

### FIXED CODE ###

import math


def resolve():
    N = int(input())
    x = int(N // 1.08)
    if math.floor(x * 1.08) == N:
        print(x)
    elif math.floor((x + 1) * 1.08) == N:
        print(x + 1)
    else:
        print(":(")


if __name__ == "__main__":
    resolve()
import sys
S = input()

def isKaibun(txt, n):
    for i in range(n):
        if txt[i] == txt[-(i+1)]:
            continue
        else:
            print("No")
            sys.exit(-1)
    return 0

l = len(S)
isKaibun(S, l//2)

l_b = (l-1)//2 
isKaibun(S[:l_b], l_b//2)

l_a = (l+3)//2
isKaibun(S[l_a-1:], (l-l_a)//2)

print("Yes")

### FIXED CODE ###

import sys
S = input()

def isKaibun(txt, n):
    for i in range(n):
        if txt[i] == txt[-(i+1)]:
            continue
        else:
            print("No")
            sys.exit()
    return 0

l = len(S)
isKaibun(S, l//2)

l_b = (l-1)//2 
isKaibun(S[:l_b], l_b//2)

l_a = (l+3)//2
isKaibun(S[l_a-1:], (l-l_a)//2)

print("Yes")
S, T = input().split()
A, B = map(int, input().split())
U = input()
print(A-1, B if s==T else A, B-1)

### FIXED CODE ###

S, T = input().split()
A, B = map(int, input().split())
U = input()
print(A-1, B) if S==U else print(A, B-1)
N = int(input())
if 9 in N:
  print("YES")
else:
  print("NO")


### FIXED CODE ###

N = input()
if "9" in N:
  print("Yes")
else:
  print("No")
H = int(input())
K = int(input())
cnt=0
while(H>0):
  H=H-K
  cnt=cnt+1

print(cnt)

### FIXED CODE ###

import sys

for line in sys.stdin:
    l= line.split()
    H=int(l[0])
    A=int(l[1])
    i = 0
    while(H>0):
        H-=A
        i+=1
    print(i)