Harryxun/stf_run huggingface dataset:
import datetime

d0 = datetime.date(2019, 4, 30)
d = datetime.date(map(int, *input().split('/')))

if d <= d0:
  print('Heisei')
else:
  print('TBD')

### FIXED CODE ###

import datetime
 
d0 = datetime.date(2019, 4, 30)
d = datetime.date(*map(int, input().split('/')))
 
if d <= d0:
  print('Heisei')
else:
  print('TBD')
import math
# a: 時
# b: 分
# 
a, b, h, m = map(int, input().split())

x = ( a**2 + b**2 - 2*a*b* math.cos(int(360 / h) * 30) - int(360 / m) * 6 ) ** 0.5
print(x)


### FIXED CODE ###

import math
# a: 時
# b: 分
# 
a, b, h, m = map(int, input().split())

angle_h = h * 30 + m * 0.5
angle_m = m * 6

cos_ = math.cos( math.radians( abs( angle_h - angle_m ) ) )

x = ( a**2 + b**2 - 2*a*b*cos_ ) ** 0.5

print(x)
import sys

sys.setrecursionlimit(10**7)
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))  #空白あり
def LI2(): return list(map(int,sys.stdin.readline().rstrip()))  #空白なし
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())  #空白あり
def LS2(): return list(sys.stdin.readline().rstrip())  #空白なし


N = I()
mod = 10**9+7

if N == 2:
    print(1)
    exit()
elif N == 3:
    print(4)
    exit()

kaijou = [1]
for i in range(1,N+1):
    kaijou.append((kaijou[-1]*i) % mod)

kaijou_inverse = [1]
for i in range(1,N+1):
    kaijou_inverse[i] = pow(kaijou[i],mod-2,mod)

def nCr(n,r):
    if n < r:
        return 0
    return (kaijou_inverse[n]*kaijou_inverse[r]*kaijou_inverse[n-r]) % mod

ans = 0
for i in range(1,N):
    ans += i*kaijou[i]*kaijou[N-i-i]*nCr(i-1,N-1-i)
    ans %= mod

print(ans)


### FIXED CODE ###

import sys
def I(): return int(sys.stdin.readline().rstrip())


N = I()
mod = 10**9+7


fac = [1]*(N+1)
for i in range(1,N+1):
    fac[i] = (fac[i-1]*i) % mod

fac_inverse = [1]*(N+1)
for i in range(1,N+1):
    fac_inverse[i] = pow(fac[i],mod-2,mod)


def nCr(n,r):
    if n < r:
        return 0
    return (fac[n]*fac_inverse[r]*fac_inverse[n-r]) % mod


A = [0]*(N+1)  # Ai = i回以下マシンを稼働することで、全て黒く塗られるような順列の個数
for i in range(N+1):
    A[i] = (fac[i]*fac[N-1-i]*nCr(i-1,N-1-i)) % mod

ans = 0
for i in range(1,N):
    ans += i*(A[i]-A[i-1])
    ans %= mod

print(ans)
#ABC145D

MOD = 10 ** 9 + 7
import math
x,y = map(int,input().split())
a,b = -1,-1

for i in range(x):
    m = 0
    if (x-i) % 2 == 0:
        m = (x-i) // 2
        if 2*i + m == y:
            if i >= 0 and m >= 0:
                a = i
                b = m
                break
    else:
        continue
MAX_N = 10**6

fact = [1]
fact_inv = [0]*(MAX_N+4)
for i in range(MAX_N+3):
    fact.append(fact[-1]*(i+1)%MOD)

fact_inv[-1] = pow(fact[-1],mod-2,MOD)
for i in range(MAX_N+2,-1,-1):
    fact_inv[i] = fact_inv[i+1]*(i+1)%MOD

def com(n,k,mod):
    return fact[n] * fact_inv[k] % mod * fact_inv[n-k] %mod  
        
        
if a == -1 and b == -1:
    print(0)
else:
    print(com(a+b,a,MOD))

### FIXED CODE ###

#ABC145D

MOD = 10 ** 9 + 7
import math
x,y = map(int,input().split())
a,b = -1,-1

for i in range(x+1):
    m = 0
    if (x-i) % 2 == 0:
        m = (x-i) // 2
        if 2*i + m == y:
            if i >= 0 and m >= 0:
                a = i
                b = m
                break
    else:
        continue
        
MAX_N = 10**6

fact = [1]
fact_inv = [0]*(MAX_N+4)
for i in range(MAX_N+3):
    fact.append(fact[-1]*(i+1)%MOD)

fact_inv[-1] = pow(fact[-1],MOD-2,MOD)
for i in range(MAX_N+2,-1,-1):
    fact_inv[i] = fact_inv[i+1]*(i+1)%MOD

def com(n,k,mod):
    return fact[n] * fact_inv[k] % mod * fact_inv[n-k] %mod  
        
        
if a == -1 and b == -1:
    print(0)
else:
    print(com(a+b,a,MOD))
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))

bef=a[0]
man=b[0]

for i in a[1:]:
  if i==bef+1:
    man+=c[bef]
  man+=b[i]
  bef=i
print(man)


### FIXED CODE ###

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

bef=a[0]-1
man=b[bef]

for i in a[1:]:
  ind=i-1
  if ind==bef+1:
    man+=c[bef]
  man+=b[ind]
  bef=ind
print(man)
n,m,k = map(int,input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
A = [0]
B = [0]

for i in range(len(a)):
  A.append(a[i] + A[i])
for i in range(len(b)):
  B.append(b[i] + B[i])

num = 0
x = m - 1
A.pop(0)
B.pop(0)

for i in range(len(A)):
  if A[i] > k:
    break
  while A[i] + B[x] > k:
    x -= 1
  num = max(num, i + x + 2)
  
print(num)




### FIXED CODE ###

n,m,k = map(int,input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
A,B = [0],[0]

for i in range(n):
  A.append(a[i] + A[i])
for i in range(m):
  B.append(b[i] + B[i])

num,x = 0,m

for i in range(n+1):
  if A[i] > k:
    break
  while A[i] + B[x] > k:
    x -= 1
  num = max(num, i + x)
  
print(num)
s = input()
if (s[1] == B):
  print("ARC")
else:
  print("ABC")

### FIXED CODE ###

s = input()
if (s[1] == "B"):
  print("ARC")
else:
  print("ABC")
cin=input().split()
N=int(cin[0])
M=int(cin[1])


result={}
ac=0
was={}
for i in range(M):
    cin=input().split()
    p=int(cin[0])
    S=str(cin[1])

    log=result.get(p,None)
    if S == "AC" and log != "AC":
        ac+=1
        result[p]="AC"

    if S == "WA" and log != "AC":
        was[p]=was.get(p,0)+1

wa=0
for k,v in result.items():
    if v == "AC":
        wa+=was[k]
print(str(ac)+" "+str(wa))

### FIXED CODE ###

cin=input().split()
N=int(cin[0])
M=int(cin[1])


result={}
ac=0
was={}
for i in range(M):
    cin=input().split()
    p=int(cin[0])
    S=str(cin[1])

    log=result.get(p,None)
    if S == "AC" and log != "AC":
        ac+=1
        result[p]="AC"

    if S == "WA" and log != "AC":
        was[p]=was.get(p,0)+1

wa=0
for k,v in result.items():
    if v == "AC":
        wa+=was.get(k,0)
print(str(ac)+" "+str(wa))
s =input()
li = [(i+j) for (i,j) in zip(s[::2],s[1::2])]

if int(li[0])>12:
  if int(li[1])>12:
  	pritn('NA')
  else:
    print('YYMM')
else:
  if int(li[1])>12:
    print('MMYY')
  else:
    print('AMBIGUOUS')

### FIXED CODE ###

s =input()
li = [(i+j) for (i,j) in zip(s[::2],s[1::2])]

if (int(li[0])>12)&(int(li[0])>0):
  if (int(li[1])>12)|(int(li[1])==0):
  	print('NA')
  else:
    print('YYMM')
elif int(li[0])==0:
  if int(li[1])==0:
    print('NA')
  else:
    print('YYMM')
else:
  if (int(li[1])>12)|(int(li[1])==0):
    print('MMYY')
  else:
    print('AMBIGUOUS')
import sys
from collections import deque


def bfs(s):
    flag_list[s] = 1
    color_list[s] = 0
    q.append(s)
    while len(q)>0:
        u = q.popleft()
        for v, w in enumerate(m_list[u]):
            if w > 0 and flag_list[v] == 0:
                flag_list[v] = 1
                if w%2 == 0:
                    color_list[v] = color_list[u]
                else:
                    color_list[v] = (color_list[u]+1)%2
                q.append(v)
        flag_list[u] = 2


if __name__ == "__main__":
    input = sys.stdin.readline
    n = int(input())
    m_list = [[0]*n for _ in range(n)]
    color_list = [0]*n
    flag_list = [0]*n
    q = deque([])
    for _ in range(n-1):
        u, v, w = map(int, input().split())
        m_list[u-1][v-1] = w
        m_list[v-1][u-1] = w
    bfs(0)
    for color in color_list:
        print(color)


### FIXED CODE ###

import sys
import bisect


input = sys.stdin.readline
a, b, q = map(int, input().split())
inf = 10**12
s_list = [-inf] + [int(input()) for _ in range(a)] + [inf]
s_list.sort()
t_list = [-inf] + [int(input()) for _ in range(b)] + [inf]
t_list.sort()
ans_list =[]
for _ in range(q):
    x = int(input())
    s_idx = bisect.bisect_right(s_list, x)
    t_idx = bisect.bisect_right(t_list, x)
    ans = inf
    for s in [s_list[s_idx-1], s_list[s_idx]]:
        for t in [t_list[t_idx-1], t_list[t_idx]]:
            ans = min(ans, min(abs(x-s), abs(x-t)) + abs(s-t))
    print(ans)
a, b, c = map(int, input().split())
print(a if a not in [b, c] else b if b not in [a, c] else c if c not in [a, b])

### FIXED CODE ###

a, b, c = map(int, input().split())
print(a if b == c else b if a == c else c)
def baisu(x,a):
    if x%a ==0:
        return int(x//a)
    else:
        x -=1
        return baisu(x,a)

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

to_a = a - baisu(a,c) - baisu(a,d) + baisu(a,c*d)
to_b = b - baisu(b,c) - baisu(b,d) + baisu(b,c*d)

if a%c == 0 or a%d == 0:
    print(int(to_b - to_a))
else:
    print(int(to_b-to_a+1))



### FIXED CODE ###

def gcd(a, b):
	while b:
		a, b = b, a % b
	return a
def baisu(x,a):
    return int(x//a)
a,b,c,d = map(int,input().split())

to_a = a-1 - baisu(a-1,c) - baisu(a-1,d) + baisu(a-1,c*d//gcd(c,d))
to_b = b - baisu(b,c) - baisu(b,d) + baisu(b,c*d//gcd(c,d))

print(to_b - to_a)
n, m, x = map(int, input().split())
a=list(map(int, input().split()))

ans = 0

for i in x:
  if str(i) in a:
    ans += 1

print(min(ans, m-ans))


### FIXED CODE ###

n, m, x = map(int, input().split())
a = list(map(int, input().split()))

ans = 0

for i in a:
  if i < x:
    ans += 1

print(min(ans, m-ans))
import math

r = float(input())
x = 2 * math.pi * r
y = r / 2 * r / 2 * Math.pi

print('{0:.6f} {1:.6f}'.format(x,y)) 

### FIXED CODE ###

import math
r = float(input())
e = 2 * math.pi * r
m = r * r * math.pi

print("{0:.6f} {1:.6f}".format(m, e))
from sys import stdin
from collections import deque
input = stdin.readline

N, Q = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(N - 1)]
px = [list(map(int, input().split())) for _ in range(Q)]

tree = [[] for _ in range(N)]
count = [0] * N

for a, b in ab:
    tree[a - 1].append(b - 1)

for p, x in px:
    count[p - 1] += x

d: deque = deque([])


def dfs(p):
    d.append(p)

    while d:
        p = d.pop()

        for np in tree[p]:
            count[np] += count[p]
            d.append(np)


dfs(0)

for c in count:
    print(c, end=" ")

print()


### FIXED CODE ###

from sys import stdin
from collections import deque
input = stdin.readline

N, Q = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(N - 1)]
px = [list(map(int, input().split())) for _ in range(Q)]

tree = [[] for _ in range(N)]
count = [0] * N
seen = [0] * N

for a, b in ab:
    tree[a - 1].append(b - 1)
    tree[b - 1].append(a - 1)

for p, x in px:
    count[p - 1] += x

d = deque([])


def dfs(p):
    d.append(p)
    seen[p] = 1

    while d:
        p = d.pop()

        for np in tree[p]:
            if seen[np] == 0:
                seen[np] = 1
                count[np] += count[p]
                d.append(np)


dfs(0)

for c in count:
    print(c, end=" ")

print()
n = int(input())
ab = [[0] * 3 for i in range(n)]
for i in range(n):
  ab[i][0], ab[i][1] = map(int, input().split())
  ab[i][2] = ab[i][0] + ab[i][1]
sorted(ab, key=lambda x: x[2])
print(sum(ab[0::2][0])-sum(ab[1::2][1]))


### FIXED CODE ###

# C
n = int(input())
if n==1:
    a, b =map(int, input().split())
    print(a)
else:
    def return_a(n):
        return n[0]
    def return_b(n):
        return n[1]
    ab = [[0] * 3 for i in range(n)]
    for i in range(n):
        ab[i][0], ab[i][1] = map(int, input().split())
        ab[i][2] = ab[i][0] + ab[i][1]
    ab = sorted(ab, key=lambda x: x[2], reverse=True)
    print(sum(map(return_a, ab[0::2])) - sum(map(return_b, ab[1::2])))
n = int(input())
if n % 2 == 0:
  print(n)
elif:
  print(n * 2)

### FIXED CODE ###

n = int(input())
if n % 2 == 0:
  print(n)
else:
  print(n * 2)
import sys
input = sys.stdin.readline
s=input()
b=0
m=len(s)
c=[0 for i in range(2019)]
c[0]=c[0]+1
a=""
e=0
for i in range(m-1,-1,-1):
    a=str(a)
    a=int(s[i]+a)
    d=a%2019
    c[d]=c[d]+1
e = sum(i * (i - 1) // 2 for i in c)
print(e)


### FIXED CODE ###

s=input()
b=0
m=len(s)
c=[0 for i in range(2019)]
c[0]=c[0]+1
a=""
e=0
f=1
s= ''.join(list(reversed(s)))
for i in s:
    e+=int(i)*f
    g=e%2019
    c[g]+=1
    f*=10
    f%=2019
e = sum(i * (i - 1) // 2 for i in c)
print(e)
import sys
intput = sys.stdin.readline()

D = int(input())
if D == 25:
    print('Christmas')
elif D == 24:
    print('Christmas Eve')
elif D == 23:
    print('Christmas Eve Eve')
elif D == 22:
    print('Christmas Eve Eve Eve')

### FIXED CODE ###

import sys
input = sys.stdin.readline

D = int(input())
if D == 25:
    print('Christmas')
elif D == 24:
    print('Christmas Eve')
elif D == 23:
    print('Christmas Eve Eve')
elif D == 22:
    print('Christmas Eve Eve Eve')
print(pow(int(input(x))))

### FIXED CODE ###

x = int(input())
print(x**3)
lists = [P+Q,Q+R,R+P]
print(min(lists))

### FIXED CODE ###

lists = list(map(int,input().split(" ")))
lists.sort()
print(lists[0] + lists[1])
#include<iostream>
#include<string>
#include<set>
using namespace std;

int main(){
  string s;cin >> s;
  int l=(int)s.size();
  int k;cin >> k;
  set<string> x;
  for(int i=1;i<=l;i++){
    for(int j=0;j<l;j++){
      x.insert(s.substr(j,i));
    }
  }
  int a=0;
  for(auto itr=x.begin();itr!=x.end();itr++){
    a++;
    if(a==k){cout << *itr << endl;break;}
  }

}


### FIXED CODE ###

s=input()
l=len(s)
k=int(input())
x=set()
for i in range(1,min(l,k)+1):
    for j in range(l-i+1):
        x.add(s[j:j+i])
x=sorted(list(x))
print(x[k-1])
import collections

s=input()
t=input()

if all([c in s for c in t])!=True:
	print(-1)
	exit()

i=0
ss=s
while t!="":
    if i>len(s)-1:
        ss=ss+s
    if t[0]==ss[i]:
        t=t[1:]

    i+=1
print(i)

### FIXED CODE ###

S = input()
T = input()

if all([c in S for c in T])!=True:
	print(-1)
	exit()

str_repeat_num = 0
now_idx = 0
for t in T:
    if t in S[now_idx:]:
        now_idx += S[now_idx:].index(t) + 1
    else:
        str_repeat_num += 1
        now_idx = S[:now_idx].index(t) + 1
print(len(S) * str_repeat_num + now_idx)
import sys
from collections import defaultdict


def input():
    return sys.stdin.readline().strip()


sys.setrecursionlimit(20000000)


def main():
    H, W, D = map(int, input().split())
    A = [list(map(int, input().split())) for _ in range(H)]
    M = defaultdict(list)
    for h in range(H):
        for w in range(W):
            M[A[h][w]] = [h, w]
    P = defaultdict(list)
    for d in range(1, D + 1):
        a = d
        while a <= H * W - D:
            p = abs(M[a][0] - M[a + D][0]) + abs(M[a][1] - M[a + D][1])
            if P[d]:
                P[d].append(P[d][-1] + p)
            else:
                P[d] = [0, p]
            a += D
    # print(P)
    Q = int(input())
    for i in range(Q):
        L, R = map(int, input().split())
        d = L % D
        l = L // D
        r = R // D
        if d == 0:
            d = D
            if len(P[d]) > 0:
                print(P[d][r - 1] - P[d][l - 1])
            else:
                print(0)
        else:
            print(P[d][r] - P[d][l])


if __name__ == "__main__":
    main()


### FIXED CODE ###

import sys
from collections import defaultdict


def input():
    return sys.stdin.readline().strip()


sys.setrecursionlimit(20000000)


def main():
    H, W, D = map(int, input().split())
    A = [list(map(int, input().split())) for _ in range(H)]
    M = defaultdict(list)
    for h in range(H):
        for w in range(W):
            M[A[h][w]] = [h, w]
    P = defaultdict(list)
    for d in range(1, D + 1):
        a = d
        while a <= H * W - D:
            p = abs(M[a][0] - M[a + D][0]) + abs(M[a][1] - M[a + D][1])
            if P[d]:
                P[d].append(P[d][-1] + p)
            else:
                P[d] = [0, p]
            a += D
    # print(P)
    Q = int(input())
    for i in range(Q):
        L, R = map(int, input().split())
        d = L % D
        l = L // D
        r = R // D
        if d == 0:
            d = D
            if len(P[d]) > 0:
                print(P[d][r - 1] - P[d][l - 1])
            else:
                print(0)
        else:
            if len(P[d])>0:
                print(P[d][r] - P[d][l])
            else:
                print(0)


if __name__ == "__main__":
    main()
import numpy as np

N = int(input())
A = np.array(list(map(int, input().split(' '))))
B = np.arange(1, N + 1)

C = A - B
mean = int(np.mean(C))

print(min(np.sum(np.abs(C - mean))), np.sum(np.abs(C + mean)))


### FIXED CODE ###

from functools import lru_cache
import numpy as np

N = int(input())
A = np.array(list(map(int, input().split(' '))))
i = np.arange(1, N + 1)

left = -(10 ** 10)
right = (10 ** 10)


@lru_cache(maxsize=None)
def cost(b):
    return np.sum(np.abs(A - (i + b)))


while True:
    mid = (left + right) // 2
    c_left = cost(left)
    c_right = cost(right)
    if left == mid or right == mid:
        print(min(c_left, c_right))
        break
    elif c_left < c_right:
        right = mid
    else:
        left = mid
N,K =map(int,input().split())
List = list(map(int,input().split()))
DP = [False]*(2*K+1)
for i in range(K):
  for item in List:
    if DP[i]==False:
      DP[i+item] = True
if DP[k]==True:
  print('First')
else:
  print('Second')

### FIXED CODE ###

N,K =map(int,input().split())
List = list(map(int,input().split()))
DP = [False]*(2*K+1)
for i in range(K):
  for item in List:
    if DP[i]==False:
      DP[i+item] = True
if DP[K]==True:
  print('First')
else:
  print('Second')
H,W=map(int,input().split())
h,w=map(int,input().split())
print((H-h)*(W-w)

### FIXED CODE ###

H,W=map(int,input().split())
h,w=map(int,input().split())
print((H-h)*(W-w))
N,K=map(int,input().split())
V=list(map(int,input().split()))
R=min(N,K)
L=[]
for r in range(R+1):
    for A in range(R -r + 1):
        B = R - r-A
        I = sorted((V[:A] + V[::-1][:B]))
        for i in range(len(I)):
            p=K-A-B
            if I[i] >= 0:
                p = i
                break
        for ii in range(min(p,K-A-B)):
            while len(I)>0:
                I.pop(0)
            L.append(sum(I))
print(max(L))








### FIXED CODE ###

N,K=map(int,input().split())
V=list(map(int,input().split()))
R=min(N,K)
L=[]
for r in range(R+1):
    for A in range(R -r + 1):
        B = R - r-A
        I = sorted((V[:A] + V[::-1][:B]))
        p=K-A-B
        for i in range(len(I)):
            if I[i] >= 0:
                p = i
                break
        for ii in range(min(p,K-A-B)):
            if len(I)>0:
                I.pop(0)
            else:break
        L.append(sum(I))
print(max(L))
n=int(input())
a=list(map(int,input().split()))
a.sort(reverse=True)

b = list(set(a))
b.sort(reverse=True)

for i in range(len(b)):
    if a.count(b[i])==4:
        print(b[i]**2)
    elif a.count(b[i])==3 or a.count(b[i])==2:
        while True:
            j=i+1
            if j<n and a.count(b[j])>=2:
                print(b[i]*b[j])
                break
                exit()
            else:
                j+=1
print(0)

### FIXED CODE ###

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

tmp1=a[0]
for i in range(n-1):
    l,s= 0,0
    if tmp1 == a[i+1]:
        idx = i+1
        l = tmp1 #lを確定させる
        #break
        tmp2=a[idx+1]
        for j in range(idx+1,n-1):
            if tmp2==a[j+1]:
                s = tmp2
                print(l*s)
                exit()
            else:
                tmp2 = a[j+1]
    else:
        idx=i
        tmp1=a[i+1]
        
print(0)
n = int(input())
a = 0
b = 0
c = 0
d = 0

for i in range(n):
  S = str(input())
  if S == 'AC':
    a += 1
  if S == 'WA':
    b += 1
  if S == 'TLE':
    c += 1
  if S == 'RE':
    d += 1
print('AC x '+str(a)
print('WA x '+str(b))
print('TLE x '+str(c))
print('RE x '+str(d))

### FIXED CODE ###

from collections import defaultdict
N = int(input())
d = defaultdict(int)

for _ in range(N):
  s = input()
  if s == 'AC':
    d[s] += 1
  elif s == 'WA':
    d[s] += 1
  elif s == 'TLE':
    d[s] += 1
  else:
    d[s] += 1
    
    
for k in ['AC', 'WA', 'TLE', 'RE']:
  print('{} x {}'.format(k, d[k]))
# coding:utf-8
import math
def main():
    n = int(input())
    ans = 2*n / math.gcd(2,n)
    print(int(ans))



if __name__ == '__main__' :
    main()

### FIXED CODE ###

# coding:utf-8
from fractions import gcd
def main():
    n = int(input())
    ans = 2*n / gcd(2,n)
    print(int(ans))

if __name__ == '__main__' :
    main()
#!/usr/bin/env python3
import sys
INF = float("inf")


def solve(N: int, M: int, S: str):

    # 最短手数を求める
    DP = [INF]*(N+1)
    DP[0] = 0
    for i in range(1, N+1):
        if S[i] == "1":
            continue
        for j in range(1, M+1):
            if i-j < 0:
                break
            DP[i] = min(DP[i], DP[i-j]+1)

    if DP[-1] == INF:
        print(-1)
        return
    # 逆順に辿って実際の手を求める
    # 辞書順になるよう、後ろから貪欲に選ぶ
    ans = []
    curr = N
    while curr > 0:
        for i in range(M, 0, -1):
            if curr-i == 0:
                break
            if DP[curr-i] < DP[curr]:
                break
        curr = curr - i
        ans.append(i)
    print(*reversed(ans), sep=" ")

    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    M = int(next(tokens))  # type: int
    S = next(tokens)  # type: str
    solve(N, M, S)


if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys
INF = float("inf")


def solve(N: int, M: int, S: str):

    S = S[::-1]
    data = [0]*(N+1)
    past = 0
    for i in range(N+1):
        if S[i] == "1":
            data[i] = past
        else:
            past = i
    ans = []
    curr = 0
    while True:
        ne = curr+M
        if ne >= N:
            ans.append(N-curr)
            break
        if S[ne] == "1":
            ne = data[ne]
            if ne <= curr:
                print(-1)
                return
        ans.append(ne - curr)
        curr = ne
    print(*reversed(ans), sep=" ")
    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    M = int(next(tokens))  # type: int
    S = next(tokens)  # type: str
    solve(N, M, S)


if __name__ == '__main__':
    main()
from collections import defaultdict

n = int(input())
li = list(map(int, input().split()))

li_conut = defaultdict(int)

# 要素ごとの出現数を記録
for a in li:
    li_count[a] += 1

max_x_count = 0

for x in range(1, 10**5):
    # xにできるやつの個数
    x_conut = li_conut[x-1] + li_conut[x] + li_conut[x+1]
    max_x_count = max(max_x_count, x_conut)
print(max_x_count)

### FIXED CODE ###

import collections
N = int(input())
A = list(map(int, input().split()))
num = []
for i in range(N):
    num.append(A[i])
    num.append(A[i] + 1)
    num.append(A[i] - 1)
#print(num)
num_count = collections.Counter(num)
#print(num_count.values())
print(max(num_count.values()))
num = input().split()

a,b = int(num[0]), int(num[1])
if num[1]=='+': print(a+b)
else: print(a-b)

### FIXED CODE ###

num = input().split()

a,b = int(num[0]), int(num[2])
if num[1]=='+': print(a+b)
else: print(a-b)
a = input()
a = 48 - a
print(a)

### FIXED CODE ###

a = int(input())
a = 48 - a
print(a)
inp = int(input())
li = [0]
for i in li:
  te = inp/2
  if te.is_integer():
    pass
  else:
    te = inp * 3 + 1
  if te in li:
    print(int(len(li)+1))
    break
  li.append(te)
  inp = te

### FIXED CODE ###

inp = [int(i) for i in input().split()]
ru = inp[0] * inp[1] / 2
print(int(ru))
input = []
array = []
for i in input():
  input.append(int(i))
array = input[:5]
k = input[5] 
size = len(array)
for i in range(size):
	if (array[size - i] - array[0] > k):
      print(':(')
      break
    if (i < 3):
      if (array[size - i] - array[1] > k):
      	print(':(')
        break
    if (i < 2):
      if (array[size - i] - array[2] > k):
      	print(':(')
        break
	if (i < 1):
      if (array[size - i] - array[3] > k):
        print(':(')
        break
    if (i == 4):
      print('Yay')

### FIXED CODE ###

array1 = [int(input()) for i in range(6)]
array2 = array1[:5]
k = array1[5] 
 
for i in range(5):
  if (i < 4 and array2[4 - i] - array2[0] > k):
    print(':(')
    break
  if (i < 3 and array2[4 - i] - array2[1] > k):
    print(':(')
    break
  if (i < 2 and array2[4 - i] - array2[2] > k):
    print(':(')
    break
  if (i < 1 and array2[4 - i] - array2[3] > k):
    print(':(')
    break
  if (i == 4):
    print('Yay!')