Harryxun/stf_run huggingface dataset:
h,w = map(int, input().split())
board = [list(input()) for i in range(h)]

road = []

for i in range(h):
    for j in range(w):
        if board[i][j] == ".":
            road.append([i,j])

from heapq import heappop, heappush

def dfs(start, end):
    dxdy = [(0,1),(1,0),(0,-1),(-1,0)]
    dist = [[float("inf")]*w for i in range(h)]
    heap = [(0, *start)]
    while heap:
        c,x,y = heappop(heap)
        if dist[x][y] <= c:
            continue
        dist[x][y] = c
        for dx, dy in dxdy:
            nx = x + dx
            ny = y + dy
            if 0<=nx<h and 0<=ny<w and board[nx][ny] == ".":
                heappush(heap, (c+1, nx, ny))
    return dist[end[0]][end[1]]


from itertools import combinations

ans = 0
for start, end in combinations(road, 2):
    #print(start, end)
    tmp = dfs(start, end)
    if tmp != float("inf"):
        ans = max(ans, tmp)
print(ans)

### FIXED CODE ###

import sys
reader = (s.rstrip() for s in sys.stdin)
input = reader.__next__

from heapq import heappop, heappush

dxdy = [(0,1),(1,0),(0,-1),(-1,0)]

h,w = map(int, input().split())
board = [list(input()) for i in range(h)]

def dfs(x, y):
    dist = [[float("inf")]*w for i in range(h)]
    heap = [(0, x, y)]
    while heap:
        c,x,y = heappop(heap)
        if dist[x][y] <= c:
            continue
        dist[x][y] = c
        for dx, dy in dxdy:
            nx = x + dx
            ny = y + dy
            if 0<=nx<h and 0<=ny<w and board[nx][ny] == "." and dist[nx][ny] > c+1:
                heappush(heap, (c+1, nx, ny))
    ret = 0
    for i in range(h):
        for j in range(w):
            if dist[i][j] != float("inf"):
                ret = max(ret, dist[i][j])
    return ret

ans = 0
for i in range(h):
    for j in range(w):
        if board[i][j] == ".":
            ans = max(ans, dfs(i,j))

print(ans)
import sys
stdin = sys.stdin

sys.setrecursionlimit(10**5)

def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

def light_length(a:int, b:int) -> int:
    if a == b:
        return a
    
    if a > b:
        a,b = b,a

    return 2*a + light_length(min(a,b-a), max(a,b-a))

n,x = li()

print(n + light_length(x,n-x))  

### FIXED CODE ###

import sys
stdin = sys.stdin

sys.setrecursionlimit(10**5)

def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

def light_length(a:int, b:int) -> int:
    if a > b:
        a,b = b,a
    
    if b%a == 0:
        return 2 * a * (b//a) - a

    return 2 * (b//a) * a + light_length(a, b%a)

n,x = li()

print(n + light_length(x,n-x))
print(max([max(i**j for j in range(10) if i**j<=x) for i in range(x)] for x in range(int(input())**0.5+1)))

### FIXED CODE ###

x,ans=int(input()),1
for i in range(int(x**0.5)+1):
  ans = max(ans, max(i**j for j in range(10) if i**j<=x))
print(ans)
from decimal import *

getcontext().prec = 1000000000
a,b,c =map(int,input().split())
d=math.sqrt(a)
e=math.sqrt(b)
f=math.sqrt(c)
h= d+e
if h<f:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

a,b,c = map(int, input().split())
s =c-a-b
t = s**2 - 4*a*b
if s >=0 and t > 0:
    print('Yes')
else:
    print('No')
N, L = map(int, input().split())

char_list= []
for dummy in range(N):
    char_list.append(str(input())

answer = ""
for char in sorted(char_list):
    answer += char

print(answer)

### FIXED CODE ###

N, L = map(int, input().split())

char_list = []

for dummy in range(N):
    S = str(input())
    char_list.append(S)

char_list = sorted(char_list)
answer = ""
for char in char_list:
    answer += char

print(answer)
n,m=map(int,input().split())
ans=[0]*n
buf=0
for i in range(m):
    s,c=map(int,input().split())
    if ans[s-1]==0:
        ans[s-1]+=c
    elif ans[s-1]!=0 and c!=ans[s-1]:
        buf+=1
if buf==0 and ans[0]!=0:
    anstr=[str(num) for num in ans]
    print(''.join(ans))
elif buf==0 and ans[0]==0:
    print(-1)
else:
    print(-1)

### FIXED CODE ###

import sys
n,m=map(int,input().split())
ans=[0]*n
scash=[]
buf=0
for i in range(m):
    s,c=map(int,input().split())
    if s not in scash:
        ans[s-1]+=c
        scash.append(s)
    elif (s in scash) and c!=ans[s-1]:
        buf+=1
        scash.append(s)
if n==1 and ans[0]==0:
    print(0)
    sys.exit()
if buf==0 and ans[0]!=0:
    anstr=[str(num) for num in ans]
    print(''.join(anstr))
elif buf==0 and (1 not in scash):
    ans[0]+=1
    anstr=[str(num) for num in ans]
    print(''.join(anstr))
else:
    print(-1)
a,b = map(int,input().spilit())

if a > b:
    op = '>'
elif a < b:
    op = '<'
else:
    op = '=='
print("a %s b"%op)


### FIXED CODE ###

a, b = map(int, input().split())
if a < b:
    print("a < b")
elif a > b:
    print("a > b")
else:
    print("a == b")
from collections import Counter
n = int(input())
A = sorted(list(map(int, input().split())))[-1::-1]
c = Counter(A)
ans = 0
for a in A:
    b = (1<<m.bit_length()) - a
    if a == b and c[a] > 1:
        c[a] -= 2
        ans += 1
    elif a != b and c[a] > 0 and c[b] > 0:
        c[a] -= 1
        c[b] -= 1
        ans += 1
print(ans)


### FIXED CODE ###

from collections import Counter
n = int(input())
A = sorted(list(map(int, input().split())))[-1::-1]
c = Counter(A)
ans = 0
for a in A:
    b = (1<<a.bit_length()) - a
    if a == b and c[a] > 1:
        c[a] -= 2
        ans += 1
    elif a != b and c[a] > 0 and c[b] > 0:
        c[a] -= 1
        c[b] -= 1
        ans += 1
print(ans)
import random

S = input()
n = length(S)

i = 1+int(random.random()*(n-3))

print(S[i]+S[i+1]+S[i+2])

### FIXED CODE ###

import random


S = input()
n = len(S)
i = 0+int(random.random()*(n-3))
print(S[i]+S[i+1]+S[i+2])
W,H,x,y,r = input().split()
w = int(W)
H = int(H)
x = int(x)
y = int(y)
r = int(r)
if x + r <= W, y + r <= H:
    print("Yes")
else:
    print("No")


### FIXED CODE ###

w,h,x,y,r = input().split()
w = int(w)
h = int(h)
x = int(x)
y = int(y)
r = int(r)
if x - r >= 0 and y - r >= 0 and x + r <= w and y + r <= h:
    print("Yes")
else:
    print("No")
n, m = map(int, input().split())
aa = list(map(int, input().split()))
from math import gcd
lcm = 1
for a in aa:
    lcm = a * lcm // gcd(a, lcm)
tmp = lcm // 2
print((m // tmp + 1) // 2)

### FIXED CODE ###

from fractions import gcd
n, m = map(int, input().split())
aa = list(map(int, input().split()))


lcm = 1
def p2(m):
    cnt = 0
    n = m
    while 1:
        if n%2 == 0:
            cnt += 1
            n = n//2
        else:
            break
    return cnt
pp = p2(aa[0])
for a in aa:
    lcm = a * lcm // gcd(a, lcm)
    if pp != p2(a):
        lcm = 10 **18
        break
tmp = lcm // 2
print((m // tmp + 1) // 2)
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

N, A, B, C = mapint()
costs = {'A': A, 'B': B, 'C': C}
old_a, old_b = list(input())

if costs[old_a]==0 and costs[old_b]==0:
    print('No')
    exit()
print('Yes')
for _ in range(N-1):
    nx_a, nx_b = list(input())
    if old_a==nx_a or old_a==nx_b:
        print(old_a)
        costs[old_a] += 1
    else:
        print(old_b)
        costs[old_b] += 1
    old_a, old_b = nx_a, nx_b

if not costs[nx_a]:
    print(nx_a)
else:
    print(nx_b)

### FIXED CODE ###

import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

N, A, B, C = mapint()
costs = {'A': A, 'B': B, 'C': C}
old_a, old_b = list(input())

if costs[old_a]==0 and costs[old_b]==0:
    print('No')
    exit()

commands = []
for _ in range(N-1):
    nx_a, nx_b = list(input())
    if costs[old_a]==0 and costs[old_b]==0:
        print('No')
        exit()
    elif costs[old_a]==0:
        costs[old_a] += 1
        costs[old_b] -= 1
        commands.append(old_a)
        
    elif costs[old_b]==0:
        costs[old_b] += 1
        costs[old_a] -= 1
        commands.append(old_b)

    else:
        if old_a==nx_a or old_a==nx_b:
            commands.append(old_a)
            costs[old_a] += 1
            costs[old_b] -= 1
        else:
            commands.append(old_b)
            costs[old_b] += 1
            costs[old_a] -= 1
    old_a, old_b = nx_a, nx_b

if costs[old_a]==0 and costs[old_b]==0:
    print('No')
    exit()
elif costs[old_a]==0:
    costs[old_a] += 1
    costs[old_b] -= 1
    commands.append(old_a)
    
else:
    costs[old_b] += 1
    costs[old_a] -= 1
    commands.append(old_b)

print('Yes')
print('\n'.join(commands))
A=int(input())
B=int(input())
if(A>0 and B%A==0):
  print(B+A)
else:
  print(B-A)
  

### FIXED CODE ###

A,B=map(int,input().split())
if(A>0 and B%A==0):
  print(B+A)
else:
  print(B-A)
A, B = input().split(" ")
A, B = int(A), int(B)

from math import gcd
print(int(A * B / gcd(A, B)))

### FIXED CODE ###

A, B = input().split(" ")
A, B = int(A), int(B)

# from math import gcd
def gcd(a, b):
	if a < b:
	    a, b = b, a
	while a % b != 0:
	    a, b = b, a % b
	return(b)

print(int(A * B / gcd(A, B)))
import sys,queue,math,copy,itertools,bisect,collections,heapq

def main():
    INF = 10**5
    LI = lambda : [int(x) for x in sys.stdin.readline().split()]

    D,G = LI()
    pc = [LI() for _ in range(D)]
    ans = INF
    for p in itertools.permutations([0,1,2,3,4,5,6,7,8,9]):
        g = G
        cnt = 0
        for i in p:
            if g < pc[i][0] * (i+1) * 100:
                cnt += math.ceil(g/((i+1)*100))
                break
            else:
                cnt += pc[i][0]
                g -= pc[i][0] * (i+1) * 100 + pc[i][1]
            if g <= 0: break
        ans = min(ans,cnt)

    print(ans)


if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys,queue,math,copy,itertools,bisect,collections,heapq

def main():
    sys.setrecursionlimit(10**7)
    INF = 10**18
    MOD = 10**9 + 7
    LI = lambda : [int(x) for x in sys.stdin.readline().split()]
    NI = lambda : int(sys.stdin.readline())

    D,G = LI()
    pc = [LI() for _ in range(D)]

    ans = INF
    for p in itertools.permutations(range(D)):
        g = G
        cnt = 0
        for i in p:
            if g < pc[i][0] * (i+1) * 100:
                cnt += math.ceil(g/((i+1)*100))
                break
            else:
                cnt += pc[i][0]
                g -= pc[i][0] * (i+1) * 100 + pc[i][1]
            if g <= 0: break
        ans = min(ans,cnt)

    print(ans)


if __name__ == '__main__':
    main()
L,R = map(int,input().split())

ans = 2019 ** 2

if R - L >= 2018:
  ans = 0
  print(ans)
else: 
  for i in range(L,R):
    for j in range(L + 1,R + 1):
      mod = (i * j) % 2019 
      if mod < ans:
        ans = mod
      elif mod == 0:
        ans = 0
        break
  print(ans)



### FIXED CODE ###

L = list(map(int, input().split()))

N = L[0]
A = L[1]
B = L[2]


train = N * A

if train < B:
	print(train)
	
else:print(B)
num_str = input()
num_str = num_str.split("")

### FIXED CODE ###

num_str = input().split(" ")
S = input()

N = int(num_str[0])
K = int(num_str[1])
s = list(S)

if s[K-1] == "A":
  s[K-1] = "a"
elif s[K-1] == "B":
  s[K-1] = "b"
elif s[K-1] == "C":
  s[K-1] = "c"

S = "".join(s)
print(S)
from sys import stdin, gettrace
 
if not gettrace():
    def input():
        return next(stdin)[:-1]
 
 
# def input():
#    return stdin.buffer.readline()
 
def main():
    n,w=map(int,input().split())
	li=[]
	for i in range(n):
    	temp=[int(x) for x in input().split()]
    	li.append(temp)
	dp=[[[-1,-1] for j in range(w+1)] for i in range(n)]
	dp[n-1][0]=[li[n-1][1],li[n-1][1]]
	for i in range(n-1,-1,-1):
    	for j in range(w,-1,-1):
        	if j==0:
            	dp[i][j]=li[i][1],li[i][1]
        	if i==(n-1):
            	if li[i][0]<=j:
                	dp[i][j]=li[i][1],li[i][1]
            	else:
                	dp[i][j]=0,0
        	else:
            	mx=li[i][1]
            	for k in range(i+1,n):
                	if (j-li[i][0])>=li[k][0]:
                    	val=dp[k][j-li[i][0]]
                    	mx=max(mx,val[0]+li[i][1])
            	val=dp[i+1][j]
            	overall=max(mx,val[1])
            	dp[i][j]=[mx,overall]
	print(dp[0][w][1])
 
 
if __name__ == "__main__":
    main()

### FIXED CODE ###

from sys import stdin, gettrace
import sys
sys.setrecursionlimit(1000000)
if not gettrace():
    def input():
        return next(stdin)[:-1]
 
 
# def input():
#    return stdin.buffer.readline()

def recursion(li,i,n,w,dp):
    if i==n or w==0:
        return 0
    if li[i][0]>w:
        if dp[i+1][w]==-1:
            x=recursion(li,i+1,n,w,dp)
            dp[i+1][w]=x            
        else:
            x=dp[i+1][w]
        return x
    else:
        if dp[i+1][w]==-1:
            x=recursion(li,i+1,n,w,dp)
            dp[i+1][w]=x            
        else:
            x=dp[i+1][w]
        if dp[i+1][w-li[i][0]]==-1:
            y=recursion(li,i+1,n,w-li[i][0],dp)
            dp[i+1][w-li[i][0]]=y
        else:
            y=dp[i+1][w-li[i][0]]            
        return max(li[i][1]+y,x)

def main():
    n,w=[int(x) for x in input().split()]
    li=[]
    for i in range(n):
        temp=[int(x) for x in input().split()]
        li.append(temp)
    dp=[[-1 for j in range(w+1)] for i in range(n+1)]
    print(recursion(li,0,n,w,dp))
 
 
if __name__ == "__main__":
    main()
import sys
input=sys.stdin.readline

def main():
    r,c,k=map(int,input().split())
    dp=[[[0 for jj in range(c+1)] for ii in range(r+1)] for kk in range(4)]

    g=[[0 for j in range(c)] for i in range(r)]
    for i in range(k):
        rr,cc,v=map(int,input().split())
        rr-=1
        cc-=1
        g[rr][cc]=v
    for j in range(1,r+1):
        for k in range(1,c+1):
            for i in range(4):
                dp[i][j][k]=max(dp[i][j][k],dp[i][j-1][k])#,dp[i][j-1][k])
                dp[i][j][0]=max(dp[i][j][0],dp[i-1][j][k])
                if g[i-1][j-1]>0:
                    if k>0:
                        if dp[i][j][k]<dp[i][j-1][k-1]+g[i-1][j-1]:
                            dp[i][j][k]=dp[i][j-1][k-1]+g[i-1][j-1]
                    if dp[i][j][1]<dp[i-1][j][k]+g[i-1][j-1]:
                        dp[i][j][1]=dp[i-1][j][k]+g[i-1][j-1]
    print(max(dp[0][r][c],dp[1][r][c],dp[2][r][c],dp[3][r][c]))
if __name__=='__main__':
    main()



### FIXED CODE ###

import sys
input=sys.stdin.readline

def main():
    r,c,k=map(int,input().split())
    dp=[[[0 for jj in range(c+1)] for ii in range(r+1)] for kk in range(4)]

    g=[[0 for j in range(c)] for i in range(r)]
    for i in range(k):
        rr,cc,v=map(int,input().split())
        rr-=1
        cc-=1
        g[rr][cc]=v
    for i in range(1,r+1):
        for j in range(1,c+1):
            for k in range(4):
                dp[k][i][j]=max(dp[k][i][j],dp[k][i][j-1])#,dp[i][j-1][k])
                dp[0][i][j]=max(dp[0][i][j],dp[k][i-1][j])
                if g[i-1][j-1]>0:
                    if k>0:
                        if dp[k][i][j]<dp[k-1][i][j-1]+g[i-1][j-1]:
                            dp[k][i][j]=dp[k-1][i][j-1]+g[i-1][j-1]
                    if dp[1][i][j]<dp[k][i-1][j]+g[i-1][j-1]:
                        dp[1][i][j]=dp[k][i-1][j]+g[i-1][j-1]
    print(max(dp[0][r][c],dp[1][r][c],dp[2][r][c],dp[3][r][c]))
if __name__=='__main__':
    main()
import math


n = int(input())
print(111 * math.ceil(n / 111)
      

### FIXED CODE ###

import math


n = int(input())
print(111 * math.ceil(n / 111))
h,w=map(int,input().split())
A=[list(map(int,input().split())) for _ in range(h)]

C=[]
for i in range(h):
    flag=1 if i%2==0 else -1
    for j in range(w)[::flag]:
        if A[i][j]%2==1:
            if 0<=j+flag<w:
                C.append([i,j,i,j+flag])
                A[i][j+flag] +=1
            else:
                C.append([i,j,i+1,j])
                A[i+1][j] +=1
print(len(C))
for i in C:print(*i)

### FIXED CODE ###

h,w=map(int,input().split())
A=[list(map(int,input().split())) for _ in range(h)]

C=[]
for i in range(h):
    flag=1 if i%2==0 else -1
    for j in range(w)[::flag]:
        if A[i][j]%2==1:
            if 0<=j+flag<w:
                C.append([i+1,j+1,i+1,j+flag+1])
                A[i][j+flag] +=1
            elif 0<=i+1<h:
                C.append([i+1,j+1,i+2,j+1])
                A[i+1][j] +=1

print(len(C))
for i in C:print(*i)
n,a,b,c=map(int,input().split())
l=[]
for i in range(n):
  l.append(int(input()))
list2=[]
s=0
for i in range(4):
  list=[0,0,0,0]
  list[i]+=l[0]
  if i!=3:
    s+=10
  for j in range(4):
    list[j]+=l[1]
    if j!=3:
      s+=10
      for o in range(4):
        list[o]+=l[2]
        if o!=3:
          s+=10
          for p in range(4):
            list[p]+=l[3]
            if p!=3:
              s+=10
              for u in range(4):
                list[u]+=l[4]
                if u!=3:
                  s+=10                 
                  for t in range(4):
                    list[t]+=l[5]
                    if t!=3:
                      s+=10
                      for r in range(4):
                        list[r]+=l[6]
                        if r!=3:
                          s+=10
                          for q in range(4):
                            list[q]+=l[7]
                            if q!=3:
                              s+=10
                            if list[0]==0 or list[1]==0 or list[2]==0:
                              pass
                            else:
                              list2.append(abs(a-list[0])+abs(b-list[1])+abs(c-list[2]))
print(min(list2))
                        
                      

  

  
  


           

### FIXED CODE ###

n,x,y,z=map(int,input().split())
l=[]
cmin=1000000000
for i in range(n):
  l.append(int(input()))
for i in range(4**n):
  l1=[]
  for j in range(n):
    if i>=4:
      l1.append(i%4)
      i=(i//4)
    elif i!=0:
      l1.append(i)
      i=0
    else:
      l1.append(i)
  c1=0
  c2=0
  c3=0
  d1=0
  d2=0
  d3=0
  l1=l1[::-1]
  for j in range(n):
    if l1[j]==0:
      pass
    elif l1[j]==1:
      c1+=l[j]
      d1+=1
    elif l1[j]==2:
      c2+=l[j]
      d2+=1
    else:
      c3+=l[j]
      d3+=1
  if c1*c2*c3!=0:
    c=abs(c1-x)+abs(c2-y)+abs(c3-z)+(d1+d2+d3-3)*10
    if c<=cmin:
      cmin=c
print(cmin)
n, y = map(int, input().split())

for a in range(n+1):
    for b in range(n+1):
        for c in range(n+1):
            
            if(a+b+c==n and 1000*a + 5000*b + 10000*c == 45000):
                result = str(c) + " " + str(b) + " " + str(a)

print(result)

### FIXED CODE ###

N, Y = map(int, input().split())
break_flag = False

for i in range(N + 1):
    
    for j in range(i, N + 1):
        a, b, c = i, j - i, N - j
        
        if(10000 * a + 5000 * b + 1000 * c == Y):
            print(a, b, c)
            
            break_flag = True
            break
    
    if break_flag: break

if not break_flag: print('-1 -1 -1')
while 1:
    h,w = map(int, input().split())
    if h==w==0:break
    for y in range(1,h+1):
        for x in range(1,w+1):
        if ((x+y)%2)==0:prnt('#',end())
        else print('.',end())
    print('\n')

### FIXED CODE ###

while 1:
    h,w = map(int, input().split())
    if h==w==0:break
    for y in range(h):
        for x in range(w):
            if (x+y)%2==0:print('#',end='')
            if (x+y)%2==1: print('.',end='')
        print()
    print()
S = input()

N=len(S)
flag=1

for i in range(N//2):
  if S[i*2]=='L':
    flag=0
  if S[i*2+1]=='R':
    flag=0

if S[(i+1)*2]=='L':
  flag=0

if flag==1 :
  print('Yes')
else:
  print('No')
    
    
  

### FIXED CODE ###

S = input()

N=len(S)
flag=1

for i in range(N):
  if i%2==0 and S[i]=='L':
    flag=0
  elif i%2==1 and S[i]=='R':
    flag=0

print('Yes' if flag==1 else 'No')
from itertools import accumulate

N, M, K = map(int, input().split())
*A, = map(int, input().split())
*B, = map(int, input().split())
cumsum_A, cumsum_B = [0] + list(accumulate(A)), [0] + list(accumulate(B))
ans = 0
j = M
for i in range(N+1):
    if cumsum_A[i] > K: break
    while cumsum_A[i] + cumsum_B[j] >= K: j -= 1
    ans = max(ans, i + j)
print(ans)

### FIXED CODE ###

from itertools import accumulate

N, M, K = map(int, input().split())
*A, = map(int, input().split())
*B, = map(int, input().split())
cumsum_A, cumsum_B = [0] + list(accumulate(A)), [0] + list(accumulate(B))
ans = 0
j = M
for i in range(N+1):
    if cumsum_A[i] > K: break
    while cumsum_A[i] + cumsum_B[j] > K: j -= 1
    ans = max(ans, i + j)
print(ans)
if X>=30:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

X=int(input())

if X>=30:
  print("Yes")
else:
  print("No")
s = string(input())
counter = 0

for i in range(3):
  if s[i]==1:
    counter+=1
print(counter)

### FIXED CODE ###

S = int(input())
c = 0

if S%10 == 1:
  c += 1
if S//100 == 1:
  c += 1
if (S//10)%10 == 1:
  c += 1
print(c)
n,k=map(int,input().split())
stack=[0]*(2*10**5+1)
a=list(map(int,input().split()))
num=len(set(a))
for i in a:
  stack[a]+=1
stack.sort()
def binarysearch():
  ng=-1
  ok=2*10**5+1
  while abs(ng-ok)>1:
    mid=(ng+ok)//2
    if stack[mid]==0:
      ng=mid
    else:
      ok=mid
  return ok
p=binarysearch()
ans=0
if num<=k:
  print(0)
  exit()
for i in range(num-k):
  ans+=stack[p+i]
print(ans)
  

### FIXED CODE ###

n,k=map(int,input().split())
stack=[0]*(2*10**5+1)
a=list(map(int,input().split()))
num=len(set(a))
for i in a:
  stack[i]+=1
stack.sort()
def binarysearch():
  ng=-1
  ok=2*10**5+1
  while abs(ng-ok)>1:
    mid=(ng+ok)//2
    if stack[mid]==0:
      ng=mid
    else:
      ok=mid
  return ok
p=binarysearch()
ans=0
if num<=k:
  print(0)
  exit()
for i in range(num-k):
  ans+=stack[p+i]
print(ans)
a,b=map(int,input().split())
if a+b<24:
  print(a+b)
  else:
    print((a+b)%24)

### FIXED CODE ###

a,b=map(int,input().split())
if a+b<24:
  print(a+b)
else:
  print((a+b)%24)