Harryxun/stf_run huggingface dataset:
x = input()
x = x.split()
x = x.split('/')
k = int(x[0])
a = int(x[1])
b = int(x[2])
if k <= b - a:
  print('OK')
else:
  if b % k <= a % k:
    print('OK')
  else:
    print('NG')


### FIXED CODE ###

k = int(input())
a,b = map(int,input().split())
if k <= b - a:
  print('OK')
else:
  if b // k > a // k or a % k == 0:
    print('OK')
  else:

    print('NG')
S = input()
prvs = ''
si = None
for i, s in enumerate(S):
  if prvs == s:
    if si is None: si = i
    print(i,i+1)
    exit()
  else:
    if si is not None:
      print(si, i)
  prvs = s

for i in range(len(S)-2):
  if set(S[i:i+3])>=3:
    print(i+1, i+4)
    exit()
  
print(-1, -1)
  

### FIXED CODE ###

S = input()
prvs = ''
si = None
for i, s in enumerate(S):
  if prvs == s:
    if si is None: si = i
    print(i,i+1)
    exit()
  else:
    if si is not None:
      print(si, i)
  prvs = s

for i in range(len(S)-2):
  if len(set(S[i:i+3]))<=2:
    print(i+1, i+3)
    exit()
  
print(-1, -1)
from collections import deque
n,m = map(int,input().split())
info = [list(map(int,input().split())) for i in range(m)]

tree = [[] for i in range(n)]

for i in range(m):
  tree[info[i][0]-1].append([info[i][0]-1,info[i][1]-1,info[i][2],False])
flag= [False]
visited =[-float("inf")]*n
visited[0]=0
count = [0]


def bfs(here):
  q =deque()
  for i in tree[here]:
    q.append(i)
  while q and count[0] <=m*n:
    tmp = q.popleft()
    here =tmp[0]
    go = tmp[1]
    cost = tmp[2]
    if visited[here] + cost> visited[go]:
      visited[go] = cost +visited[here]
    for i in range(len(tree[go])):
      if not tree[go][i][3]: 
        q.appendleft(tree[go][i])
        tree[go][i][3]=True
        
      else:
        q.append(tree[go][i])
        if go == n-1:
          print("inf")
          exit()

    count[0] +=1

    
bfs(0)
print(visited[n-1])

### FIXED CODE ###

x,y =map(int,input().split())
print("Brown" if abs(x-y)<=1 else "Alice")
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10**8)

@tail_recursive
def f(x):
    memo = {}
    if x == 0:
        return True
    elif x < 0:
        return False
    elif x in memo.keys():
        return f(memo[x])
    for i in range(6):
        if f(x-100-i):
            memo[x] = True
            return True
    return False

def main():
    X = int(input())
    print(int(f(X)))

if __name__ == '__main__':
    main()

### FIXED CODE ###

#!/usr/bin/env python3

def solve(x):
    if x >= 2000:
        return True
    memo = [True] + [False]*x

    def dp(k):
        if k == 0:
            return True
        for i in range(100,106):
            if k-i >= 0 and memo[k-i]:
                return True
        
        return False
    
    for i in range(x):
        memo[i+1] = dp(i+1)
    return memo[x]



def main():
    X = int(input())
    print(int(solve(X)))
    return

if __name__ == '__main__':
    main()
x = int(input())
li = list(map(int, input()))
from collections import deque
l = deque(li)

def m(p, lis):
    for i in range(len(lis)):
        if lis.leftpop() == p:
            return i+1
    return -1

print(m(x, l))

### FIXED CODE ###

x = int(input())
li = list(map(int, input().split()))
k = 1
s = 0
for i in range(len(li)):
    if k == li[i] :
        k += 1
        s += 1
    if i == len(li)-1 and k == 1:
        s = len(li) + 1
print(len(li)-s)
# -*- coding: utf-8 -*-
n, d = map(int, input().split())
i = 0
num = 0
while i < n:
  x, y = map(int, input().split())
  srq = x*x + y*y
  _d = sqrt(sqr)
  if _d <= d:
    num += 1
  i += 1
 
print(num)

### FIXED CODE ###

import math
# -*- coding: utf-8 -*-
n, d = map(int, input().split())
i = 0
num = 0
while i < n:
  x, y = map(int, input().split())
  _d = math.sqrt((x*x) + (y*y))
  if _d <= d:
    num += 1
  i += 1
 
print(num)
import numpy as np


def solve(n, pts):
    ans = [0] * n

    div = 1000000
    a = np.linspace(0, 2 * np.pi, div)
    b = np.dot(pts, [np.sin(a), np.cos(a)])
    c = np.argmax(b, axis=0)
    for i, v in zip(*np.unique(c, return_counts=True)):
        ans[i] = v / div
    return ans


n = int(input())
pts = [list(map(int, input().split())) for _ in range(n)]
print('\n'.join(map(str, solve(n, pts))))


### FIXED CODE ###

import numpy as np
from scipy.spatial import ConvexHull
from scipy.spatial.qhull import QhullError


def solve(n, pts):
    ans = [0] * n

    try:
        hull = ConvexHull(pts)
    except QhullError:
        lm = np.argmin(pts, axis=0)
        rm = np.argmax(pts, axis=0)
        if lm[0] != rm[0]:
            l, r = lm[0], rm[0]
        elif lm[1] != rm[0]:
            l, r = lm[1], rm[0]
        else:
            l, r = lm[0], rm[1]
        ans[l] = ans[r] = 0.5
        return ans

    ps = np.array(list(map(pts.__getitem__, hull.vertices)))
    vs = ps - np.roll(ps, 1, axis=0)

    vt = vs.T
    vt[0] *= -1
    arcs = np.arctan2(*vt)
    arcs = np.append(arcs, arcs[0])
    da = np.diff(arcs) / (2 * np.pi) % 1

    for i, a in zip(hull.vertices, da):
        ans[i] = a

    return ans


n = int(input())
pts = [list(map(int, input().split())) for _ in range(n)]
print('\n'.join(map(str, solve(n, pts))), end='')
print('Yes') if int(input())//500 <= int(input()) else: print('No')

### FIXED CODE ###

print('Yes') if int(input())%500 <= int(input()) else print('No')
3 3 0
100 -100 0
0 100 100
100 100 100
-100 100 100

### FIXED CODE ###

base = list(map(int,input().split()))
cross = list(map(int,input().split()))
counter = 0
for i in range(base[0]):
    source = list(map(int,input().split()))
    point = 0
    for j in range(base[1]):
        point = point + cross[j]*source[j]
    
    if point+base[2] >0:
        counter = counter+1

print(counter)
def dfs1(v):
  if len(g[v])==0:
    return 0
  for u in g[v]:
    if checked[u]==0:
      checked[u]=1
      g[u].remove(v)
      g[v].remove(u)
      g2[u].append(v)
      g2[v].append(u)
      dfs1(u)

def dfs2(v):
  if len(g2[v])==0:
    return 0
  for u in g2[v]:
    g2[u].remove(v)
    dfs2(u)
    if cnt[u]%2==1:
      print(u,v)
      cnt[u]+=1
    else:
      print(v,u)
      cnt[v]+=1

n,m=map(int,input().split())
g=[[] for _ in range(n+1)]
g2=[[] for _ in range(n+1)]
cnt=[0]*(n+1)
for _ in range(m):
  a,b=map(int,input().split())
  g[a].append(b)
  g[b].append(a)
if m%2==1:
  print(-1)
else:
  checked=[0]*(n+1)
  checked[1]=1
  dfs1(1)
  for v in range(1,n+1):
    if len(g[v])==0:
      continue
    else:
      for u in g[v]:
        print(u,v)
        g[u].remove(v)
        g[v].remove(u)
        cnt[u]+=1
  dfs2(1)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**9)

def dfs1(v):
  for u in g[v]:
    if checked[u]==0:
      checked[u]=1
      g2[v].append(u)
      g3[v].append(u)
      g3[u].append(v)
      dfs1(u)
      
def dfs2(v):
  for u in g2[v]:
    if checked[u]==0:
      checked[u]=1
      dfs2(u)
      if cnt[u]%2==1:
        ans.append((u,v))
        cnt[u]+=1
      else:
        ans.append((v,u))
        cnt[v]+=1
      
n,m=map(int,input().split())
g=[[] for _ in range(n+1)]
g2=[[] for _ in range(n+1)]
g3=[[] for _ in range(n+1)]
cnt=[0]*(n+1)
ans=[]
ansset=set()
for _ in range(m):
  a,b=map(int,input().split())
  g[a].append(b)
  g[b].append(a)
if m%2==1:
  print(-1)
else:
  checked=[0]*(n+1)
  checked[1]=1
  dfs1(1)
  for v in range(1,n+1):
    for u in g[v]:
      if u not in g3[v]:
        if (u,v) not in ansset:
          ans.append((v,u))
          ansset.add((v,u))
          cnt[v]+=1
  checked=[0]*(n+1)
  checked[1]=1
  dfs2(1)
  for v,u in ans:
    print(v,u)
#!/usr/bin/env python
import string
import sys
from itertools import chain, dropwhile, takewhile


def read(
    *shape, f=int, it=chain.from_iterable(sys.stdin), whitespaces=set(string.whitespace)
):
    def read_word():
        w = lambda c: c in whitespaces
        nw = lambda c: c not in whitespaces
        return f("".join(takewhile(nw, dropwhile(w, it))))

    if not shape:
        return read_word()
    elif len(shape) == 1:
        return [read_word() for _ in range(shape[0])]
    elif len(shape) == 2:
        return [[read_word() for _ in range(shape[1])] for _ in range(shape[0])]


def readi(*shape):
    return read(*shape)


def readi1(*shape):
    return [i - 1 for i in read(*shape)]


def readf(*shape):
    return read(*shape, f=float)


def reads(*shape):
    return read(*shape, f=str)


def arr(*shape, fill_value=0):
    if len(shape) == 1:
        return [fill_value] * shape[fill_value]
    elif len(shape) == 2:
        return [[fill_value] * shape[1] for _ in range(shape[0])]


def dbg(**kwargs):
    print(
        ", ".join("{} = {}".format(k, repr(v)) for k, v in kwargs.items()),
        file=sys.stderr,
    )


def main():
    n, k = readi(2)
    a = readi(n)
    tmp = sum(a[:k])
    ans = tmp
    dbg(tmp=tmp)
    for i in range(k, len(a)):
        tmp += a[i] - a[i - k]
        ans = max(ans, tmp)
        dbg(tmp=tmp)
    print(ans)


if __name__ == "__main__":
    main()



### FIXED CODE ###

#!/usr/bin/env python
import string
import sys
from itertools import chain, dropwhile, takewhile


def read(
    *shape, f=int, it=chain.from_iterable(sys.stdin), whitespaces=set(string.whitespace)
):
    def read_word():
        w = lambda c: c in whitespaces
        nw = lambda c: c not in whitespaces
        return f("".join(takewhile(nw, dropwhile(w, it))))

    if not shape:
        return read_word()
    elif len(shape) == 1:
        return [read_word() for _ in range(shape[0])]
    elif len(shape) == 2:
        return [[read_word() for _ in range(shape[1])] for _ in range(shape[0])]


def readi(*shape):
    return read(*shape)


def readi1(*shape):
    return [i - 1 for i in read(*shape)]


def readf(*shape):
    return read(*shape, f=float)


def reads(*shape):
    return read(*shape, f=str)


def arr(*shape, fill_value=0):
    if len(shape) == 1:
        return [fill_value] * shape[fill_value]
    elif len(shape) == 2:
        return [[fill_value] * shape[1] for _ in range(shape[0])]


def dbg(**kwargs):
    print(
        ", ".join("{} = {}".format(k, repr(v)) for k, v in kwargs.items()),
        file=sys.stderr,
    )


def main():
    while True:
        n, k = readi(2)
        if n == 0:
            return
        a = readi(n)
        tmp = sum(a[:k])
        ans = tmp
        for i in range(k, len(a)):
            tmp += a[i] - a[i - k]
            ans = max(ans, tmp)
        print(ans)


if __name__ == "__main__":
    main()
import sys
input = sys.stdin.readline


def main():
    N = int(input())
    A = []
    for _ in range(N):
        x, y = map(int, input().split())
        A.append((x, y))

    import collections
    D = collections.defaultdict(int)
    import itertools
    for a, b in itertools.combinations(A, 2):
        p = a[0] - b[0]
        q = a[1] - b[1]
        D[(p, q)] += 1
    d = sorted(D.values())
    print(N - d[-1])


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
input = sys.stdin.readline


def main():
    N = int(input())
    A = []
    for _ in range(N):
        x, y = map(int, input().split())
        A.append((x, y))
    if N == 1:
        print(1)
        return

    A.sort()
    import collections
    D = collections.defaultdict(int)
    import itertools
    for a, b in itertools.combinations(A, 2):
        p = a[0] - b[0]
        q = a[1] - b[1]
        D[(p, q)] += 1
    d = sorted(D.values())
    print(N - d[-1])


if __name__ == '__main__':
    main()
#include <bits/stdc++.h>
#define int long long
#define io ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define pb push_back
#define rep(i,l,r) for(int i=l;i<r;i++)
#define bep(i,l,r) for(int i=l;i>=r;i--)
#define ld long double
#define ff first
#define ss second
#define pii pair<int,int>
#define vi vector<int>
#define vii vector<pii>
#define el '\n'
#define sz(s) s.size()
#define all(v) v.begin(),v.end()
#define mii map<int,int>
#define mr  make_pair
using namespace std;

int inf = 1e18;
const int N = 5e5+5;
int mod = 1e9+7;
int powmod(int a,int b) {int res=1;if(a>=mod)a%=mod;for(;b;b>>=1){if(b&1)res=res*a;if(res>=mod)res%=mod;a=a*a;if(a>=mod)a%=mod;}return res;}

signed main()
{
    io
    int tt = 1;
    //cin>>tt;
    while(tt--)
    {
       int n;
       cin>>n;
       unordered_map<int,int> mp;
       int arr[n];
       rep(i,0,n)
       cin>>arr[i];
       rep(i,0,n)
       {
           int ct = 0;
           int x = arr[i];
           for(int i=2;i*i<=x;++i)
           {

               if(x%i==0)
               {
                  ct = 0;
                 while(x%i==0)
                 {
                     ct++;
                     x/=i;
                 }
                 mp[i]= max(mp[i],ct);mp[i]= max(mp[i],ct);
               }

           }
           if(x!=1)
            mp[x] = max(mp[x],1LL);
       }
       int lcm = 1;
       for(auto x:mp)
        lcm = (lcm*powmod(x.ff,x.ss))%mod;
        int ans = 0;
        rep(i,0,n)
       {
           ans = (ans + (lcm*powmod(arr[i],mod-2))%mod)%mod;
       }
        cout<<ans<<el;
    }


        return 0;
    }


### FIXED CODE ###

def gcd(a,b):
  if b==0:
    return a
  return gcd(b,a%b)
def lcm(arr):
  ans = 1
  for i in arr:
    ans = (ans*i)//gcd(ans,i)
  return ans
n = int(input())
arr = list(map(int,input().split())) #list(map(int, input().split()))
l = lcm(arr)
ans = 0;
for i in arr:
  ans+= l//i
print(ans%(10**9+7))
N, T = map(int, input().split())

d = {}
for _ in range(N):
    Ns = [int(i) for i in input().split()]
    time = Ns[1]
    if time <= T:
        d[Ns[0]] = time
if d:
    print(min(d))
else:
    print('TLE')

### FIXED CODE ###

N = int(input())


if N == 1:
    print('Hello World')
else:
    A = int(input())
    B = int(input())
    print(A + B)
from fractions import gcd
a,b,c,d = map(int,input().split())
cab = (b//c)-((a-1)//c)
dab = (b//d)-((a-1)//c)
lcm = int(c*d/gcd(c,d))
cdab = (b//lcm)-((a-1)//lcm)
print((b-a+1)-cab-dad+cdab)

### FIXED CODE ###

from fractions import gcd
A, B, C, D = map(int,input().split())
total = B - A + 1
divC = B//C - (A-1)//C
divD = B//D - (A-1)//D
lcm = int(C * D / gcd(C, D))
divCD = B//lcm - (A-1)//lcm
print(total - divC - divD + divCD)
import math

a, b = map(int, input().split())  # 複数数値入力

A = list()
B = list()

if b == 0:
    B = [0]
elif b == 1:
    B = [1]
else:
    for i in range(1, int(math.log2(b))+2):
        tmp = b // (2 ** i) * 2 ** (i - 1)

        if b % (2 ** i) < (2 ** (i-1)):
            plus = 0
        else:
            plus = b % (2 ** i) - 2 ** (i-1) + 1

        B.append(tmp + plus)

if a == 0:
    A = [0]
elif a == 1:
    A = [0]
else:
    for i in range(1, int(math.log2(a-1))+2):
        tmp = (a-1) // (2 ** i) * 2 ** (i - 1)

        if (a-1) % (2 ** i) < (2 ** (i-1)):
            plus = 0
        else:
            plus = (a-1) % (2 ** i) - 2 ** (i-1) + 1

        A.append(tmp + plus)

ans = 0
for i in range(0, int(math.log2(b)) + 1):
    if i >= len(A):
        ans += (B[i]) % 2 * 10 ** i
    else:
        ans += (B[i] - A[i]) % 2 * 10 ** i

print(int(str(ans), 2))


### FIXED CODE ###

import math

a, b = map(int, input().split())  # 複数数値入力

A = list()
B = list()

if b == 0:
    B = [0]
elif b == 1:
    B = [1]
else:
    for i in range(1, int(math.log2(b))+2):
        tmp = b // (2 ** i) * 2 ** (i - 1)

        if b % (2 ** i) < (2 ** (i-1)):
            plus = 0
        else:
            plus = b % (2 ** i) - 2 ** (i-1) + 1

        B.append(tmp + plus)

if a == 0:
    A = [0]
elif a == 1:
    A = [0]
else:
    for i in range(1, int(math.log2(a-1))+2):
        tmp = (a-1) // (2 ** i) * 2 ** (i - 1)

        if (a-1) % (2 ** i) < (2 ** (i-1)):
            plus = 0
        else:
            plus = (a-1) % (2 ** i) - 2 ** (i-1) + 1

        A.append(tmp + plus)

if b == 0:
    print(0)
else:
    ans = 0
    for i in range(0, int(math.log2(b)) + 1):
        if i >= len(A):
            ans += (B[i]) % 2 * 10 ** i
        else:
            ans += (B[i] - A[i]) % 2 * 10 ** i

    print(int(str(ans), 2))
import sys
from itertools import islice
read = map(int, sys.stdin.read().split())

N = next(read)
candidates = [format(i, 'b').zfill(N) for i in range(2 ** N)]
A = [0] * 3
xy = [[] for _ in range(N)]
for i in range(N):
    A[i] = next(read)
    xy[i].extend(list(islice(read, A[i] * 2)))

answer = 0

for candidate in candidates:
    tmp = 0
    truth = set()
    false = set()
    for k in range(N):
        if candidate[k] == '1':
            truth.add(k)
            for i, j in zip(*[iter(xy[k])] * 2):
                i -= 1
                if j == 1:
                    if i in false:
                        break
                    truth.add(i)
                else:
                    if i in truth:
                        break
                    false.add(i)
            else:
                continue
            break
        else:
            if k in truth:
                break
            false.add(k)
    else:
        if len(truth) > answer:
            answer = len(truth)

print(answer)

### FIXED CODE ###

import sys
from itertools import islice
read = map(int, sys.stdin.read().split())

N = next(read)
candidates = [format(i, 'b').zfill(N) for i in range(2 ** N)]
A = [0] * N
xy = [[] for _ in range(N)]
for i in range(N):
    A[i] = next(read)
    xy[i].extend(list(islice(read, A[i] * 2)))

answer = 0

for candidate in candidates:
    tmp = 0
    truth = set()
    false = set()
    for k in range(N):
        if candidate[k] == '1':
            if k in false:
                break
            truth.add(k)
            for i, j in zip(*[iter(xy[k])] * 2):
                i -= 1
                if j == 1:
                    if i in false:
                        break
                    truth.add(i)
                else:
                    if i in truth:
                        break
                    false.add(i)
            else:
                continue
            break
        else:
            if k in truth:
                break
            false.add(k)
    else:
        if len(truth) > answer:
            answer = len(truth)

print(answer)
import numpy as np
N = int(input())
x = np.array(sorted(list(map(int, input().split()))),dtype = 'int64')

s = []
for p in range(x[0],x[-1]):
    s.append(np.sum((x-p)*(x-p)))
    
print(min(s))

### FIXED CODE ###

import numpy as np
N = int(input())
x = np.array(sorted(list(map(int, input().split()))),dtype = 'int64')

s = []
for p in range(x[0],x[-1]+1):
    s.append(np.sum((x-p)*(x-p)))
    
print(min(s))
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

import operator

N,H,W = map(int,readline().split())
m = map(int,read().split())
RCA = sorted(zip(m,m,m),key=operator.itemgetter(2),reverse=True)

root = list(range(H+W))
size = [0] * (H+W)
no_cycle = [True] * (H+W)

def find_root(x):
    y = root[x]
    if x == y:
        return y
    z = find_root(y)
    root[x] = z
    return z

def merge(x,y):
    x,y = find_root(x),find_root(y)
    sx,sy = size[x],size[y]
    if sx < sy:
        sx,sy = sy,sx
        x,y = y,x
    root[y] = x
    size[x] += sy
    no_cycle[x] = no_cycle[x] and no_cycle[y]

answer = 0
for R,C,A in RCA:
    x,y = R-1,H+C-1
    rx,ry = find_root(x),find_root(y)
    if rx == ry:
        if not no_cycle[rx]:
            continue
        no_cycle[rx] = False
    else:
        if (not no_cycle[rx]) and (not no_cycle[ry]):
            continue
        merge(rx,ry)
    answer += A

print(answer)


### FIXED CODE ###

import sys
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 7)

N,H,W = map(int,readline().split())
RCA = [tuple(int(x) for x in line.split()) for line in readlines()]

RCA.sort(key = lambda x: -x[2])

RCA

root = list(range(H+W))
size = [0] * (H+W)
no_cycle = [True] * (H+W)

def find_root(x):
    y = root[x]
    if x == y:
        return y
    z = find_root(y)
    root[x] = z
    return z

def merge(x,y):
    x,y = find_root(x),find_root(y)
    sx,sy = size[x],size[y]
    if sx < sy:
        sx,sy = sy,sx
        x,y = y,x
    root[y] = x
    no_cycle[x] = no_cycle[x] and no_cycle[y]

answer = 0
for R,C,A in RCA:
    x,y = R-1,H+C-1
    rx,ry = find_root(x),find_root(y)
    if rx == ry:
        if not no_cycle[rx]:
            continue
        no_cycle[rx] = False
    else:
        if (not no_cycle[rx]) and (not no_cycle[ry]):
            continue
        merge(rx,ry)
    answer += A

print(answer)
from collections import Counter
N = int(input())
S = [input() for i in range(N)]
S = [s[0] for s in S if s[0] in 'MARCH']
counter = Counter(S)
if len(counter) < 3:
  print(0)
else:
  cnt = 0
  mar = 'MARCH'
  for a in range(0,3):
    if mar[a] not in counter:
      continue
    for b in range(a+1, min(a+1+3, N)):
      if mar[b] not in counter:
        continue
      for c in range(b+1, min(b+1+3, N)):
        if mar[c] not in counter:
          continue
        cnt += counter[mar[a]] * counter[mar[b]] * counter[mar[c]]
  print(cnt)

### FIXED CODE ###

from collections import Counter
N = int(input())
S = [input() for i in range(N)]
S = [s[0] for s in S if s[0] in 'MARCH']
counter = Counter(S)
if len(counter) < 3:
  print(0)
else:
  cnt = 0
  mar = 'MARCH'
  for a in range(0,3):
    if mar[a] not in counter:
      continue
    for b in range(a+1, min(a+1+3, 5-1)):
      if mar[b] not in counter:
        continue
      for c in range(b+1, min(b+1+3, 5)):
        if mar[c] not in counter:
          continue
        # print(mar[a], mar[b], mar[c])
        cnt += counter[mar[a]] * counter[mar[b]] * counter[mar[c]]
  print(cnt)
import sys
import math
from collections import defaultdict

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 10**9 + 7

def I(): return int(input())
def II(): return map(int, input().split())
def III(): return list(map(int, input().split()))
def Line(N,num):
    if N<=0:
        return [[]]*num
    elif num==1:
        return [I() for _ in range(N)]
    else:
        read_all = [tuple(II()) for _ in range(N)]
        return map(list, zip(*read_all))

#################

from bisect import bisect_right

N,M = II()
A = list(map(str, input().split()))

B = list(reversed(A))
ones = []
n = [0]*N
for i in range(N):
    if B[i]=='1':
        ones.append(i)

ans = []
place = 0
while place<N-1:
    for i in range(1,M+1)[::-1]:
        if B[place+i]!=1:
            ans.append(i)
            place += i
        if i==1 and B[place+i]=='1':
            print(-1)
            exit()

print(*list(reversed(ans)))

### FIXED CODE ###

import sys
import math
from collections import defaultdict

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 10**9 + 7

def I(): return int(input())
def II(): return map(int, input().split())
def III(): return list(map(int, input().split()))
def Line(N,num):
    if N<=0:
        return [[]]*num
    elif num==1:
        return [I() for _ in range(N)]
    else:
        read_all = [tuple(II()) for _ in range(N)]
        return map(list, zip(*read_all))

#################

from bisect import bisect_right

N,M = II()
A = str(input())

B = A[::-1]

ans = []
place = 0
while place!=N:
    for i in range(1,M+1)[::-1]:
        if place+i<=N:
            if B[place+i]!='1':
                ans.append(i)
                place += i
                break
        if i==1 and B[place+i]=='1':
            print(-1)
            exit()

print(*list(reversed(ans)))
s=input()
s=s.sorted()
if s=='abc':
  print('Yes')
else:
  print('No')

### FIXED CODE ###

s=input()
if len(set(s))==3:
  print('Yes')
else:
  print('No')
def dfs(index,n,m,c,dp):
    if dp[index][m] != 30:
        return dp[index][m]

    if index==n:
        return n+1

    if m==c[index]:
        return 1

    if m<c[index]:
        return dfs(index+1,n,m,c,dp)

    ret=min(dfs(index+1,n,m,c,dp),
            dfs(index+1,n,m-c[index],c,dp)+1,
            dfs(index,n,m-c[index],c,dp)+1)
    dp[index][m]=ret
    return ret
m,n=[int(i) for i in input().split()]
c=[int(i) for i in input().split()]
dp=[[30 for i in range(m+1)] for j in range(n+1)]
print(dfs(0,n,m,c,dp))

### FIXED CODE ###

m,n=[int(i) for i in input().split()]
c=[int(i) for i in input().split()]
dp=[[int(1e4) for i in range(m+1)] for j in range(n+1)]
i=n-1
while i>=0:
    for j in range(m+1):
        if j==c[i]:
            dp[i][j]=1
        elif j<c[i]:
            dp[i][j]=dp[i+1][j]
        else:
            dp[i][j]=min(dp[i+1][j],dp[i+1][j-c[i]]+1,dp[i][j-c[i]]+1)
    i-=1
print(dp[0][m])