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

from itertools import combinations

N, K = map(int, input().split())
X = [list(map(int, input().split())) for _ in range(N)]

ans = 10 ** 20
for t in combinations(range(N), K):
    x = []
    y = []
    for i in t:
        x.append(X[i][0])
        y.append(X[i][1])
    ans = min(ans, (max(x) - min(x)) * (max(y) - min(y)))

print(ans)


### FIXED CODE ###

N, K = map(int, input().split())
X = [list(map(int, input().split())) for _ in range(N)]

x = sorted(v for v, _ in X)
y = sorted(v for _, v in X)
ans = 10 ** 20
for i in range(N - 1):
    for j in range(i + 1, N):
        for k in range(N - 1):
            for l in range(k + 1, N):
                x1 = x[i]
                x2 = x[j]
                y1 = y[k]
                y2 = y[l]
                num = 0
                for n in range(N):
                    if x1 <= X[n][0] <= x2 and y1 <= X[n][1] <= y2:
                        num += 1
                if num >= K:
                    ans = min(ans, (x2 - x1) * (y2 - y1))

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

import math

def sieve():
  n = 10**6+1
  primes = [True]*(n+1)
  primes[0],primes[1] = False,False

  for i in range(2,int(math.sqrt(n)+1)):
    if primes[i] == True:
      j = 2
      while i*j <= n:
        primes[i*j] = False
        j += 1

  return primes

def prime_factors(n):
  i = 2
  factors = set()
  while i * i <= n:
    if n % i:
      i += 1
    else:
      n //= i
      factors.add(i)

  if n > 1:
    factors.add(n)
  return factors

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

dic = {}
flg = True
for a in A:
  if primes[a]:
    facs = [a]
  else:
    facs = prime_factors(a)

  for p in facs:
    if p in dic:
      flg = False
      break
    else:
      dic[p] = 1

if flg:
  print("pairwise coprime")
else:
  g = A[0]
  for i in range(1, N):
    g = math.gcd(g, A[i])
  if g == 1:
    print("setwise coprime")
  else:
    print("not coprime")



### FIXED CODE ###

import math

N = int(input())
A = list(map(int,input().split()))
MAX_INT = 10**6
f1 = [0] * (MAX_INT+1)
for a in A:
  f1[a] += 1

flg = True
for i in range(2, MAX_INT+1):
  cnt = 0
  for j in range(i, MAX_INT+1, i):
    cnt += f1[j]
  if cnt > 1:
    flg = False
    break

if flg:
  print("pairwise coprime")
  exit()

g = A[0]
for i in range(1, N):
  g = math.gcd(g, A[i])

if g == 1:
  print("setwise coprime")
else:
  print("not coprime")
### BUGGY CODE ###

from collections import defaultdict
from math import sqrt

Q = int(input())
lr = [list(map(int, input().split())) for _ in range(Q)]

def is_prime(n):
    if n == 1:
        return False

    for k in range(2, int(sqrt(n)) + 1):
        if n % k == 0:
            return False

    return True


# メモ化
dd = defaultdict(bool)

for l, r in lr:
    count = 0
    for i in range(l, r+1, 2):
        if dd[i]:
            count += 1
        else:
            dd[i] = is_prime(i) & is_prime((i+1)//2)
            if dd[i]:
                count += 1
    print(count)

### FIXED CODE ###

Q = int(input())
lr = [list(map(int, input().split())) for _ in range(Q)]
N = 10**5
c = [0] * (N+1)
tf = [False] * (N+1)

for i in range(2, N+1):
    if not tf[i]:
        for j in range(i*2, N+1, i):
            tf[j] = True
for i in range(3, N, 2):
    if not tf[i] and not tf[(i+1)//2]:
        c[i] += 1

for i in range(3, N, 1):
    c[i] += c[i-1]
for l, r in lr:
    print(c[r] - c[l-1])
### BUGGY CODE ###

import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    h, w, m = map(int,input().split()) 
    h_lis = [0] * h
    w_lis = [0] * w
    hw_lis = [] 
    for i in range(m):
        hh, ww = map(int,input().split())
        hh -= 1
        ww -= 1
        h_lis[hh] += 1
        w_lis[ww] += 1
        hw_lis.append((hh, ww))
    h_max_index = [i for i, h in enumerate(h_lis) if h == max(h_lis)]
    w_max_index = [i for i, w in enumerate(w_lis) if w == max(w_lis)]
    for h_i in h_max_index:
        for w_i in w_max_index:
            if not ((h_i, w_i) in hw_lis):
                print(h_lis[h_i]+w_lis[w_i])
                sys.exit()
    print(h_lis[h_i] + w_lis[w_i] - 1)

if __name__=='__main__':
    main()

### FIXED CODE ###

import sys
def input(): return sys.stdin.readline().rstrip()
from bisect import bisect_left,bisect
def main():
    h, w, m = map(int,input().split()) 
    h_lis = [0] * (h+1)
    w_lis = [0] * (w+1)
    bombs = set([tuple(map(int,input().split())) for i in range(m)])
    for hh, ww in bombs:
        h_lis[hh] += 1
        w_lis[ww] += 1
    max_h = max(h_lis)
    max_w = max(w_lis)
    h_max_index = [i for i, h in enumerate(h_lis) if h == max_h]
    w_max_index = [i for i, w in enumerate(w_lis) if w == max_w]
    for h_i in h_max_index:
        for w_i in w_max_index:
            if not (h_i, w_i) in bombs:
                print(h_lis[h_i] + w_lis[w_i])
                sys.exit()
    else:
        print(h_lis[h_i] + w_lis[w_i] - 1)

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

S=input()
T=input()
visited=[]

for i in range(len(S)):
    if (S[i] not in visited) and S[i]!=T[i]:
        visited.append(T[i])
        x=S[i]
        S=S.replace(T[i],'_')
        S=S.replace(S[i],T[i])
        S=S.replace('_',x)
    elif S[i] in visited and S[i]!=T[i]:
        break
    else:
        visited.append(T[i])
print('No') if S!=T else print('Yes')

### FIXED CODE ###

S=input()
T=input()
R=[-1]*26
R2=[-1]*26
flag=1

for i in range(len(S)):
    a=ord(S[i])-97
    b=ord(T[i])-97
    if R[a]!=-1 or R2[b]!=-1:
        if R[a]!=b or R2[b]!=a:
            flag=0
            break
    else:
        R[a]=b
        R2[b]=a
if flag==0:
    print('No')
else:
    print('Yes')
### BUGGY CODE ###

import math

K = int(input())

result = 0
for i in range(1, K+1):
    for j in range(1, K+1):
        for k in range(1, K+1):
            result += math.gcd(i, math.gcd(j, k))
            
print(result)

### FIXED CODE ###

import math
K = int(input())

ans = 0
ab = []
for b in range(1, K+1):
    for a in range(1, K+1):
        ab.append(math.gcd(a, b))
        
for c in range(1, K+1):
    for i in ab:
        ans += math.gcd(c, i)
print(ans)
### BUGGY CODE ###

from collections import deque

def BFS(tree):
    color_used = [set() for _ in range(N)]
    v_dist = [-1]*N

    queue = deque([0])
    v_dist[0] = 0

    while queue:
        v = queue.popleft()
        
        for n_v in tree[v]:
            if v_dist[n_v] < 0:
                v_dist[n_v] = v_dist[v] + 1
                if colors - color_used[v] == set():
                    c_max = max(colors)
                    colors.add(c_max+1)
                    color_used[v].add(c_max+1)
                    color_used[n_v].add(c_max+1)
                    coloring[v][n_v] = c_max + 1
                else:
                    d_color = (colors - color_used[v]).pop()
                    coloring[v][n_v] = d_color
                    color_used[v].add(d_color)
                    color_used[n_v].add(d_color)
                queue.append(n_v)

N = int(input())
tree = [[] for i in range(N)]
edges = []

for i in range(N - 1):
    edges.append(tuple(map(int, input().split())))
    tree[edges[-1][0] - 1].append(edges[-1][1] - 1)
    tree[edges[-1][1] - 1].append(edges[-1][0] - 1)

coloring = [[0]*N for _ in range(N)]
colors = set([1])

BFS(tree)

print(len(colors))

for edge in edges:
    print(coloring[edge[0] - 1][edge[1] - 1])

### FIXED CODE ###

from collections import deque

N = int(input())
tree = [[] for i in range(N)]
edges = []

for i in range(N - 1):
    edges.append(tuple(map(int, input().split())))
    tree[edges[-1][0] - 1].append(edges[-1][1] - 1)
    tree[edges[-1][1] - 1].append(edges[-1][0] - 1)

coloring = {}
c_max = 1

color_used = [0]*N
v_dist = [-1]*N

queue = deque([0])
v_dist[0] = 0

while queue:
    v = queue.popleft()
    
    c = 1
    for n_v in tree[v]:
        if v_dist[n_v] < 0:
            v_dist[n_v] = v_dist[v] + 1

            if color_used[v] == c:
                c += 1
            
            coloring[(v, n_v)] = c
            coloring[(n_v, v)] = c
            color_used[n_v] = c
            queue.append(n_v)

            c += 1
    
    c_max = max(c_max, c)

print(c_max - 1)

for edge in edges:
    print(coloring[(edge[0]-1, edge[1]-1)])
### BUGGY CODE ###

N,M = map(int, input().split())
E = [[int(e) for e in input().split()] for _ in range(M)]

E.sort()
inf = 10**15
seg = [inf]*(2*N-1)

def update(k, x):
    k += N-1
    seg[k] = x
    while k:
        k = (k-1)//2
        seg[k] = min(seg[2*k+1], seg[2*k+2])
        
def query(p, q):
    p += N-1
    q += N-2
    res = inf
    while q-p > 1:
        if p&1 == 0:
            res = min(res, seg[p])
        if q&1 == 1:
            res = min(res, seg[q])
            q -= 1
        p //= 2
        q = (q-1)//2
    if p == q:
        res = min(res, seg[q])
    else:
        res = min(res, seg[p], seg[q])
    return res

update(0, 0)
for e in E:
    d = query(e[1]-1, N)
    l = query(e[0]-1, N)
    if l+e[2] < d:
        update(e[1]-1, l+e[2])

if seg[-1] == inf:
    print(-1)
else:
    print(seg[-1])

### FIXED CODE ###

N,M = map(int, input().split())
E = [[int(e) for e in input().split()] for _ in range(M)]

E.sort()
inf = 10**15
seg = [inf]*(2*N-1)

def update(k, x):
    k += N-1
    seg[k] = x
    while k:
        k = (k-1)//2
        seg[k] = min(seg[2*k+1], seg[2*k+2])
        
def query(p, q):
    p += N-1
    q += N-2
    res = inf
    while q-p > 1:
        if p&1 == 0:
            res = min(res, seg[p])
        if q&1 == 1:
            res = min(res, seg[q])
            q -= 1
        p //= 2
        q = (q-1)//2
    if p == q:
        res = min(res, seg[q])
    else:
        res = min(res, seg[p], seg[q])
    return res

update(0, 0)
for e in E:
    d = query(e[1]-1, N)
    l = query(e[0]-1, N)
    if l+e[2] < d:
        update(e[1]-1, l+e[2])

if seg[-1] == inf:
    print(-1)
else:
    print(seg[-1])
### BUGGY CODE ###

N=int(input())
arr = list(map(int,list(input().split())))
ds = set(arr)
############################################

allxor=0
for i in range(N):
	#allxor=allxor ^ ds.pop()
	allxor=allxor ^ arr[i]

for i in range(N):
	if i==0 :
		s=str(allxor ^ arr[i])
	else:
		s=s + ' ' + str((allxor ^ arr[i]))

print(s)


### FIXED CODE ###

N=int(input())
arr = list(map(int,list(input().split())))
ds = set(arr)
############################################

allxor=0
for i in range(N):
	#if len(ds)==0:
	#	break
	#allxor=allxor ^ ds.pop()
	allxor=allxor ^ arr[i]

for i in range(N):
	print(allxor ^ arr[i],end='')
	print(' ',end='')

#for i in range(N):
#	if i==0 :
#		s=str(allxor ^ arr[i])
#	else:
#		s=s + ' ' + str((allxor ^ arr[i]))
#print(s)
### BUGGY CODE ###

import sys
from itertools import product


def main():
    input = sys.stdin.buffer.readline
    n = int(input())
    s = input().strip().decode()
    ans = 0
    for p in product(range(10), repeat=3):
        matched = 0
        for i in range(n):
            if s[i] == str(p[matched]):
                matched += 1
            if matched == 3:
                ans += 1
                break
    print(ans)


if __name__ == "__main__":
    main()


### FIXED CODE ###

import sys
from itertools import product


def main():
    input = sys.stdin.buffer.readline
    n = int(input())
    s = input().strip().decode()
    ans = 0
    for p in product(range(10), repeat=3):
        pointer = 0
        for c in map(str, p):
            while pointer < n:
                if s[pointer] == c:
                    pointer += 1
                    break
                pointer += 1
            else:
                break
        else:
            ans += 1
    print(ans)


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

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

sum_humidai = 0

for person_idx, person_height in enumerate(As):
  
  for other_idx, other_person_height in enumerate(As[person_idx:]):
    if other_person_height < person_height:
      humidai = person_height - other_person_height
      As[person_idx + other_idx] += humidai
      sum_humidai += humidai
      
print(sum_humidai)

### FIXED CODE ###

N = int(input())
As = list(map(int, input().split()))
 
sum_humidai = 0
max_front_person = 0
  
for person_idx, person_height in enumerate(As):
  
  if person_idx == 0:
    continue
    
  max_front_person = max(max_front_person, As[person_idx - 1])
  if max_front_person > person_height:
    humidai = max_front_person - person_height
    sum_humidai += humidai
 
print(sum_humidai)
### BUGGY CODE ###

n, k = map(int, input().split())
uni = [[] for i in range(n)]
ans = []

for i in range(1,n):
    ans.append([1, i+1])

max_k = 0
for i in range(n-2):
    max_k += i + 1
if k > max_k:
    print(-1)
else:
    cnt = max_k - k
    while True:
        for i in range(1,n):
            for j in range(i+1, n):
                if cnt == 0:
                    print(len(ans))
                    for num in ans:
                        print(" ".join(map(str, num)))
                    exit()
                ans.append([i+1, j+1])
                cnt -= 1

### FIXED CODE ###

n, k = map(int, input().split())
uni = [[] for i in range(n)]
ans = []

if n == 2 and k == 0:
    print(1)
    print(1, 2)
    exit()

for i in range(1,n):
    ans.append([1, i+1])

max_k = 0
for i in range(n-2):
    max_k += i + 1
if k > max_k:
    print(-1)
else:
    cnt = max_k - k
    while True:
        for i in range(1,n):
            for j in range(i+1, n):
                if cnt == 0:
                    print(len(ans))
                    for num in ans:
                        print(" ".join(map(str, num)))
                    exit()
                ans.append([i+1, j+1])
                cnt -= 1
### BUGGY CODE ###

n, s = map(int, input().split())
a = list(map(int, input().split()))
mod = 998244353
ans = 0

inv_2 = pow(2, mod-2, mod)
dp = [[0 for _ in range(s+1)] for _ in range(n+1)]
dp[0][0] = pow(2, n, mod)

for i in range(n):
    for j in range(s+1):
        dp[i+1][j] += dp[i][j]
        dp[i+1][j] %= mod

        if j + a[i] <= s:
            dp[i+1][j+a[i]] += dp[i][j] * inv_2
            dp[i+1][j+a[i]] %= mod

#print(dp)
print(dp[n][s])

### FIXED CODE ###

n, s = map(int, input().split())
a = list(map(int, input().split()))
mod = 998244353
ans = 0

inv_2 = pow(2, mod-2, mod)
dp = [[0 for _ in range(s+1)] for _ in range(n+1)]
dp[0][0] = pow(2, n, mod)

for i in range(n):
    for j in range(s+1):
        dp[i+1][j] += dp[i][j]
        dp[i+1][j] %= mod

        if j + a[i] <= s:
            dp[i+1][j+a[i]] += dp[i][j] * inv_2
            dp[i+1][j+a[i]] %= mod

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

N = int(input())

s = [None] * N
l, c, r = 0, N//2, N-1

while True:
    for i in (l, c, r):
        if s[i] == None:
            print(i, flush=True)
            s[i] = input()
        if s[i] == 'Vacant':
            print(i)
            exit()
    if s[l] != s[c]:
        r = c
        c = (l + r) // 2
    else:
        l = c
        c = (l + r) // 2


### FIXED CODE ###

N = int(input())

s = [None] * N
l, c, r = 0, N//2, N-1

while True:
    for i in (l, c, r):
        if s[i] == None:
            print(i, flush=True)
            s[i] = input()
            if s[i] == 'Vacant':
                exit()
    if ((c-l)%2==0 and s[l]!=s[c]) or ((c-l)%2 and s[l]==s[c]):
        r = c
        c = (l + r) // 2
    else:
        l = c
        c = (l + r) // 2
### BUGGY CODE ###

import sys
import math
from collections import deque

sys.setrecursionlimit(1000000)
MOD = 10 ** 9 + 7
input = lambda: sys.stdin.readline().strip()
NI = lambda: int(input())
NMI = lambda: map(int, input().split())
NLI = lambda: list(NMI())
SI = lambda: input()


def make_grid(h, w, num): return [[int(num)] * w for _ in range(h)]


class BIT():
    def __init__(self, n):
        """
        1-index
        sum -> i番目までの和
        add -> i番目にxを足す
        :param n:
        """
        self.n = n
        self.data = [0]*(n+1)
        self.each = [0]*(n+1)

    def sum(self, i):
        s = 0
        while i > 0:
            s += self.data[i]
            i -= i & -i
        return s

    def add(self, i, x):
        self.each[i] += x
        while i <= self.n:
            self.data[i] += x
            i += i & -i

    def __str__(self):
        return str(self.each)



def main():
    N, Q = NMI()
    C = [0]+NLI()
    querys = [[i]+NLI() for i in range(Q)]
    querys.sort(key=lambda x: x[2])
    ans = [0] * Q
    last_index = [-1] * (N+1)
    tree = BIT(N)
    idx = 1
    for query in querys:
        qi, ql, qr = query
        while idx <= N and idx <= qr:
            color = C[idx]
            if last_index[color] != -1:
                tree.add(last_index[color], -1)

            tree.add(idx, 1)
            last_index[color] = idx
            idx += 1

        ans[qi] = tree.sum(qr) - tree.sum(ql-1)

    for a in ans:
        print(a)




if __name__ == "__main__":
    main()

### FIXED CODE ###

import sys
import math
from collections import defaultdict

sys.setrecursionlimit(1000000)
MOD = 10 ** 9 + 7
input = lambda: sys.stdin.readline().strip()
NI = lambda: int(input())
NMI = lambda: map(int, input().split())
NLI = lambda: list(NMI())
SI = lambda: input()


def make_grid(h, w, num): return [[int(num)] * w for _ in range(h)]


class BIT():
    def __init__(self, n):
        """
        1-index
        sum -> i番目までの和
        add -> i番目にxを足す
        :param n:
        """
        self.n = n
        self.data = [0]*(n+1)
        self.each = [0]*(n+1)

    def sum(self, i):
        s = 0
        while i > 0:
            s += self.data[i]
            i -= i & -i
        return s

    def add(self, i, x):
        self.each[i] += x
        while i <= self.n:
            self.data[i] += x
            i += i & -i

    def __str__(self):
        return str(self.each)



def main():
    N, Q = NMI()
    C = [0]+NLI()
    d_querys = [[i]+NLI() for i in range(Q)]
    querys = defaultdict(list)
    for qi, ql, qr in d_querys:
        querys[qr].append((qi, ql))

    ans = [0] * Q
    last_index = [-1] * (N+1)
    index_dict = defaultdict(list)
    tree = BIT(N)

    for i, color in enumerate(C):
        if color == 0: continue
        idx = last_index[color]
        if idx != -1:
            index_dict[i].append((idx, i))
        last_index[color] = i
        tree.add(i, 1)

    for i in range(1, N+1):
        for idx, _ in index_dict[i]:
            tree.add(idx, -1)
        for qi, ql in querys[i]:
            ans[qi] = tree.sum(i) - tree.sum(ql-1)

    for a in ans:
        print(a)




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

# -*- coding: utf-8 -*-

import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
# 20億^2で10^18を超えるので19乗で
INF = 10 ** 19
MOD = 10 ** 9 + 7

N, K = MAP()
XY = []
for i in range(N):
    x, y = MAP()
    XY.append((x, y))

ans = INF
# 4点組み合わせ全部試す
for i in range(N):
    x1, y1 = XY[i]
    for j in range(N):
        x2, y2 = XY[j]
        for i in range(N):
            x3, y3 = XY[i]
            for j in range(N):
                x4, y4 = XY[j]
                xl, xr = min(x1, x2, x3, x4), max(x1, x2, x3, x4)
                yl, yr = min(y1, y2, y3, y4), max(y1, y2, y3, y4)
                # 4点の内側にいくつ点があるか数える
                k = 0
                for x5, y5 in XY:
                    if xl <= x5 <= xr and yl <= y5 <= yr:
                        k += 1
                if k >= K:
                    ans = min(ans, (xr-xl) * (yr-yl))
print(ans)


### FIXED CODE ###

# -*- coding: utf-8 -*-

"""
・座標圧縮
・2次元累積和
"""

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

X, Y = [0]*N, [0]*N
for i in range(N):
    X[i], Y[i] = map(int, input().split())

# 座標圧縮
zip_x, zip_y, unzip_x, unzip_y = {}, {}, {}, {}
X2 = sorted(set(X))
Y2 = sorted(set(Y))
# この後の処理のために添字は1-indexedにする
for i in range(len(X2)):
    zip_x[X2[i]] = i+1
    unzip_x[i+1] = X2[i]
for i in range(len(Y2)):
    zip_y[Y2[i]] = i+1
    unzip_y[i+1] = Y2[i]

# 圧縮した座標に点を割り当て(グリッドは累積和用に一回り大きく作る)
grid = [[0] * (len(X2)+1) for _ in range(len(Y2)+1)]
for i in range(N):
    grid[zip_y[Y[i]]][zip_x[X[i]]] += 1

# 2次元累積和
for i in range(len(Y2)+1):
    for j in range(1, len(X2)+1):
        grid[i][j] += grid[i][j-1]
for i in range(1, len(Y2)+1):
    for j in range(len(X2)+1):
        grid[i][j] += grid[i-1][j]

ans = float('inf')
for i in range(1, len(Y2)+1):
    for j in range(1, len(X2)+1):
        # 終点がK以上あれば始点を動かし始める
        if grid[i][j] >= K:
            for k in range(i):
                for l in range(j):
                    # 部分累積和を出して、点がK以上あるか確認
                    if grid[i][j] - grid[i][l] - grid[k][j] + grid[k][l] >= K:
                        # 長方形の面積を出して最小を保持
                        ans = min((unzip_x[j]-unzip_x[l+1]) * (unzip_y[i]-unzip_y[k+1]), ans)
print(ans)
### BUGGY CODE ###

import math
from collections import deque
S = input()
index = []
L_kyoukai = []
R_kyoukai = [0]
flag = False
for i in range(1, len(S)):
    if flag is False and S[i] == "L":
        L_kyoukai.append(i)
        R_kyoukai.append(i - 1)
        index.append(i - 1)
        index.append(i)
        flag = True
    if flag is True and S[i] == "R":
        L_kyoukai.append(i - 1)
        R_kyoukai.append(i)
        flag = False
ans = [0 for _ in range(len(index))] 
hokan_index = []
L_kyoukai.append(len(S) - 1)
r_diff = [R_kyoukai[i + 1] - R_kyoukai[i] + 1 for i in range(0, len(R_kyoukai), 2)]
l_diff = [L_kyoukai[i + 1] - L_kyoukai[i] + 1 for i in range(0, len(L_kyoukai), 2)]
for j, (r, l) in enumerate(zip(r_diff, l_diff)):
    tmp = math.ceil(r / 2)
    ans[2 * j] += tmp
    ans[2 * j + 1] += r - tmp
    tmp = math.ceil(l / 2)
    ans[2 * j + 1] += tmp
    ans[2 * j] += l - tmp
q = deque(ans)    
answer = ""
for i in range(len(S)):
    if i in index:
        answer += str(q.popleft())
        answer += " "
    else:
        answer += "0 "
print(answer)        

### FIXED CODE ###

import math
from collections import deque
S = input()
L_kyoukai = []
R_kyoukai = [0]
flag = False
for i in range(1, len(S)):
    if flag is False and S[i] == "L":
        L_kyoukai.append(i)
        R_kyoukai.append(i - 1)
        flag = True
    if flag is True and S[i] == "R":
        L_kyoukai.append(i - 1)
        R_kyoukai.append(i)
        flag = False
ans = []
L_kyoukai.append(len(S) - 1)
r_diff = [R_kyoukai[i + 1] - R_kyoukai[i] + 1 for i in range(0, len(R_kyoukai), 2)]
l_diff = [L_kyoukai[i + 1] - L_kyoukai[i] + 1 for i in range(0, len(L_kyoukai), 2)]
for r, l in zip(r_diff, l_diff):
    tmp_1 = math.ceil(r / 2)
    tmp_2 = math.ceil(l / 2)
    ans.append(tmp_1 + l - tmp_2)
    ans.append(r - tmp_1 + tmp_2)
q = deque(ans)    
answer = ""

for i in range(len(S)):
    if 1 <= i <= len(S) - 2:
        if (S[i] == "L" and S[i - 1] == "R") or (S[i] == "R" and S[ i + 1] == "L"):
            answer += str(q.popleft())
            answer += " "
        else:
            answer += "0 "
    elif i == 0:
        if S[i + 1] == "L":
            answer += str(q.popleft())
            answer += " "
        else:
            answer += "0 "
    elif i == len(S) - 1:
        if S[i - 1] == "R":
            answer += str(q.popleft())
            answer += " "
        else:
            answer += "0 "

print(answer)