Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

import sys
sys.setrecursionlimit(10 ** 9)
# input = sys.stdin.readline    ####
def int1(x): return int(x) - 1
def II(): return int(input())

def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())

def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

def SMI(): return input().split()
def SLI(): return list(input())

def printlist(lst, k=' '): print(k.join(list(map(str, lst))))
INF = float('inf')

# from math import ceil, floor, log2
# from collections import deque
# from itertools import combinations as comb, combinations_with_replacement as comb_w, accumulate, product, permutations
# from heapq import heapify, heappop, heappush
# import numpy as np
# from numpy import cumsum  # accumulate

def solve():
    S = SLI()
    l = len(S)
    MOD = 1000000007
    dp = [[0]*13 for _ in range(l+1)]
    dp[0][0] = 1
    mul = 1
    S = S[::-1]
    for i in range(l):
        if S[i] == '?':
            for ques in range(10):
                k = (ques * mul) % 13
                for j in range(13):
                    dp[i+1][(j+k)%13] += dp[i][j]
        else:
            k = (int(S[i]) * mul) % 13
            for j in range(13):
                dp[i+1][(j+k)%13] += dp[i][j]

        mul *= 10 % 13
    # print(dp[-1])
    print(dp[-1][5] % MOD)

if __name__ == '__main__':
    solve()


### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 9)
# input = sys.stdin.readline    ####
def int1(x): return int(x) - 1
def II(): return int(input())

def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())

def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

def SMI(): return input().split()
def SLI(): return list(input())

def printlist(lst, k=' '): print(k.join(list(map(str, lst))))
INF = float('inf')

# from math import ceil, floor, log2
# from collections import deque
# from itertools import combinations as comb, combinations_with_replacement as comb_w, accumulate, product, permutations
# from heapq import heapify, heappop, heappush
# import numpy as np
# from numpy import cumsum  # accumulate

def solve():
    S = SLI()
    l = len(S)
    MOD = 1000000007
    dp = [[0]*13 for _ in range(l+1)]
    dp[0][0] = 1
    mul = 1
    for i in range(l):
        s = S[-(i + 1)]
        if s == '?':
            for q in range(10):
                for j in range(13):
                    dp[i+1][(q*mul + j)%13] += dp[i][j]
                    dp[i+1][(q*mul + j)%13] %= MOD
        else:
            for j in range(13):
                k = int(s)
                dp[i+1][(k*mul + j)%13] += dp[i][j]
                dp[i+1][(k*mul + j)%13] %= MOD

        mul = mul * 10 % 13
    # print(dp[-1])
    print(dp[-1][5] % MOD)

if __name__ == '__main__':
    solve()
### BUGGY CODE ###

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

c = [[0] * 4000 for _ in range(4000)]
c[0][0] = 1
for i in range(1, 4000):
    ci = c[i]
    ci1 = c[i - 1]
    ci[0] = 1
    for j in range(1, i + 1):
        ci[j] = (ci1[j - 1] + ci1[j]) % 1000000007

for i in range(1, K + 1):
    print(c[K - 1][i - 1] * c[N - K + 1][i] % 1000000007)


### FIXED CODE ###

def main():
    N, K = map(int, input().split())

    c = [[0] * 4000 for _ in range(4000)]
    c[0][0] = 1
    for i in range(1, 4000):
        ci = c[i]
        ci1 = c[i - 1]
        ci[0] = 1
        for j in range(1, i + 1):
            ci[j] = (ci1[j - 1] + ci1[j]) % 1000000007

    def f(n, k):
        return c[n+k-1][k-1]

    for i in range(1, K + 1):
        print((f(K-i, i) * f(N-K-(i-1), i+1)) % 1000000007)


main()
### BUGGY CODE ###

#!/usr/bin/env python3

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

n = I()
edges = [[] for _ in range(n)]
ab = [[i] + LI() for i in range(n-1)]
col = [defaultdict(lambda : 0) for _ in range(n)]
cnt = [0] * n
for i, a, b in ab:
    edges[a-1].append((i, b-1))
    edges[b-1].append((i, a-1))
    cnt[a-1] += 1
    cnt[b-1] += 1

k = max(cnt)
print(k)
used_edge = [False] * n
que = deque([(0, -1)])
edges_color = [None] * (n-1)
while que:
    v, p = que.popleft()
    for i, u in edges[v]:
        if used_edge[i]:
            continue
        if u == p:
            continue
        cnt = 1
        while col[u][cnt] or col[v][cnt]:
            cnt += 1
        col[u][cnt] = 1
        col[v][cnt] = 1
        edges_color[i] = cnt
        used_edge[i] = False
        que.append((u, v))
for c in edges_color:
    print(c)

### FIXED CODE ###

#!/usr/bin/env python3
#ABC146 D

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(1000000)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

n = I()
graph = [[] for _ in range(n)]
edge = []
for i in range(n-1):
    a,b = LI()
    a -= 1
    b -= 1
    graph[a].append((b,i))
    graph[b].append((a,i))
    edge.append((a,b,i))

m = 0
for i in range(n):
    m = max(m,len(graph[i]))

print(m)
ans = [None]*(n-1)
que = deque()
que.append((0,0))
while que:
    v,color = que.popleft()
    cnt = 1
    for u,i in graph[v]:
        if ans[i] == None:
            if cnt != color:
                ans[i] = cnt
                que.append((u,cnt))
                cnt += 1
            else:
                ans[i] = cnt+1
                que.append((u,cnt+1))
                cnt += 2
print(*ans)
### BUGGY CODE ###

N,Q = map(int,input().split())
S = input()
lr = []
for i in range(Q):
        lr.append(list(map(int,input().split())))

for i in range(Q):
        cnt = 0
        l,r = lr[i][0],lr[i][1]
        x = S[l-1:r]
        for k in range(len(x)):
                if k - 1 >= 0:
                    if x[(k - 1):(k + 1)] == 'AC':
                            cnt += 1
        print(cnt)
                
                

### FIXED CODE ###

N,Q = map(int,input().split())
S = input()
cnt = [0] * (N + 1)
lrs = []
for i in range(Q):
        lrs.append(list(map(int,input().split())))

for i in range(N):
        cnt[i+1] = cnt[i] + (1 if S[i:i+2] == "AC" else 0)
for lr in lrs:
        print(cnt[lr[1] - 1] - cnt[lr[0] - 1])
### BUGGY CODE ###

import sys
import bisect
input = sys.stdin.readline

n,m = map(int,input().split())
a = list(map(int,input().split()))
bc = []
for _ in range(m):
    bc.append(list(map(int,input().split())))

a.sort()

bc.sort(key=lambda x: x[1], reverse=True)
num = 0
ans = 0
for i in range(m):
    index = bisect.bisect_left(a[num:],bc[i][1])
    if index == 0:
        break
    elif index > bc[i][0]:
        ans += bc[i][1] * bc[i][0]
    else:
        ans += bc[i][1] * index
        ans += sum(a[num+index:num+bc[i][0]])

    num += bc[i][0]
    if num >= n:
        break
if num < n:
    print(ans + sum(a[num:]))
else:
    print(ans)


### FIXED CODE ###

import sys

def main():
    input = sys.stdin.readline

    n,m = map(int,input().split())
    a = list(map(int,input().split()))
    bc = []
    for _ in range(m):
        bc.append(list(map(int,input().split())))

    a.sort()
    a = tuple(a)

    bc.sort(key=lambda x: x[1], reverse=True)

    num = 0
    ans = 0

    for i in range(m):
        b = bc[i][0]
        c = bc[i][1]
        for j in range(num,min(num+b,n)):
            if c > a[j]:
                ans += c
            else:
                ans += a[j]

        num += b
        if num >= n:
            break

    if num < n:
        print(ans + sum(a[num:]))
    else:
        print(ans)
if __name__ == '__main__':
    main()
### BUGGY CODE ###

from collections import deque
n,m = map(int,input().split())
graph = [[[] for i in range(3)] for j in range(n+1)]
for i in range(m):
  u,v = map(int,input().split())
  graph[u][0].append(v)
s,t = map(int,input().split())
for i in range(1,3):
  for j in range(1,n+1):
    l = set([])
    for k in graph[j][0]:
      l = l | set(graph[k][i-1])
    graph[j][i] = list(l)
for i in range(n+1):
  graph[i] = graph[i][2]
cnt = 0
done = [0]*(n+1)
done[s] = 1
wait = deque([s])
while wait:
  cnt += 1
  q = wait
  wait = deque([])
  for i in q:
    for j in graph[i]:
      if not done[j]:
        wait.append(j)
        done[j] = 1
      if j == t:
        print(cnt)
        quit()
print(-1)

### FIXED CODE ###

import copy
n,m = map(int,input().split())
graph = [[] for _ in range(n*3)]
for i in range(m):
  u,v = map(int,input().split())
  for j in range(3):
    graph[n*j+u-1].append((n*(j+1)+v-1)%(3*n))
s,t = map(int,input().split())
wait = [s-1]
cnt = 0
done = [0]*(3*n)
while wait:
  cnt += 1
  now = copy.copy(wait)
  wait = []
  for i in now:
    for j in graph[i]:
      if not done[j]:
        done[j] = 1
        wait.append(j)
      if j == t-1:
        print(cnt//3)
        quit()
print(-1)
### BUGGY CODE ###

import sys


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


def main():
    N, M = map(int, input().split())
    prices = [[int(a), int(i)] for i, a in enumerate(input().split())]

    for _ in range(M):
        i = max(prices)[1]
        prices[i][0] //= 2

    ans = sum(map(lambda x: x[0], prices))
    print(ans)


if __name__ == "__main__":
    main()


### FIXED CODE ###

import sys
import heapq
from math import ceil


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


def main():
    N, M = map(int, input().split())
    A = list(map(lambda x: -int(x), input().split()))
    heapq.heapify(A)

    for _ in range(M):
        mx = heapq.heappop(A)
        heapq.heappush(A, ceil(mx / 2))

    ans = -sum(A)

    print(ans)


if __name__ == "__main__":
    main()
### BUGGY CODE ###

N = int(input())
A = list(map(int, input().split()))
ans = 0
for i in range(N):
    # 単体の時は必ず成立する
    ans += 1
    # iについて、どのbitが立っているか
    visited = set()
    for d in range(20):
        if A[i] & 1 << d:
            visited.add(d)

    for j in range(i + 1, N):
        flag = True
        # jについて、どのbitが立っているか
        for d in range(20):
            if A[j] & 1 << d:
                if d not in visited:
                    visited.add(d)
                else:
                    flag = False
        # 重複がなければ、(i,j)は条件を満たす
        if flag == True:
            ans += 1
            continue
        # 重複があった場合、(i,j)は条件を満たさない
        # また、これ以上jを調べるのは無駄なので次のiへ
        else:
            break
print(ans)


### FIXED CODE ###

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

ans = 0
tmp = A[0]
end = 0

# ^ = XOR演算子
for start in range(N):

    while end < N - 1 and (tmp ^ A[end + 1] == tmp + A[end + 1]):
        end += 1
        tmp += A[end]

    ans += (end - start + 1)
    tmp -= A[start]

    if start == end and end < N - 1:
        end += 1
        tmp += A[end]

print(ans)
### BUGGY CODE ###

N = int(input())
A = list(map(int,input().split()))
mod = 10**9+7 

lb0 = [0]*60
lb1 = [0]*60
for i in range(N):
  bs = format(A[i],"060b")
  for j in range(60):
    if bs[j] == "0":
      lb0[j] += 1
    if bs[j] == "1":
      lb1[j] += 1  
###
ans = 0
for i in range(60):
  ans += ((lb0[i]*lb1[i] %mod)*(2**(59-i) %mod)) %mod
  ans %= mod
print(ans)  

### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
mod = 10**9+7 

lb0 = [0]*60
lb1 = [0]*60
for i in range(N):
  bs = format(A[i],"060b")
  for j in range(60):
    if bs[j] == "0":
      lb0[j] += 1
    if bs[j] == "1":
      lb1[j] += 1  
###
ans = 0
for i in range(60):
  ans += ((lb0[i]*lb1[i] %mod)*(2**(59-i) %mod)) %mod
  ans %= mod
print(ans)
### BUGGY CODE ###

n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
al=sorted(a)
bl=sorted(b)
cl=sorted(c)
 
abl=[]
i=0
for j in range(n):
    i=n-1
    while al[i]>=bl[j]:
        i-=1
        if i==-1:
            break
    if i==-1:
        abl.append(0)
    else:
        abl.append(i+1)
bcl=[]
j=0
for j in range(n):
    k=0
    while cl[k]<=bl[j]:
        k+=1
        if k==n:
            break
    if k==n:
        bcl.append(0)
    else:
        bcl.append(n-k)
ans=0
for s in range(n):
    ans+=abl[s]*bcl[s]
print(ans)


### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
al=sorted(a)
bl=sorted(b)
cl=sorted(c)
 
abl=[0]*n
bcl=[0]*n
i=n-1
for j in range(n-1,-1,-1):
    if i==-1:
        abl[j]=0
        continue
    while al[i]>=bl[j]:
        i-=1
        if i==-1:
            break
    if i==-1:
        abl[j]=0
    else:
        abl[j]=i+1
j=0
bcl=[0]*n
k=0
for j in range(n):
    if k==n:
        bcl[j]=0
        continue
    while cl[k]<=bl[j]:
        k+=1
        if k==n:
            break
    if k==n:
        bcl[j]=0
    else:
        bcl[j]=(n-k)
ans=0
for s in range(n):
    ans+=abl[s]*bcl[s]
print(ans)
### BUGGY CODE ###

from collections import deque
n=int(input())
league=[deque(map(int,input().split())) for _ in range(n)]

total_match=n*(n-1)//2
match=0
day=0


for _ in range(total_match):
    day+=1
    today_match=[]

    for i in range(n):
        try:
            m=league[i][0]-1
            if not i in today_match and not m in today_match:
                if league[m][0]-1==i:
                    today_match.extend((i,m))
                    league[i].popleft()
                    league[m].popleft()
        except:
            continue
    if not today_match:
        day=-1
        break
    match+=len(today_match)//2
    if match>=total_match:
        break

print(day)

### FIXED CODE ###

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

N = int(input())
pair = N * (N - 1) // 2
ptoi = dict()

i = 0
for x in range(1, N):
    for y in range(x + 1, N + 1):
        ptoi[(x, y)] = i
        ptoi[(y, x)] = i
        i += 1

edge = [[] for _ in range(pair)]
indeg = [0] * pair
for i in range(1, N+1):
    inp = list(map(int, input().split()))
    for s, t in zip(inp[:-1], inp[1:]):
        edge[ptoi[(i, s)]].append(ptoi[(i, t)])
        indeg[ptoi[(i, t)]] += 1


now = [i for i, d in enumerate(indeg) if d == 0]
day = 0
while now:
    nxt = []
    while now:
        s = now.pop()
        for t in edge[s]:
            if indeg[t] <= 0:
                continue
            indeg[t] -= 1
            if indeg[t] == 0:
                nxt.append(t)
    day += 1
    now = nxt

if all(i <= 0 for i in indeg):
    print(day)
else:
    print(-1)
### BUGGY CODE ###

from functools import reduce


def factorial(end, start=1):
    return reduce(lambda f, i: f * i, list(range(start, end + 1)), 1)


def combination(n, r):
    return factorial(n) // (factorial(r) * factorial(n - r))


N = int(input())
ss = [''.join(sorted(input())) for _ in range(N)]

dp = {}
result = 0

for s in ss:
    if s in dp:
        dp[s] += 1
    else:
        dp[s] = 1

print(reduce(lambda r, key: r + combination(dp[key], 2), dp, 0))


### FIXED CODE ###

from functools import reduce

N = int(input())
dp = {}
result = 0

for _ in range(N):
    s = ''.join(sorted(input()))
    if s in dp:
        dp[s] += 1
    else:
        dp[s] = 1

print(reduce(lambda r, key: r + dp[key] * (dp[key] - 1) // 2, dp, 0))
### BUGGY CODE ###

from collections import deque

N = int(input())
S = input()

def exists(length):
    que = deque()
    V = set()
    for left in range(N - length + 1):
        if left > length - 1:
            V.add(que.popleft())
        T = S[left: left + length]
        if T in V:
            return True
        que.append(T)
    return False

for i in range(1, N + 1)[::-1]:
    if exists(i):
        print(i)
        exit()

print(0)


### FIXED CODE ###

from collections import deque

N = int(input())
S = input()

def isOk(leng):
    hashList = set()
    que = deque([])
    for left in range(N - leng + 1):
        hs = hash(S[left: left + leng])
        if hs in hashList:
            return True
        que.append(hs)
        if len(que) >= leng:
            hashList.add(que.popleft())
    return False

ok = 0
ng = N

while ng - ok > 1:
    mid = (ng + ok) // 2
    if isOk(mid):
        ok = mid
    else:
        ng = mid

print(ok)
### BUGGY CODE ###

# 毎回ソートしても別にいいんじゃないの -> ダメでした

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

while m > 0:
    arr = list(sorted(arr))
    arr[-1] = arr[-1] // 2
    m -= 1

print(sum(arr))


### FIXED CODE ###

# 毎回ソートしても別にいいんじゃないの -> ダメでした
# 毎回最大のものがほしいならheapq使うか
import heapq

n, m = map(int, input().split())
# heapは最小のものを取り出すので予め-1をかけて大小を見かけ上逆転しておく
arr = list(map(lambda x: int(x) * -1, input().split()))
heapq.heapify(arr)
for _ in range(m):
    a = heapq.heappop(arr)
    # 負数にしたときの誤差がめんどくさい
    a *= -1
    a //= 2
    heapq.heappush(arr, a * -1)
print(sum(arr) * -1)
### BUGGY CODE ###

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

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
# def LF(): return [float(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

def main():
  n,k=LI()
  l=LI()
  ind=0

  sm=1
  for i in range(k):
    sm*=l[i]

  before=sm
  ans=[]
  nxt=k
  for _ in range(n-k):
    sm//=l[ind]
    sm*=l[nxt]

    if before<sm:
      ans.append('Yes')
    else:
      ans.append('No')

    before=sm
    ind+=1
    nxt+=1

  for x in ans:
    print(x)

main()
# print(main())


### FIXED CODE ###

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

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
# def LF(): return [float(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

def main():
  n,k=LI()
  l=LI()

  ind=0
  nxt=k
  ans=[]
  for _ in range(n-k):
    if l[ind]<l[nxt]:
      ans.append('Yes')
    else:
      ans.append('No')

    ind+=1
    nxt+=1

  for x in ans:
    print(x)

main()
# print(main())
### BUGGY CODE ###

n,W = map(int,input().split())
w = [0]*n
v = [0]*n
for i in range(n):
    w[i],v[i] = map(int,input().split())

dp = [[0 for _ in range(n+1)] for _ in range(W+1)]
for i in range(1,W+1):
    for j in range(1,n+1):
        if i-w[j-1] >= 0:
            dp[i][j] = max(dp[i-w[j-1]][j-1]+v[j-1],dp[i][j-1])
        else:
            dp[i][j] = dp[i][j-1]

print(dp[W][n])

### FIXED CODE ###

n,W = map(int,input().split())
w = [0]*n
v = [0]*n
for i in range(n):
    w[i],v[i] = map(int,input().split())

dp = [[0 for _ in range(n+1)] for _ in range(W+1)]
for i in range(1,W+1):
    for j in range(1,n+1):
        if i-w[j-1] >= 0:
            dp[i][j] = max(dp[i-w[j-1]][j-1]+v[j-1],dp[i][j-1])
        else:
            dp[i][j] = dp[i][j-1]

print(dp[W][n])
### BUGGY CODE ###

#解説放送見てからの書き直し
import sys
import os
INF = 10**12
ans = INF
N, M = map(int,input().split())
A = [0 for _ in range(M)]
B = [0 for _ in range(M)]
C = []
for i in range(M):
    a, b = map(int,input().split())
    A[i] = a  #鍵の金額
    B[i] = b  #開けられる宝箱の種類数
    tmp = list((map(int,input().split())))
    s = 0
    for j in range(b):
        t = tmp.pop(0)-1
        s |= 1 << t
    C.append(s)
dp = [INF]*(1<<N) #2^N
dp[0] = 0
for s in range(1<<N):
    for j in range(M):
        t = s | C[j]
        cost = dp[s] + A[j]
        dp[t] = min(dp[t],cost)
ans = dp[-1]
if ans == INF:
    ans = -1
print(ans)


### FIXED CODE ###

#解説放送見てからの書き直し
import sys
import os
INF = 10**12
ans = INF
N, M = map(int,input().split())
A = [0 for _ in range(M)]
B = [0 for _ in range(M)]
C = []
for i in range(M):
    a, b = map(int,input().split())
    A[i] = a  #鍵の金額
    B[i] = b  #開けられる宝箱の種類数
    tmp = list((map(int,input().split())))
    s = 0
    for j in range(b):
        t = tmp.pop(0)-1
        s |= 1 << t
    C.append(s)
dp = [INF]*(1<<N) #2^N
dp[0] = 0
for s in range(1<<N):
    for j in range(M):
        t = s | C[j]
        cost = dp[s] + A[j]
        dp[t] = min(dp[t],cost)
ans = dp[-1]
if ans == INF:
    ans = -1
print(ans)
### BUGGY CODE ###

n,m=map(int,input().split())
lista = [int(i) for i in input().split()]
lista.sort()

dic = {}
for i in range(31):
    dic[i] = []

i2 = 0

for i in range(len(lista)):
    while(lista[i]>=2**(i2+1)):
        i2+=1
    dic[i2].append(lista[i])
    
#print(dic)

end = False
for t in range(i2,0,-1):
    list_d = dic[t]
    list_d.sort()
    loop = len(list_d)
    for i in range(loop):
        tmp = list_d[-1]
        dic[t-1].append(tmp/2)
        list_d =  list_d[:-1]
        m = m-1
        if m==0:
            end = True
            dic[t] = list_d
            break
    
    dic[t] = list_d
    if end == True:
        break
        
        
"""print(dic)
print(m)"""
ans = 0
if m > 0:
    ans = n-m
    if ans >= 0:
        print(n-m)
    else:
        print(0)
else:
    for i in range(t+1):
        list_d = dic[i]
        #print(i,list_d)
        for l in range(len(list_d)):
            tmp = list_d[l]
            ans+=int(tmp)
    print(ans)

### FIXED CODE ###

import heapq
n, m = map(int, input().split())
a = list(map(int, input().split()))
a = list(map(lambda x: x * (-1), a))
heapq.heapify(a)
while m != 0:
    price = heapq.heappop(a)
    price = price/2
    m -= 1
    heapq.heappush(a, price)

for i in range(len(a)):
    a[i] = int(a[i])
print(sum(a) * (-1))
### BUGGY CODE ###

S = input()
boundaries = []
boundaries_RL = []
boundaries_LR = []
children = [0 for _ in range(len(S))]

for i in range(1, len(S)):
    if S[i-1] == 'R':
        if S[i] == 'L':
            boundaries.append(i)
            boundaries_RL.append(i)
    elif S[i] == 'R':
        boundaries_LR.append(i)
        boundaries.append(i)

for j in range(len(boundaries)):
    if boundaries[j] in boundaries_LR:
        continue
    else:  # boundaries[j]は、RLとなっているところの、Lのindex
        '''group1: Rより左側のchildren'''
        if j == 0:
            group1 = boundaries[j]
        else:
            group1 = boundaries[j] - boundaries[j-1]
        if group1 % 2 == 0:
            children[boundaries[j]] += group1 // 2
            children[boundaries[j]-1] += group1 // 2
        else:
            children[boundaries[j]-1] += group1 // 2 + 1
            children[boundaries[j]] += group1 // 2
        '''group2: Lより右側のchildren'''
        if j == len(boundaries)-1:
            group2 = len(S) - boundaries[j]
        else:
            group2 = boundaries[j+1] - boundaries[j]
        if group2 % 2 == 0:
            children[boundaries[j]] += group2 // 2
            children[boundaries[j]-1] += group2 // 2
        else:
            children[boundaries[j]] += group2 // 2 + 1
            children[boundaries[j]-1] += group2 // 2

print(*children)


### FIXED CODE ###

S = input()


def solve(s):
    buf = [1] * len(s)

    for i in range(len(buf) - 2):
        if s[i] == "R" and s[i + 1] == "R":
            buf[i+2] += buf[i]
            buf[i] = 0

    for i in range(len(buf) - 1, 1, -1):
        if s[i] == "L" and s[i - 1] == "L":
            buf[i-2] += buf[i]
            buf[i] = 0

    return " ".join(map(str, buf))


print(solve(S))