let inputs = readLine()!.split(separator: " ")
for i in 0..<inputs.count {
  if inputs[i] == "0" {
    print(i + 1)
  }
}


class A {
    static func solve() {
        let xs = readLine()!.split(separator: " ")
        if xs[0] != "1" {
            print("1")
        } else if xs[1] != "2" {
            print("2")
        } else if xs[2] != "3" {
            print("3")
        } else if xs[3] != "4" {
            print("4")
        } else if xs[4] != "5" {
            print("5")
        }
    }
}

A.solve()


class Scanner {
    private var stack = [String]()
    private var index = 0

    func peek() -> String {
        if stack.count == index {
            stack += readLine()!.split(separator: " ").map{ String($0) }
        }
        return stack[index]
    }

    func next() -> String {
        let value = peek()
        index += 1
        return value
    }

    func nextInt() -> Int {
        return Int(next())!
    }

    func nextDouble() -> Double {
        return Double(next())!
    }
}

var scanner = Scanner()
var A = [Int]()
for _ in 0 ..< 5 {
    A.append(scanner.nextInt())
}
print(A.firstIndex(where: { $0 == 0 })! + 1)


var str = readLine()!
str = str.replacingOccurrences(of: " ", with: "")
for (i, v) in str.enumerated() {
    if v == "0" {
        print(i + 1)
    }
}


class D {
    static func solve() {
        let _ = readLine()
        let _As = readLine()!.split(separator: " ").map { Int($0)! }
        let As = Array(Set(_As)).sorted()

        if As.count <= 1 {
            print("0")
            return
        }

        var ans = 0
        for i in 0..<As.count {
            var found = false
            for j in 0..<As.count {
                if i != j && As[i] % As[j] == 0 {
                    found = true
                    break
                }
            }
            if !found {
                ans += 1
            }
        }

        print(ans)
    }
}

D.solve()


let a = readLine()!.split(separator: " ").map({Int($0)})
for i in 0 ..< 5 {
    if a[i] != i {
        print(i+1)
    }
}


import { readFileSync } from "fs";

const read = () =>
  readFileSync(0, "utf8")
    .split("\n")
    .map((line) => line.split(" "));

const main = (input: string[][]) => {
  const X = input[0].map(Number);

  let answer = 0;

  X.forEach((x, index) => {
    if (x === 0) {
      answer = index + 1;
    }
  });

  return answer;
};

console.log(main(read()));


// import std = require('tstl')

{
  type Print = void | string | number | string[] | number[]
  let outs: Print[] = []

  const main = (): Print => {
    const r = _io()
    const x = r.nn()

    return x.indexOf(0) + 1
  }

  const _io = (i = 0) => {
    const str = require('fs').readFileSync('/dev/stdin', 'utf8')
    const lines = str.trim().split('\n')
    const s = () => lines[i++] || ''
    const n = () => Number(s())

    const mn = (v: string[]) => v.map(Number)
    const sp = (v: string) => v.split(' ')

    const ss = () => sp(s())
    const nn = () => mn(ss())
    const nls = () => mn(lines.slice(i))
    const nnls = () => lines.slice(i).map((v) => mn(sp(v)))

    return { lines, s, n, ss, nn, nls, nnls }
  }

  outs.push(main())

  console.log(
    outs
      .map((line) => (typeof line === 'object' ? line.join(' ') : String(line)))
      .join('\n')
  )
}


export class Main {
  static main(input: string): string {
    const tmp: string[] = input.split("\n");
    const x: number[] = tmp.shift().split(" ").map(int => parseInt(int));
    for (let i = 1; i <= 5; i++) {
      if (x[i - 1] == 0) {
        return `${i}`;
      }
    }
    return `No`;
  }
}
console.log(Main.main(require("fs").readFileSync("/dev/stdin", "utf8")));


import * as fs from "fs";
const x = fs.readFileSync("/dev/stdin", "utf8").split(" ").map(item => parseInt(item));

console.log(solve(x));

function solve(x: number[]): number {
    return x.findIndex((item) => item == 0)
}


import * as fs from "fs";

// one line
const input = fs.readFileSync("/dev/stdin", "utf8").split(" ");

console.log(input.indexOf("0") + 1);


import * as fs from 'fs';

const input = fs.readerFileSync('/dev/stdin', "utf8");
console.log(input.split(" ").findIndex(0) + 1);


def main():
    s=input()
    s+="R"
    n=len(s)
    ans=[0]*(n-1)
    res="R"
    resRL=0
    cnt=0
    cntR=0
    for i in range(n):
        if s[i]==res:
            cnt+=1
            if s[i]=="R":
                cntR+=1
        elif s[i]=="L":
            cnt+=1
            res="L"
            resRL=i
        else:
            if cnt%2==0:
                ans[resRL-1]=cnt//2
                ans[resRL]=cnt//2
            elif cntR%2==0:
                ans[resRL-1]=cnt//2
                ans[resRL]=cnt//2+1
            else:
                ans[resRL-1]=cnt//2+1
                ans[resRL]=cnt//2
            cnt=1
            cntR=1
            res="R"
            resRL=0
    print(" ".join(str(_) for _ in ans))
if __name__=="__main__":
    main()


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

def solve():
    S = input()
    res_l = []
    r,l = 0,1
    for i,s in enumerate(S+'R'):
        if s == 'R':
            if l:
                if res_l:
                    res_l[i-l] = r//2 + (l+1)//2
                    res_l[i-l-1] = (r+1)//2 + l//2

                r,l = 1,0
            else:
                r += 1
            res_l.append(0)
        else:
            l += 1
            res_l.append(0)

    res = ' '.join(list(map(str,res_l[:-1])))
    return str(res)

if __name__ == '__main__':
    print(solve())


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

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

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

    print(' '.join(map(str, ans_l)))

if __name__ == '__main__':
    solve()


S = input()
s = len(S)
shift = 10**100
K = shift.bit_length()

def db(A:list, k:int):
    dv = [[0]*s for _ in range(k+1)]
    dv[0] = A
    for kk in range(1,k+1):
        for n in range(s):
            dv[kk][n] = dv[kk-1][dv[kk-1][n]]
    return dv[k]

a = [1+n if i == "R" else n-1 for n,i in enumerate(S)]

for i in range(1,K):
    if (shift >> i)&1:
        a = db(a, i)
ans = [0]*s
for j in a:
    ans[j]+=1
print(*ans)


import numpy as np

S = input()
s = len(S)
shift = 10**100
K = shift.bit_length()

ini_ad = np.array([1 if i == "R" else -1 for i in S])

def db(A:list, k:int):
    dv = np.array([[0]*s for _ in range(k+1)])
    dv[0] = A
    for kk in range(1,k+1):
        for n in range(s):
            dv[kk][n] = dv[kk-1][dv[kk-1][n]]
    return dv[k]

a = list(range(s))+ini_ad
for i in range(1,K):
    if (shift >> i)&1:
        a = db(a, i)
ans = [0]*s
for j in a:
    ans[j]+=1
print(*ans)


import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Arrays;

public class Main {
	private static final int MOD = 1_000_000_007;

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		char[] S = sc.next().toCharArray();

		int right = 1;
		int left = 0;
		int center = -1;
		int[] ans = new int[S.length];
		for (int i = 1; i < S.length; i++) {
			if (S[i - 1] == 'L' && S[i] == 'R') {
				int sum = right + left;
				int mod = sum % 2;
				ans[center - 1] = sum / 2 + ((right % 2 == 1) ? mod : 0);
				ans[center] = sum / 2 + ((left % 2 == 1) ? mod : 0);
				right = 0;
				left = 0;
			}

			if (S[i] == 'R') {
				right++;
			} else if (S[i] == 'L') {
				left++;
			}

			if (S[i - 1] == 'R' && S[i] == 'L') {
				center = i;
			}
		}

		int sum = right + left;
		int mod = sum % 2;
		ans[center - 1] = sum / 2 + ((right % 2 == 1) ? mod : 0);
		ans[center] = sum / 2 + ((left % 2 == 1) ? mod : 0);

		StringBuilder sb = new StringBuilder();
		for (int a : ans) {
			sb.append(a).append(" ");
		}

		System.out.println(sb.toString().trim());

	}

	public static class Pair {
		private int index;
		private int value;

		public Pair(int index, int value) {
			super();
			this.index = index;
			this.value = value;
		}

		public int getIndex() {
			return index;
		}

		public int getValue() {
			return value;
		}

		@Override
		public String toString() {
			return "[" + index + ":" + value + "]";
		}
	}

	private static boolean isDebug = System.getProperty("sun.desktop") != null;

	private static void debug(Object... o) {
		if (isDebug) {
			System.err.println(Arrays.deepToString(o));
		}
	}

	private static long gcd(long m, long n) {
		long temp;
		while (m % n != 0) {
			temp = n;
			n = m % n;
			m = temp;
		}
		return n;
	}

	private static long lcm(long m, long n) {
		return m / gcd(m, n) * n;
	}

	private static int add(int a, int b) {
		return (a + b) % MOD;
	}

	private static int sub(int a, int b) {
		return (a - b % MOD) % MOD;
	}

	private static int mul(int a, int b) {
		return ((a % MOD) * (b % MOD)) % MOD;
	}

	public static class Scanner {
		private BufferedInputStream inputStream;

		public Scanner(InputStream in) {
			inputStream = new BufferedInputStream(in);
		}

		public char nextChar() throws IOException {
			return (char) skip();
		}

		public int nextInt() throws IOException {
			int num = 0;

			int read = skip();
			do {
				num = num * 10 + (read - 0x30);
			} while ((read = inputStream.read()) > 0x20);

			return num;
		}

		public void fill(int[] a) throws IOException {
			for (int i = 0; i < a.length; i++) {
				a[i] = nextInt();
			}
		}

		public void fill(int[] a, int[] b) throws IOException {
			if (a.length != b.length) {
				throw new IllegalArgumentException();
			}

			for (int i = 0; i < a.length; i++) {
				a[i] = nextInt();
				b[i] = nextInt();
			}
		}

		public long nextLong() throws IOException {
			long num = 0;

			int read = skip();
			do {
				num = num * 10 + (read - 0x30);
			} while ((read = inputStream.read()) > 0x20);

			return num;
		}

		public void fill(long[] a) throws IOException {
			for (int i = 0; i < a.length; i++) {
				a[i] = nextLong();
			}
		}

		public void fill(long[] a, long[] b) throws IOException {
			if (a.length != b.length) {
				throw new IllegalArgumentException();
			}

			for (int i = 0; i < a.length; i++) {
				a[i] = nextLong();
				b[i] = nextLong();
			}
		}

		public long[] nextLong(int n) throws IOException {
			long[] array = new long[n];
			for (int i = 0; i < n; i++) {
				array[i] = nextLong();
			}

			return array;
		}

		public String next() throws IOException {
			StringBuilder builder = new StringBuilder();

			int read = skip();
			do {
				builder.append((char) read);
			} while ((read = inputStream.read()) > 0x20);

			return builder.toString();
		}

		private int skip() throws IOException {
			int read;
			while ((read = inputStream.read()) <= 0x20)
				;

			return read;
		}
	}
}


import java.io.*;
import java.util.*;
public class Main{
    public static void main(String[] args) throws IOException{
        MyReader rd = new MyReader();
        String S = rd.s();
        int N = S.length();
        int[] ans = new int[N];
        for(int i = 0; i < N;){
            int j = i;
            while(S.charAt(j) == 'R')
                j++;
            int r = j-1;
            int l = j;
            while(j < N && S.charAt(j) == 'L')
                j++;
            int rn = r-i+1;
            int ln = j-l;
            ans[r] = ((rn+1)>>1)+(ln>>1);
            ans[l] = (rn>>1)+((ln+1)>>1);
            i = j;
        }
        StringBuilder sb = new StringBuilder();
        for(int a : ans)
            sb.append(a).append(" ");
        println(sb);
    }
    static void print(Object o){
        System.out.print(o.toString());
    }
    static void println(Object o){
        System.out.println(o.toString());
    }
    static int Int(String s){
        return Integer.parseInt(s);
    }
    static long Long(String s){
        return Long.parseLong(s);
    }
    static class MyReader extends BufferedReader{
        MyReader(){
            super(new InputStreamReader(System.in));
        }
        String s() throws IOException{
            return readLine();
        }
        String[] ss() throws IOException{
            return s().split(" ");
        }
        int i() throws IOException{
            return Int(s());
        }
        int[] ii() throws IOException{
            String[] ss = ss();
            int size = ss.length;
            int[] ii = new int[size];
            for(int j = 0; j < size; j++) ii[j] = Integer.parseInt(ss[j]);
            return ii;
        }
        long l() throws IOException{
            return Long(s());
        }
        long[] ll() throws IOException{
            String[] ss = ss();
            int size = ss.length;
            long[] ll = new long[size];
            for(int j = 0; j < size; j++) ll[j] = Long.parseLong(ss[j]);
            return ll;
        }
    }
}


import java.util.*;
import java.io.*;

class Main{
    public static void main(String[] args){
        FastScanner fs = new FastScanner();
        char[] s = (fs.next()+'R').toCharArray();
        int n = s.length;
        int[] res = new int[n];
        int prev = -1;
        for(int i=0;i<n-1;i++){
            if(s[i]!=s[i+1]){
                if(s[i]=='R'){
                    res[i]+=(i-prev+1)/2;
                    res[i+1]+=(i-prev)/2;
                    prev = i;
                }else{
                    res[prev]+=(i-prev)/2;
                    res[prev+1]+=(i-prev+1)/2;
                    prev = i;
                }
            }
        }
        StringJoiner sj = new StringJoiner(" ");
        for(int i=0;i<n-1;i++){
            sj.add(String.valueOf(res[i]));
        }
        System.out.println(sj.toString());
    }
    static class FastScanner{
        private final InputStream in = System.in;
        private final byte[] buffer = new byte[1024];
        private int ptr = 0;
        private int buflen = 0;

        private boolean hasNextByte(){
            if(ptr < buflen){
                return true;
            }else{
                ptr = 0;
                try{
                    buflen = in.read(buffer);
                }catch(IOException e){
                    e.printStackTrace();
                }
                if(buflen <= 0){
                    return false;
                }
            }
            return true;
        }

        private int readByte(){
            if(hasNextByte())return buffer[ptr++];
            else return -1;
        }

        private boolean isPrintableChar(int c){
            return 33<=c && c<=126;
        }

        public boolean hasNext(){
            while(hasNextByte() && !isPrintableChar(buffer[ptr]))ptr++;
            return hasNextByte();
        }

        public String next(){
            if(!hasNext()) throw new NoSuchElementException();
            StringBuilder sb = new StringBuilder();
            int b = readByte();
            while(isPrintableChar(b)){
                sb.appendCodePoint(b);
                b = readByte();
            }
            return sb.toString();
        }

        public long nextLong(){
            if(!hasNext()) throw new NoSuchElementException();
            long n = 0;
            boolean minus = false;
            int b = readByte();
            if(b == '-'){
                minus = true;
                b = readByte();
            }
            if(b < '0' || '9' < b){
                throw new NumberFormatException();
            }
            while(true){
                if('0' <= b && b<='9'){
                    n*=10;
                    n+=b-'0';
                }else if(b==-1 || !isPrintableChar(b)){
                    return minus ? -n : n;
                }else{
                    throw new NumberFormatException();
                }
                b = readByte();
            }
        }
        public int nextInt(){
            long nl = nextLong();
            if(nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE)throw new NumberFormatException();
            return (int)nl;
        }
        public double nextDouble(){return Double.parseDouble(next());}
    }
}


import java.util.*;

public class Main {

    static int gcd (int a, int b) {return b>0?gcd(b,a%b):a;}
    static long mod = 1000000007;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char[] S = sc.next().toCharArray();

        int point =0;
        int rCount =0;
        int lCount =0;
        boolean rCounting = true;
        int[] ans = new int[S.length];
        for(int i=0;i<S.length;i++){

            if(i>0 && S[i] == 'R' && S[i-1] == 'L'){
                ans[point-1] = (rCount +1)/2 + lCount/2;
                ans[point] = (lCount+1)/2 + rCount/2;
                rCounting = true;
                rCount = 1;
                lCount = 0;

            } else if(i>0 && S[i] == 'L' && S[i-1] == 'R'){
                point = i;
                rCounting = false;
                lCount = 1;

            } else {
                if(rCounting){
                    rCount++;
                } else {
                    lCount++;
                }

            }

            if(i == S.length-1) {
                ans[point] = (rCount +1)/2 + lCount/2;
                ans[point-1] = (lCount+1)/2 + rCount/2;
            }

        }

        for(int a: ans){
            System.out.print(a + " ");

        }

    }

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str[] = br.readLine().split("");

		int n = str.length;

		ArrayList<Integer> R = new ArrayList<>();
		ArrayList<Integer> L = new ArrayList<>();

		int a[] = new int[n];

		for (int i = 0; i < n - 1; i++) {
			if (str[i].equals("R") && str[i + 1].equals("L")) {
				R.add(i);
				L.add(i + 1);
				a[i] = 1;
				a[i + 1] = 1;
			}
		}

		Collections.sort(R);
		Collections.sort(L);

		Integer r[] = R.toArray(new Integer[R.size()]);
		Integer l[] = L.toArray(new Integer[L.size()]);

		for (int i = 0; i < n; i++) {
			if (R.contains(i) || L.contains(i)) {
				continue;
			}

			a[i] = 0;

			int min = Integer.MAX_VALUE;
			int index = 0;

			if (str[i].equals("R")) {
				int upper = ~Arrays.binarySearch(r, i, (x, y) -> x.compareTo(y) > 0 ? 1 : -1);
				index = R.get(upper);
				min = R.get(upper) - i;
			} else {
				int upper = ~Arrays.binarySearch(l, i, (x, y) -> x.compareTo(y) > 0 ? 1 : -1);
				index = L.get(upper - 1);
				min = i - L.get(upper - 1);
			}

			if (min % 2 == 0) {
				a[index]++;
			} else {
				if (str[i].equals("R"))
					a[index + 1]++;
				else
					a[index - 1]++;
			}
		}

		System.out.print(a[0]);
		for (int i = 1; i < n; i++) {
			System.out.print(" " + a[i]);
		}
	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str[] = br.readLine().split("");

		int n = str.length;

		ArrayList<Integer> R = new ArrayList<>();
		ArrayList<Integer> L = new ArrayList<>();

		int a[] = new int[n];

		for (int i = 0; i < n - 1; i++) {
			if (str[i].equals("R") && str[i + 1].equals("L")) {
				R.add(i);
				L.add(i + 1);
				a[i] = 1;
				a[i + 1] = 1;
			}
		}

		for (int i = 0; i < n; i++) {
			if (R.contains(i) || L.contains(i)) {
				continue;
			}

			a[i] = 0;

			int min = Integer.MAX_VALUE;
			int index = 0;

			if (str[i].equals("R")) {
				for (int j = 0; j < R.size(); j++) {
					if (R.get(j) > i) {
						if (min > R.get(j) - i) {
							min = R.get(j) - i;
							index = R.get(j);
						}
					}
				}
			} else {
				for (int j = 0; j < L.size(); j++) {
					if (L.get(j) < i) {
						if (min > i - L.get(j)) {
							min = i - L.get(j);
							index = L.get(j);
						}
					}
				}
			}

			if (min % 2 == 0) {
				a[index]++;
			} else {
				if (str[i].equals("R"))
					a[index + 1]++;
				else
					a[index - 1]++;
			}
		}

		System.out.print(a[0]);
		for (int i = 1; i < n; i++) {
			System.out.print(" " + a[i]);
		}
	}
}


//#include<bits/stdc++.h>
#include<cstdio>

using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define Would
#define you
#define please

const int dm = 1 << 19;
char dn[dm], * di = dn;
inline void putint(int X) {
	if (X == 0) {
		*di++ = '0';
		*di++ = ' ';
		return;
	}
	int keta = 0;
	char C[20];
	while (X) {
		*(C + keta) = '0' + X % 10;
		X /= 10;
		keta++;
	}
	for (int i = keta - 1; i >= 0; i--)* di++ = (*(C + i));
	*di++ = ' ';
}

int main() {
	//cin.tie(0);
	//ios::sync_with_stdio(false);

	char S[100001];
	int N = fread_unlocked(S, 1, 100001, stdin);
	if (S[N - 1] == '\n') N--;
	int kotae[100000] = {};

	int k = 0;
	rep(i, N) {
		if (S[i] == 'R') {
			k++;
		}
		else {
			kotae[i - 1] += (k + 1) / 2;
			kotae[i] += k / 2;
			k = 0;
		}
	}
	k = 0;
	for (int i = N - 1; i >= 0; i--) {
		if (S[i] == 'L') {
			k++;
		}
		else {
			kotae[i + 1] += (k + 1) / 2;
			kotae[i] += k / 2;
			k = 0;
		}
	}

	rep(i, N) putint(kotae[i]);
	fwrite_unlocked(dn, di - dn - 1, 1, stdout);

	Would you please return 0;
}


#pragma GCC optimize ("O3")
#include "bits/stdc++.h"

using namespace std;
using ll = long long int;

#define debugos cout
#define debug(v) {printf("L%d %s > ",__LINE__,#v);debugos<<(v)<<endl;}
#define debugv(v) {printf("L%d %s > ",__LINE__,#v);for(auto e:(v)){debugos<<e<<" ";}debugos<<endl;}
#define debuga(m,w) {printf("L%d %s > ",__LINE__,#m);for(int x=0;x<(w);x++){debugos<<(m)[x]<<" ";}debugos<<endl;}
#define debugaa(m,h,w) {printf("L%d %s >\n",__LINE__,#m);for(int y=0;y<(h);y++){for(int x=0;x<(w);x++){debugos<<(m)[y][x]<<" ";}debugos<<endl;}}
#define all(v) (v).begin(),(v).end()
#define repeat(cnt,l) for(auto cnt=decltype(l)();(cnt)<(l);++(cnt))
#define rrepeat(cnt,l) for(auto cnt=(l)-1;0<=(cnt);--(cnt))
#define iterate(cnt,b,e) for(auto cnt=(b);(cnt)!=(e);++(cnt))
#define diterate(cnt,b,e) for(auto cnt=(b);(cnt)!=(e);--(cnt))
const ll MD = 1000000007ll; const long double PI = 3.1415926535897932384626433832795L;
inline void assert_call(bool assertion, function<void()> f) { if (!assertion) { cerr << "assertion fault:" << endl; f(); abort(); } }
template<typename T1, typename T2> inline ostream& operator <<(ostream &o, const pair<T1, T2> p) { o << '(' << p.first << ':' << p.second << ')'; return o; }
template<typename Vec> inline ostream& _ostream_vecprint(ostream& os, const Vec& a) {
    os << '['; for (const auto& e : a) os << ' ' << e << ' '; os << ']'; return os; }
template<typename T> inline ostream& operator<<(ostream& o, const vector<T>& v) { return _ostream_vecprint(o, v); }
template<typename T, size_t S> inline ostream& operator<<(ostream& o, const array<T, S>& v) { return _ostream_vecprint(o, v); }
template<typename T> inline T& chmax(T& to, const T& val) { return to = max(to, val); }
template<typename T> inline T& chmin(T& to, const T& val) { return to = min(to, val); }
void bye(string s, int code = 0) { cout << s << endl; exit(code); }
mt19937_64 randdev(8901016);
template<typename T, typename Random = decltype(randdev), typename enable_if<is_integral<T>::value>::type* = nullptr>
inline T rand(T l, T h, Random& rand = randdev) { return uniform_int_distribution<T>(l, h)(rand); }
template<typename T, typename Random = decltype(randdev), typename enable_if<is_floating_point<T>::value>::type* = nullptr>
inline T rand(T l, T h, Random& rand = randdev) { return uniform_real_distribution<T>(l, h)(rand); }

#if defined(_WIN32) || defined(_WIN64)
#define getc_x _getc_nolock
#define putc_x _putc_nolock
#elif defined(__GNUC__)
#define getc_x getc_unlocked
#define putc_x putc_unlocked
#else
#define getc_x getc
#define putc_x putc
#endif
#define isvisiblechar(c) (0x21<=(c)&&(c)<=0x7E)
class MaiScanner {
    FILE* fp_;
public:
    inline MaiScanner(FILE* fp):fp_(fp){}
    template<typename T> void input_integer(T& var) noexcept {
        var = 0; T sign = 1;
        int cc = getc_x(fp_);
        for (; cc < '0' || '9' < cc; cc = getc_x(fp_))
            if (cc == '-') sign = -1;
        for (; '0' <= cc && cc <= '9'; cc = getc_x(fp_))
            var = (var << 3) + (var << 1) + cc - '0';
        var = var * sign;
    }
    inline int c() noexcept { return getc_x(fp_); }
    inline MaiScanner& operator>>(int& var) noexcept { input_integer<int>(var); return *this; }
    inline MaiScanner& operator>>(long long& var) noexcept { input_integer<long long>(var); return *this; }
    inline MaiScanner& operator>>(string& var) {
        int cc = getc_x(fp_);
        for (; !isvisiblechar(cc); cc = getc_x(fp_));
        for (; isvisiblechar(cc); cc = getc_x(fp_))
            var.push_back(cc);
        return *this;
    }
    template<typename IT> inline void in(IT begin, IT end) { for (auto it = begin; it != end; ++it) *this >> *it; }
};
class MaiPrinter {
    FILE* fp_;
public:
    inline MaiPrinter(FILE* fp):fp_(fp){}
    template<typename T>
    void output_integer(T var) noexcept {
        if (var == 0) { putc_x('0', fp_); return; }
        if (var < 0)
            putc_x('-', fp_),
            var = -var;
        char stack[32]; int stack_p = 0;
        while (var)
            stack[stack_p++] = '0' + (var % 10),
            var /= 10;
        while (stack_p)
            putc_x(stack[--stack_p], fp_);
    }
    inline MaiPrinter& operator<<(char c) noexcept { putc_x(c, fp_); return *this; }
    inline MaiPrinter& operator<<(int var) noexcept { output_integer<int>(var); return *this; }
    inline MaiPrinter& operator<<(long long var) noexcept { output_integer<long long>(var); return *this; }
    inline MaiPrinter& operator<<(char* str_p) noexcept { while (*str_p) putc_x(*(str_p++), fp_); return *this; }
    inline MaiPrinter& operator<<(const string& str) {
        const char* p = str.c_str();
        const char* l = p + str.size();
        while (p < l) putc_x(*p++, fp_);
        return *this;
    }
    template<typename IT> void join(IT begin, IT end, char sep = ' ') { for (bool b = 0; begin != end; ++begin, b = 1) b ? *this << sep << *begin : *this << *begin; }
};
MaiScanner scanner(stdin);
MaiPrinter printer(stdout);

//

int N;
string S;
int dp[100010];
//

int main() {
    scanner >> S;
    N = S.size();

    {
        int rodd = 0, reven = 0;
        repeat(i, N) {
            char c = S[i];
            if (c == 'R') {
                reven += 1;
            }
            else if (c == 'L') {
                dp[i-1] += rodd;
                dp[i] += reven;
                rodd = reven = 0;
            }
            swap(reven, rodd);
        }
    }
    {
        int lodd = 0, leven = 0;
        rrepeat(i, N) {
            char c = S[i];
            if (c == 'L') {
                leven += 1;
            }
            else if (c == 'R') {
                dp[i+1] += lodd;
                dp[i] += leven;
                lodd = leven = 0;
            }
            swap(leven, lodd);
        }
    }

    printer.join(dp, dp+N, ' ');
    printer << '\n';

    return 0;
}


#include <iostream>
#include <cstdio>
#include <cctype>
#include <cstring>
#define il inline
#define vd void
#define rg register
#define rep(i,x,y) for(rg int i=x;i<=y;++i)
#define drp(i,x,y) for(rg int i=x;i>=y;--i)
using namespace std;
const int Len=2333333;
char buf[Len],*p1=buf,*p2=buf,duf[Len],*q1=duf;
il char gc(); il int rd(); il vd pc(char c); il vd rt(int x); il vd flush();
int n,t,ans[100005];
char s[100005];
int main(){
    scanf("%s",s+1),n=strlen(s+1);
    rep(i,1,n){
        if(s[i]=='R') t=i;
        else{
            if((i-t)&1) ++ans[t+1];
            else ++ans[t];
        }
    }
    drp(i,n,1){
        if(s[i]=='L') t=i;
        else{
            if((t-i)&1) ++ans[t-1];
            else ++ans[t];
        }
    }
    rep(i,1,n) rt(ans[i]),pc(' ');
    return flush(),0;
}

il char gc(){return p1==p2&&(p2=(p1=buf)+fread(buf,1,Len,stdin),p1==p2)?-1:*p1++;}
il int rd(){char c;
    while(!isdigit(c=gc())&&c!='-');
    int f=c=='-'?c=gc(),1:0,x=c^48;
    while(isdigit(c=gc())) x=((x+(x<<2))<<1)+(c^48);
    return f?-x:x;
}
il vd pc(char c){q1==duf+Len&&fwrite(q1=duf,1,Len,stdout),*q1++=c;}
il vd rt(int x){x<0?pc('-'),x=-x:0,pc((x>=10?rt(x/10),x%10:x)+48);}
il vd flush(){fwrite(duf,1,q1-duf,stdout);}


#include<bits/stdc++.h>
using namespace std;
int main () {
	string s;
	cin >> s;
	int n = s.length();
	long long a[100000]={0};
	for (int i=1; i<n-1; i++) {
		if (s[i]=='R' && s[i+1]=='L') {
			int x=i;
			int r=0;
			while (x>=0 && s[x]=='R') {
				r++;
				x--;
			}
			a[i]+=ceil(1.0*r/2);
			a[i+1]+=floor(1.0*r/2);
			int l=0;
			x = i+1;
			while (x<=n && s[x]=='L') {
				l++;
				x++;
			}
			a[i+1]+=ceil(1.0*l/2);
			a[i]+=floor(1.0*l/2);
		}
	}
	for (int i = 0; i<n; i++) {
		cout << a[i] << " ";
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main () {
	string s;
	cin >> s;
	int n = s.length();
	int a[100000]={0};
	for (int i=1; i<n-1; i++) {
		if (s[i]=='R' && s[i+1]=='L') {
			int x=i;
			int r=0;
			while (x>=0 && s[x]=='R') {
				r++;
				x--;
			}
			a[i]+=ceil(1.0*r/2);
			a[i+1]+=floor(1.0*r/2);
			int l=0;
			x = i+1;
			while (x<=n && s[x]=='L') {
				l++;
				x++;
			}
			a[i+1]+=ceil(1.0*l/2);
			a[i]+=floor(1.0*l/2);
		}
	}
	for (int i = 0; i<n; i++) {
		cout << a[i] << " ";
	}
	return 0;
}


#include <iostream>
#include <cstdio>
#include <vector>
using namespace std;

int main(){
    string s;
    cin >> s;

    long long n = s.size();
    long long i = 0;
    vector<long long> ans(n ,0);

    while(i < n){
        if(s[i] == 'R'){
            long long cnt_even = 0;
            long long cnt_odd = 0;
            long long right = i;
            while(i < n and s[i] == 'R'){
                if(i % 2 == 0) cnt_even++;
                else cnt_odd++;

                right = i;
                i++;
            }

            long long left = i;
            while(i < n and s[i] == 'L'){
                if(i % 2 == 0) cnt_even++;
                else cnt_odd++;
                i++;
            }

            if(n % 2 == 0){
                ans[right] = cnt_even;
                ans[left] = cnt_odd;
            }
            else{
                ans[right] = cnt_odd;
                ans[left] = cnt_even;
            }

        }
    }

    for(long long i = 0; i < n; i++){
        if(i == n-1) printf("%lld\n", ans[i]);
        else printf("%lld ", ans[i]);
    }
    return 0;
}


#include <stdio.h>

inline static int read_int() {
    int x = 0, k;
    while ((k = getchar_unlocked() - 'L') >= 0) x = x * 10 + k;
    return x;
}

inline static void put_int(int x) {
    int s = 0;
    char f[6] = {'0', '0', '0', '0', '0', '0'};
    if (!x) {
        putchar_unlocked('0');
        return;
    }
    while (x) {
        f[s++] += x % 10;
        x /= 10;
    }

    while (s--) putchar_unlocked(f[s]);
}

int main() {
    int flag = 0, l = 0, r = 0, i = 0, tmp, first = 1;

    for (;(tmp = getchar_unlocked() - 'L') >= 0; i++) {
        if (tmp) {
            // if c is R
            if (flag) {
                flag = 0;

                if ((tmp = r + 1) < l) {
                    if (first) {
                        first = 0;
                    } else {
                        putchar_unlocked(' ');
                    }
                    putchar_unlocked('0');

                    for (tmp++; tmp < l; tmp++) {
                        putchar_unlocked(' ');
                        putchar_unlocked('0');
                    }
                }

                if (first) {
                    first = 0;
                } else {
                    putchar_unlocked(' ');
                }
                tmp = (l - r + 1) / 2 + (i - l) / 2;
                put_int(tmp);
                putchar_unlocked(' ');
                tmp = (i - r) - tmp;
                put_int(tmp);

                for (tmp = l + 1; tmp < i; tmp++) {
                    putchar_unlocked(' ');
                    putchar_unlocked('0');
                }
                r = i;
            }
        } else {
            // if c is L
            if (!flag) {
                flag = 1;
                l = i;
            }
        }
    }

    if ((tmp = r + 1) < l) {
        if (first) {
            first = 0;
        } else {
            putchar_unlocked(' ');
        }
        putchar_unlocked('0');

        for (tmp++; tmp < l; tmp++) {
            putchar_unlocked(' ');
            putchar_unlocked('0');
        }
    }

    if (first) {
        first = 0;
    } else {
        putchar_unlocked(' ');
    }
    tmp = (l - r + 1) / 2 + (i - l) / 2;
    put_int(tmp);
    putchar_unlocked(' ');
    tmp = (i - r) - tmp;
    put_int(tmp);

    for (tmp = l + 1; tmp < i; tmp++) {
        putchar_unlocked(' ');
        putchar_unlocked('0');
    }

    putchar_unlocked('\n');
}


#include <stdio.h>

inline static int read_int() {
    int x = 0, k;
    while ((k = getchar_unlocked() - 'L') >= 0) x = x * 10 + k;
    return x;
}

inline static void put_int(int x) {
    int s = 0;
    char f[6] = {'0', '0', '0', '0', '0', '0'};
    if (!x) {
        putchar_unlocked('0');
        return;
    }
    while (x) {
        f[s++] += x % 10;
        x /= 10;
    }

    while (s--) putchar_unlocked(f[s]);
}

int main() {
    int flag = 0, l = 0, r = 0, i = 0, tmp, first = 1;

    for (;(tmp = getchar_unlocked() - 'L') >= 0; i++) {
        if (tmp) {
            // if c is R
            if (flag) {
                flag = 0;

                for (tmp = r + 1; tmp < l; tmp++) {
                    if (first) {
                        first = 0;
                    } else {
                        putchar_unlocked(' ');
                    }
                    putchar_unlocked('0');
                }

                if (first) {
                    first = 0;
                } else {
                    putchar_unlocked(' ');
                }
                tmp = (l - r + 1) / 2 + (i - l) / 2;
                put_int(tmp);
                putchar_unlocked(' ');
                tmp = (i - r) - tmp;
                put_int(tmp);

                for (tmp = l + 1; tmp < i; tmp++) {
                    putchar_unlocked(' ');
                    putchar_unlocked('0');
                }
                r = i;
            }
        } else {
            // if c is L
            if (!flag) {
                flag = 1;
                l = i;
            }
        }
    }

    for (tmp = r + 1; tmp < l; tmp++) {
        if (first) {
            first = 0;
        } else {
            putchar_unlocked(' ');
        }
        putchar_unlocked('0');
    }

    if (first) {
        first = 0;
    } else {
        putchar_unlocked(' ');
    }
    tmp = (l - r + 1) / 2 + (i - l) / 2;
    put_int(tmp);
    putchar_unlocked(' ');
    tmp = (i - r) - tmp;
    put_int(tmp);

    for (tmp = l + 1; tmp < i; tmp++) {
        putchar_unlocked(' ');
        putchar_unlocked('0');
    }

    putchar_unlocked('\n');
}


#include <stdio.h>
#include <wchar.h>

inline static void put_int(int x) {
    int s = 0;
    char f[6] = {'0', '0', '0', '0', '0', '0'};
    while (x) {
        f[s++] += x % 10;
        x /= 10;
    }

    while (s--) putc_unlocked(f[s], stdout);
}

int main() {
    int flag = 0, l = 0, r = 0, i = 0, tmp, first = 1;

    for (;(tmp = getchar_unlocked() - 'L') >= 0; i++) {
        if (tmp) {
            // if c is R
            if (flag) {
                flag = 0;

                if ((tmp = r + 1) < l) {
                    if (first) {
                        first = 0;
                    } else {
                        putchar_unlocked(' ');
                    }
                    putchar_unlocked('0');

                    for (tmp++; tmp < l; tmp++) {
                        putc_unlocked(' ', stdout);
                        putc_unlocked('0', stdout);
                    }
                }

                if (first) {
                    first = 0;
                } else {
                    putchar_unlocked(' ');
                }
                tmp = (l - r + 1) / 2 + (i - l) / 2;
                put_int(tmp);
                putchar_unlocked(' ');
                tmp = (i - r) - tmp;
                put_int(tmp);

                for (tmp = l + 1; tmp < i; tmp++) {
                    putc_unlocked(' ', stdout);
                    putc_unlocked('0', stdout);
                }
                r = i;
            }
        } else {
            // if c is L
            if (!flag) {
                flag = 1;
                l = i;
            }
        }
    }

    if ((tmp = r + 1) < l) {
        if (first) {
            first = 0;
        } else {
            putchar_unlocked(' ');
        }
        putchar_unlocked('0');

        for (tmp++; tmp < l; tmp++) {
            putc_unlocked(' ', stdout);
            putc_unlocked('0', stdout);
        }
    }

    if (first) {
        first = 0;
    } else {
        putchar_unlocked(' ');
    }
    tmp = (l - r + 1) / 2 + (i - l) / 2;
    put_int(tmp);
    putchar_unlocked(' ');
    tmp = (i - r) - tmp;
    put_int(tmp);

    for (tmp = l + 1; tmp < i; tmp++) {
        putc_unlocked(' ', stdout);
        putc_unlocked('0', stdout);
    }

    putchar_unlocked('\n');
}


#include <stdio.h>
#include <string.h>
int main(void){
    char s[100000+5];
    scanf("%s", s);

    int ans[100000]={0};

    for(int i=0; i<strlen(s);){
        int r=0, l=0;
        while(s[i]=='R')i++, r++;
        int p=i;
        while(s[i]=='L')i++, l++;
        ans[p-1]=(r+1)/2+l/2;
        ans[p]=r/2+(l+1)/2;
    }
    for(int i=0; i<strlen(s); i++)printf("%d ", ans[i]);
    return 0;
}


#include <stdio.h>
#include <string.h>
int main(void){
    char s[100000+5];
    scanf("%s", s);

    int ans[100000]={0};

    for(int i=0; i<strlen(s); i++){
        int r=0, l=0;
        for( ; s[i]=='R'; i++)r++;
        int p=i;
        for( ; s[i]=='L'; i++)l++;
        ans[p-1]=(r+1)/2+l/2;
        ans[p]=r/2+(l+1)/2;
    }
    for(int i=0; i<strlen(s); i++)printf("%d ", ans[i]);
    return 0;
}


#include <stdio.h>
#include <string.h>

int main(void)
{
    int i,tmp=-1;
    char S[100001];
    int count[100001];
    int L_guusuu=0,L_kisuu=0,R_guusuu=0,R_kisuu=0;

    for(i=0; i<100001; i++) count[i] = 0;

    gets(S);

    int N;
    N = strlen(S);
    printf("%d\n",N);

    for(i=0; i<N-1; i++){
        if(S[i] == 'L'){
            if(i%2 == 0){
                L_guusuu++;
            } else {
                L_kisuu++;
            }
        } else {
            if(i%2 == 0){
                R_guusuu++;
            } else {
                R_kisuu++;
            }
        }

        if(S[i] == 'R' && S[i+1] == 'L'){

            if(tmp != -1){
                if(tmp%2 == 0){
                    count[tmp] += L_guusuu;
                    count[tmp+1] += L_kisuu;
                } else {
                    count[tmp] += L_kisuu;
                    count[tmp+1] += L_guusuu;
                }

            }

            tmp = i;

            if(i%2 == 0){
                count[i] += R_guusuu;
                count[i+1] += R_kisuu;
            } else {
                count[i] += R_kisuu;
                count[i+1] += R_guusuu;
            }
            printf("R_guusuu = %d\n",R_guusuu);
            printf("R_kisuu = %d\n",R_kisuu);
            printf("L_guusuu = %d\n",L_guusuu);
            printf("L_kisuu = %d\n\n",L_kisuu);
            R_guusuu = 0;
            R_kisuu = 0;
            L_guusuu = 0;
            L_kisuu = 0;
            for(int j=0; j<N; j++) printf("%d ",count[j]);
            printf("\n");
        }
    }

     if(tmp%2 == 0){
        count[tmp] += L_guusuu;
        count[tmp+1] += L_kisuu;
    } else {
        count[tmp] += L_kisuu;
        count[tmp+1] += L_guusuu;
    }

    if((N-1)%2 == tmp%2){
        count[tmp]++;
    } else {
        count[tmp+1]++;
    }

    //for(i=0; i<N; i++) printf("%c",S[i]);
    for(i=0; i<N; i++) printf("%d ",count[i]);
    printf("\n");

    return 0;
}


function main(S) {
    var S = S.trim();
    var squares = Array(S.length).fill(0);
    var rightIndex = 0;
    var leftIndex = 0;
    for (var i = 0; S.length > i; i++) {
        var j = i;
        var count = 0;

        if (S[j] === "R") {
            if (j < rightIndex) {
                j = rightIndex;
                count = j - i;
            }
        } else {
            if (j > leftIndex) {
                j = leftIndex;
                count = i - j;
            }
        }

        while (S[j] + S[j+1] !== "RL") {
            if (S[j] === "R") {
                j++;
            } else {
                j--;
            }

            count++;
        }

        if (j >= i) rightIndex = j;
        if (i >= j) leftIndex = j;

        var point = (count % 2) === 0 ? j : j + 1;
        squares[point] += 1;
    }

    console.log(squares.join(" "));
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));


function main(input) {
    var S = input.trim();
    var move = 1000000;
    var squares = new Array(S.length);
    squares.fill(0);
    var rightIndex = undefined;
    var leftIndex = undefined;
    for (var i = 0; S.length > i; i++) {
        var j = i;
        var count = 0;

        if (S[j] === "R") {
            if (typeof rightIndex !== "undefined" && j < rightIndex) {
                j = rightIndex;
                count = j - i;
            }
        } else {
            if (typeof leftIndex !== "undefined" && j > leftIndex) {
                j = leftIndex;
                count = i - j;
            }
        }

        while (S[j] + S[j+1] !== "RL") {
            if (S[j] === "R") {
                j++;
            } else {
                j--;
            }

            count++;
        }

        if (j >= i) rightIndex = j;
        if (i >= j) leftIndex = j;

        var point = (move - count) % 2 === 0 ? j : j + 1;
        squares[point] += 1;
    }

    console.log(squares.join(" "));
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));


'use strict'

/////////////////////////////////////
//コピペスペース//////////////////////

//定数
const INF  =  900719925474099 // Math.floor(Number.MAX_SAFE_INTEGER / 10);

//スペース区切りの数字列を数字の配列にして返す
function mapint(line){return line.split(' ').map((v)=>parseInt(v));}

function lower_bound(d,a,b,e){
    for(var c;1<b-a;)
        d[c=0|(a+b)/2]<e ? a=c : b=c;
    return d[a]<e?b:a
};

const N109 = 1000000000;
const MOD = N109+7;

//コピペスペース//////////////////////
/////////////////////////////////////

function Main(input){
	let s = input.trim();
	let n = s.length;

	let p = new Array(n).fill(0);
	let ans = new Array(n).fill(1);
	for(let i=0;i<n-1;i++){
		if(s[i]=='R'&&s[i+1]=='L'){
			p[i] = 1;
			p[i+1] = 1;
			i++;
		}
	}
	let j;
	for(let i=0;i<n-2;i++){
		if(p[i]==1)	continue;

		if(s[i]=='R'){
			ans[i+2] += ans[i];
			ans[i]=0;
		}
	}
	for(let i=n-1;i>1;i--){
		if(p[i]==1) continue;

		if(s[i]=='L'){
			ans[i-2] += ans[i];
			ans[i]=0;
		}
	}
	console.log(ans.join(' '));
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));


function Main(input) {
	var idata = input.split("");
	var ninzuu = [];
	var nextninzuutemp = [];
	//人数の配列を生成
	for( i=0; i<idata.length ; i++ ){
	    ninzuu.push(1);
	    nextninzuutemp.push(0);
	}
	var nextninzuu = nextninzuutemp.slice();
    var kurikaesikaisuu = ninzuu.length+ninzuu.length%2;
    //一回ごとに操作が行われる
	for( turn=0; turn<kurikaesikaisuu ; turn++ ){
		for( j=0; j<ninzuu.length ; j++ ){
			//着目しているマスに右に行けと書いてあった場合
			if(idata[j]=="R"){
				nextninzuu[j+1]=nextninzuu[j+1]+ninzuu[j];
			}else if(idata[j]=="L"){
			    nextninzuu[j-1]=nextninzuu[j-1]+ninzuu[j];
			}
		}
		ninzuu = nextninzuu.slice();
		nextninzuu = nextninzuutemp.slice();
	}
	console.log(ninzuu.join(" "));
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


function Main(input) {
	var idata = input.split("");
	var ninzuu = [];
	var nextninzuutemp = [];
	//人数の配列を生成
	for( i=0; i<idata.length ; i++ ){
	    ninzuu.push(1);
	    nextninzuutemp.push(0);
	}
	var nextninzuu = nextninzuutemp.slice();
	//一回ごとに操作が行われる
	for( turn=0; turn<ninzuu.length+ninzuu.length%2-1 ; turn++ ){
		for( j=0; j<ninzuu.length ; j++ ){
			//着目しているマスに右に行けと書いてあった場合
			if(idata[j]=="R"){
				nextninzuu[j+1]+=ninzuu[j];
			}else if(idata[j]=="L"){
			    nextninzuu[j-1]+=ninzuu[j];
			}
		}
		ninzuu = nextninzuu.slice();
		nextninzuu = nextninzuutemp.slice();
	}
	console.log(ninzuu.join(" "));
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


function Main(input) {
	var idata = input.split("");
	var ninzuu = [];
	var nextninzuutemp = [];
	//人数の配列を生成
	for( i=0; i<idata.length ; i++ ){
	    ninzuu.push(1);
	    nextninzuutemp.push(0);
	}
	var nextninzuu = nextninzuutemp.slice();
	//一回ごとに操作が行われる
	for( turn=0; turn<ninzuu.length+ninzuu.length%2-1 ; turn++ ){
		for( j=0; j<ninzuu.length ; j++ ){
			//着目しているマスに右に行けと書いてあった場合
			if(idata[j]=="R"){
				nextninzuu[j+1]+=ninzuu[j];
			}else if(idata[j]=="L"){
			    nextninzuu[j-1]+=ninzuu[j];
			}
		}
		ninzuu = nextninzuu.slice();
		nextninzuu = nextninzuutemp.slice();
		console.log(ninzuu);
	}
	console.log(ninzuu.join(" "));
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


package main

import (
	"bufio"
	"os"
	"strconv"
)

func main() {
	sc := bufio.NewScanner(os.Stdin)
	buf := make([]byte, 1e5+1)
	sc.Buffer(buf, 1e5+1)

	sc.Scan()
	S := []byte(sc.Text())

	changes := make([]int, 1)
	changes[0] = 0
	var now byte = 'R'
	for i, el := range S {
		if el != now {
			changes = append(changes, i)
			if now == 'R' {
				now = 'L'
			} else {
				now = 'R'
			}
		}
	}
	changes = append(changes, len(S))

	result := make([]int, len(S))
	for i := 0; i < len(changes)-1; i++ {
		even := i%2 == 0
		num := changes[i+1] - changes[i]
		if even {
			result[changes[i+1]-1] += num%2 + num/2
			result[changes[i+1]] += num / 2
		} else {
			result[changes[i]-1] += num / 2
			result[changes[i]] += num%2 + num/2
		}
	}

	writer := bufio.NewWriter(os.Stdout)
	for i, res := range result {
		if i != 0 {
			writer.WriteString(" ")
		}
		writer.WriteString(strconv.Itoa(res))
	}
	writer.Flush()
}


package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func getScanner(fp *os.File) *bufio.Scanner {
	scanner := bufio.NewScanner(fp)
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 1000005), 1000005)
	return scanner
}

func getNextString(scanner *bufio.Scanner) string {
	scanner.Scan()
	return scanner.Text()
}

func getNextInt(scanner *bufio.Scanner) int {
	i, _ := strconv.Atoi(getNextString(scanner))
	return i
}

func getNextInt64(scanner *bufio.Scanner) int64 {
	i, _ := strconv.ParseInt(getNextString(scanner), 10, 64)
	return i
}

func getNextUint64(scanner *bufio.Scanner) uint64 {
	i, _ := strconv.ParseUint(getNextString(scanner), 10, 64)
	return i
}

func getNextFloat64(scanner *bufio.Scanner) float64 {
	i, _ := strconv.ParseFloat(getNextString(scanner), 64)
	return i
}

func main() {
	fp := os.Stdin
	wfp := os.Stdout
	cnt := 0

	if os.Getenv("MASPY") == "ますピ" {
		fp, _ = os.Open(os.Getenv("BEET_THE_HARMONY_OF_PERFECT"))
		cnt = 2
	}
	if os.Getenv("MASPYPY") == "ますピッピ" {
		wfp, _ = os.Create(os.Getenv("NGTKANA_IS_GENIUS10"))
	}

	scanner := getScanner(fp)
	writer := bufio.NewWriter(wfp)
	solve(scanner, writer)
	for i := 0; i < cnt; i++ {
		fmt.Fprintln(writer, "-----------------------------------")
		solve(scanner, writer)
	}
	writer.Flush()
}

func solve(scanner *bufio.Scanner, writer *bufio.Writer) {
	s := getNextString(scanner)
	n := len(s)
	ll := make([]int, n)
	ll[n-1] = n - 1
	rr := make([]int, n)
	for i := 0; i < n-1; i++ {
		rr[i+1] = rr[i]
		if s[i] == 'R' {
			rr[i+1] = i
		}
	}

	for i := n - 2; i >= 0; i-- {
		ll[i] = ll[i+1]
		if s[i+1] == 'L' {
			ll[i] = i + 1
		}
	}

	ans := make([]int, n)
	for i := 0; i < n; i++ {
		if s[i] == 'L' {
			r := rr[i]
			if (i-r)%2 == 1 {
				r++
			}
			ans[r]++
			continue
		}

		l := ll[i]
		if (l-i)%2 == 1 {
			l--
		}
		ans[l]++
	}
	for i := 0; i < n; i++ {
		fmt.Fprintln(writer, ans[i])
	}
}


package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func main() {
	sc := NewScanner()
	S := sc.Next()

	L := 0
	A := make([]int, len(S))
	for i := L; i < len(S); i++ {
		if S[i] == 'L' {
			step := 0
			if i > 0 && S[i-1] == 'L' {
				A[i] = A[i-1] - 1
			} else {
				for j := i; j >= L; j-- {
					A[j] = step
					step++
				}
			}
			L = i + 1
		}

	}

	ans := make([]int, len(S))
	for i := 0; i < len(S); i++ {
		if A[i]%2 == 0 {
			ans[i+A[i]] += 1
		} else {
			ans[i+A[i]-1] += 1
		}
	}
	PrintI(ans...)
}

func mapToString(arr []int) []string {
	ret := make([]string, len(arr))
	for i := 0; i < len(arr); i++ {
		ret[i] = strconv.Itoa(arr[i])
	}
	return ret
}

func PrintI(args ...int) {
	fmt.Println(strings.Join(mapToString(args), " "))
}

type Scanner struct {
	r   *bufio.Reader
	buf []byte
	p   int
}

func NewScanner() *Scanner {
	rdr := bufio.NewReaderSize(os.Stdin, 1000)
	return &Scanner{r: rdr}
}
func (s *Scanner) Next() string {
	s.pre()
	start := s.p
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			break
		}
	}
	result := string(s.buf[start:s.p])
	s.p++
	return result
}
func (s *Scanner) NextLine() string {
	s.pre()
	start := s.p
	s.p = len(s.buf)
	return string(s.buf[start:])
}
func (s *Scanner) NextInt() int {
	v, _ := strconv.Atoi(s.Next())
	return v
}
func (s *Scanner) NextInt64() int64 {
	v, _ := strconv.ParseInt(s.Next(), 10, 64)
	return v
}

func (s *Scanner) NextFloat() float64 {
	v, _ := strconv.ParseFloat(s.Next(), 64)
	return v
}

func (s *Scanner) NextIntArray() []int {
	s.pre()
	start := s.p
	result := []int{}
	for ; s.p < len(s.buf)+1; s.p++ {
		if s.p == len(s.buf) || s.buf[s.p] == ' ' {
			v, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 0)
			result = append(result, int(v))
			start = s.p + 1
		}
	}

	return result
}
func (s *Scanner) NextInt64Array() []int64 {
	s.pre()
	start := s.p
	result := []int64{}
	for ; s.p < len(s.buf)+1; s.p++ {
		if s.p == len(s.buf) || s.buf[s.p] == ' ' {
			v, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 64)
			result = append(result, v)
			start = s.p + 1
		}
	}
	return result
}

func (s *Scanner) NextMap() map[int]bool {
	s.pre()
	start := s.p
	mp := map[int]bool{}
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			v, _ := strconv.Atoi(string(s.buf[start:s.p]))
			mp[v] = true
			start = s.p + 1
		}
	}
	v, _ := strconv.Atoi(string(s.buf[start:s.p]))
	mp[v] = true

	return mp
}

func (s *Scanner) pre() {
	if s.p >= len(s.buf) {
		s.readLine()
		s.p = 0
	}
}
func (s *Scanner) readLine() {
	s.buf = make([]byte, 0)
	for {
		l, p, e := s.r.ReadLine()
		if e != nil {
			panic(e)
		}
		s.buf = append(s.buf, l...)
		if !p {
			break
		}
	}
}


package main

import (
	"bufio"
	"fmt"
	"os"
	//"strconv"
)

var rdr = bufio.NewReaderSize(os.Stdin, 1000000)

func readLine() string {
	buf := make([]byte, 0, 1000000)
	for {
		l, p, e := rdr.ReadLine()
		if e != nil {
			panic(e)
		}
		buf = append(buf, l...)
		if !p {
			break
		}
	}
	return string(buf)
}

func main() {
	S := readLine()
	ABC136D(S)
	//fmt.Printf("%s\n", ABC136D(S))
}

// ABC136D ...
func ABC136D(S string) (res string) {
	resSlice := make([]int, len(S))

	for i := 0; i < len(S); i++ {
		pos, cnt := i, 0
		for {
			if S[pos] == 'R' && S[pos+1] == 'L' {
				if cnt%2 == 0 {
					resSlice[pos]++
				} else {
					resSlice[pos+1]++
				}
				break
			} else if S[pos] == 'L' && S[pos-1] == 'R' {
				if cnt%2 == 0 {
					resSlice[pos]++
				} else {
					resSlice[pos-1]++
				}
				break
			} else if S[pos] == 'R' {
				pos++
				cnt++
			} else if S[pos] == 'L' {
				pos--
				cnt++
			}
		}
	}

	for i := 0; i < len(resSlice)-1; i++ {
		//res += strconv.Itoa(resSlice[i]) + " "
      	fmt.Printf("%d ", resSlice[i])
	}
  	fmt.Printf("%d", resSlice[len(resSlice)-1])

	//return res[0 : len(res)-1]
  	return
}


package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var rdr = bufio.NewReaderSize(os.Stdin, 1000000)

func readLine() string {
	buf := make([]byte, 0, 1000000)
	for {
		l, p, e := rdr.ReadLine()
		if e != nil {
			panic(e)
		}
		buf = append(buf, l...)
		if !p {
			break
		}
	}
	return string(buf)
}

func main() {
	S := readLine()

	fmt.Printf("%s\n", ABC136D(S))
}

// ABC136D ...
func ABC136D(S string) (res string) {
	resSlice := make([]int, len(S))

	for i := 0; i < len(S); i++ {
		pos, cnt := i, 0
		for {
			if S[pos] == 'R' && S[pos+1] == 'L' {
				if cnt%2 == 0 {
					resSlice[pos]++
				} else {
					resSlice[pos+1]++
				}
				break
			} else if S[pos] == 'L' && S[pos-1] == 'R' {
				if cnt%2 == 0 {
					resSlice[pos]++
				} else {
					resSlice[pos-1]++
				}
				break
			} else if S[pos] == 'R' {
				pos++
				cnt++
			} else if S[pos] == 'L' {
				pos--
				cnt++
			}
		}
	}

	for i := 0; i < len(resSlice); i++ {
		res += strconv.Itoa(resSlice[i]) + " "
	}

	return res[0 : len(res)-1]
}


package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc = bufio.NewScanner((os.Stdin))

func nextLine() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	l := nextLine()
	i, e := strconv.Atoi(l)
	if e != nil {
		panic(e)
	}
	return i
}

func main() {
	sc.Split(bufio.ScanWords)
	S := nextLine()

	fmt.Printf("%s\n", ABC136D(S))
}

// ABC136D ...
func ABC136D(S string) (res string) {
	resSlice := make([]int, len(S))

	for i := 0; i < len(S); i++ {
		pos, cnt := i, 0
		for {
			if S[pos] == 'R' && S[pos+1] == 'L' {
				if cnt%2 == 0 {
					resSlice[pos]++
				} else {
					resSlice[pos+1]++
				}
				break
			} else if S[pos] == 'L' && S[pos-1] == 'R' {
				if cnt%2 == 0 {
					resSlice[pos]++
				} else {
					resSlice[pos-1]++
				}
				break
			} else if S[pos] == 'R' {
				pos++
				cnt++
			} else if S[pos] == 'L' {
				pos--
				cnt++
			}
		}
	}

	for i := 0; i < len(resSlice); i++ {
		res += strconv.Itoa(resSlice[i]) + " "
	}

	return res[0 : len(res)-1]
}


S=gets.chomp
l=S.length

a = [0]*l

i = 0
while i != l
  j = S.index(?L,i)
  c = j-i
  a[j] += c/2
  a[j-1] += c/2+(c%2)
  i = S.index(?R,j) || l
  c = i-j
  a[j-1] += c/2
  a[j] += c/2+(c%2)
end

puts a*' '


s = gets
f, c = 0, 0
p = []
0.upto(s.size - 1) do |i|
  if s[i] == 'R'
    if f == 1
      f = 0
      p.push(c)
      c = 0
    end
    c += 1
  else
    if f == 0
      f = 1
      p.push(c)
      c = 0
    end
    if i == s.size - 1
      p.push(c)
    end
    c += 1
  end
end
ans = ''
while p.size > 0
  x = p.shift
  y = p.shift
  if (x + y).even?
    (x - 1).times do
      ans.concat('0 ')
    end
    ans.concat(((x + y) / 2).to_s)
    ans.concat(' ')
    ans.concat(((x + y) / 2).to_s)
    ans.concat(' ')
    (y - 1).times do
      ans.concat('0 ')
    end
  elsif (x.even?)
    (x - 1).times do
      ans.concat('0 ')
    end
    ans.concat(((x + y) / 2).to_s)
    ans.concat(' ')
    ans.concat(((x + y) / 2 + 1).to_s)
    ans.concat(' ')
    (y - 1).times do
      ans.concat('0 ')
    end
  else
    (x - 1).times do
      ans.concat('0 ')
    end
    ans.concat(((x + y) / 2 + 1).to_s)
    ans.concat(' ')
    ans.concat(((x + y) / 2).to_s)
    ans.concat(' ')
    (y - 1).times do
      ans.concat('0 ')
    end
  end
end
puts ans


S=gets.chomp

arr = [0]*S.length

i = 0
loop do
  idx = S.index('L',i)
  c = idx-i
  arr[idx] += c/2
  arr[idx-1] += c/2+(c%2)
  i = S.index('R',idx) || S.length
  c = i-idx
  arr[idx-1] += c/2
  arr[idx] += c/2+(c%2)
  break if i == S.length
end

puts arr.join(' ')


S = gets.chomp.split("")

array = S.map{|_| 1}
before = S.map{|_| 0}

(10**100).times do |i|
  tmp = S.map{|_| 0}
  S.each.with_index do |s, i|
    if s == 'R'
      tmp[i+1] += array[i]
    else
      tmp[i-1] += array[i]
    end
  end
  if before == tmp && i % 2 == 0
    break
  end
  before = array
  array = tmp
end
print "#{array.join(' ')}\n"


def mpow(n, p, mod)
  r = 1
  while p > 0
    r = r * n % mod if p & 1 == 1
    n = n * n % mod
    p >>= 1
  end
  r
end

str = gets.chomp

l = str.length
box = Array.new(l, 1)

doit = ->{
  nxt = Array.new(l, 0)
  str.each_char.with_index do |c, i|
    if c == "R"
      nxt[i + 1] += box[i]
    else
      nxt[i - 1] += box[i]
    end
  end
  box = nxt
}

stack = [box.join]
idx = nil

loop do
  doit.()
  tmp = box.join.rjust(l, "0")
  break if (idx = stack.index(tmp))
  stack << tmp
end

ln = stack.size - idx
i = idx + (mpow(10, 100, ln) - idx % ln) % ln

puts stack[i].chars.join(" ")


require 'pp'

# 入力値を文字の配列で返却する
def gets_nsp_list()
  gets.chomp.split("")
end

s_list = gets_nsp_list
N = s_list.size
children = Array.new(N,1)
10**6.times do
  tmp_children = Array.new(N,0)
  s_list.each_with_index do |s, i|
    current = children[i]
    if s == "R"
      tmp_children[i+1] += current
    elsif s == "L"
      current = children[i]
      tmp_children[i-1] += current
    end
  end
  children = tmp_children
end
puts children.join(" ")


use std::io::{stdin, stdout, BufReader, BufRead, StdinLock, Write, BufWriter};

fn main() {
    let (std_in, std_out) = (stdin(), stdout());
    let mut br = BufReader::new(std_in.lock());
    let mut bw = BufWriter::new(std_out.lock());

    let s = rs(&mut br);
    let n = s.len();
    let mut res = vec![0; n];

    let mut r = 0;
    for i in 0..n {
        if s[i] == 'R' {
            r += 1;
        } else {
            res[i] += r / 2;
            res [i-1] += (r + 1) / 2;
            r = 0;
        }
    }
    let mut l = 0;
    for i in (0..n).rev() {
        if s[i] == 'L' {
            l += 1;
        } else {
            res[i] += l / 2;
            res [i+1] += (l + 1) / 2;
            l = 0;
        }
    }
    for x in res {
        write!(&mut bw, "{} ", x);
    }
}

//////////////////////////////////////////////////////////////////////////////////
#[allow(dead_code)]
fn rs(br: &mut BufReader<StdinLock>) -> Vec<char> {
    let mut buf = String::new();
    br.read_line(&mut buf).ok();
    buf.trim().chars().collect()
}

#[allow(dead_code)]
fn rn<T: std::str::FromStr>(br: &mut BufReader<StdinLock>) -> T {
    let mut buf = String::new();
    br.read_line(&mut buf).ok();
    buf.trim().parse().ok().unwrap()
}

#[allow(dead_code)]
fn rvs(br: &mut BufReader<StdinLock>) -> Vec<Vec<char>> {
    let mut buf = String::new();
    br.read_line(&mut buf).ok();
    buf.trim().split_whitespace().map(|e| e.chars().collect()).collect()
}

#[allow(dead_code)]
fn rvn<T: std::str::FromStr>(br: &mut BufReader<StdinLock>) -> Vec<T> {
    let mut buf = String::new();
    br.read_line(&mut buf).ok();
    buf.trim().split_whitespace().map(|e| e.parse().ok().unwrap()).collect()
}


// The main code is at the very bottom.

#[allow(unused_imports)]
#[macro_use]
pub mod spella {
  pub mod byte {
    pub use self::byte_char::*;
    pub use self::byte_str::*;
    pub use self::byte_string::*;
    pub use self::from_byte_str::*;

    mod byte_char {
      use std::fmt::{self, Debug, Display, Formatter};

      #[derive(Clone, Copy, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
      pub struct ByteChar(pub u8);

      impl Debug for ByteChar {
        fn fmt(&self, f: &mut Formatter) -> fmt::Result {
          write!(f, "b'{}'", self.0 as char)
        }
      }

      impl Display for ByteChar {
        fn fmt(&self, f: &mut Formatter) -> fmt::Result {
          write!(f, "{}", self.0 as char)
        }
      }
    }

    mod byte_str {
      use spella::byte::{ByteChar, ByteString};
      use std::fmt::{self, Debug, Display, Formatter};
      use std::ops::{Deref, DerefMut};

      #[derive(PartialEq, Eq, PartialOrd, Ord, Hash)]
      pub struct ByteStr([ByteChar]);

      macro_rules! cast {
        (mut $x:expr, $($T:ty)=>*) => {
          unsafe { &mut *($x $(as *mut $T)*) }
        };
        ($x:expr, $($T:ty)=>*) => {
          unsafe { &*($x $(as *const $T)*) }
        };
      }

      impl ByteStr {
        pub fn from_bytes(s: &[u8]) -> &Self {
          cast!(s, [u8] => [ByteChar] => ByteStr)
        }

        pub fn from_bytes_mut(s: &mut [u8]) -> &mut Self {
          cast!(mut s, [u8] => [ByteChar] => ByteStr)
        }

        pub fn from_byte_chars(s: &[ByteChar]) -> &Self {
          cast!(s, [ByteChar] => ByteStr)
        }

        pub fn from_byte_chars_mut(s: &mut [ByteChar]) -> &mut Self {
          cast!(mut s, [ByteChar] => ByteStr)
        }

        pub fn as_byte_chars(&self) -> &[ByteChar] {
          &self.0
        }

        pub fn as_byte_chars_mut(&mut self) -> &mut [ByteChar] {
          &mut self.0
        }

        pub fn as_bytes(&self) -> &[u8] {
          cast!(self, ByteStr => [ByteChar] => [u8])
        }

        pub fn as_bytes_mut(&mut self) -> &mut [u8] {
          cast!(mut self, ByteStr => [ByteChar] => [u8])
        }
      }

      impl ToOwned for ByteStr {
        type Owned = ByteString;

        fn to_owned(&self) -> ByteString {
          ByteString::from(self.0.to_owned())
        }
      }

      impl Debug for ByteStr {
        fn fmt(&self, f: &mut Formatter) -> fmt::Result {
          write!(f, "b\"")?;

          for &c in &self.0 {
            write!(f, "{}", c)?;
          }

          write!(f, "\"")
        }
      }

      impl Display for ByteStr {
        fn fmt(&self, f: &mut Formatter) -> fmt::Result {
          for &c in &self.0 {
            write!(f, "{}", c)?;
          }

          Ok(())
        }
      }

      impl Deref for ByteStr {
        type Target = [ByteChar];

        fn deref(&self) -> &[ByteChar] {
          self.as_byte_chars()
        }
      }

      impl DerefMut for ByteStr {
        fn deref_mut(&mut self) -> &mut [ByteChar] {
          self.as_byte_chars_mut()
        }
      }
    }

    mod byte_string {
      use spella::byte::{ByteChar, ByteStr};

      use std::borrow::{Borrow, BorrowMut};
      use std::fmt::{self, Debug, Display, Formatter};
      use std::ops::{Deref, DerefMut};

      #[derive(Clone, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
      pub struct ByteString(Vec<ByteChar>);

      impl ByteString {
        pub fn into_byte_chars(self) -> Vec<ByteChar> {
          self.0
        }

        pub fn as_byte_str(&self) -> &ByteStr {
          ByteStr::from_byte_chars(&self.0)
        }

        pub fn as_mut_byte_str(&mut self) -> &mut ByteStr {
          ByteStr::from_byte_chars_mut(&mut self.0)
        }
      }

      impl From<Vec<ByteChar>> for ByteString {
        fn from(s: Vec<ByteChar>) -> ByteString {
          ByteString(s)
        }
      }

      impl Borrow<ByteStr> for ByteString {
        fn borrow(&self) -> &ByteStr {
          self.as_byte_str()
        }
      }

      impl BorrowMut<ByteStr> for ByteString {
        fn borrow_mut(&mut self) -> &mut ByteStr {
          self.as_mut_byte_str()
        }
      }

      impl Debug for ByteString {
        fn fmt(&self, f: &mut Formatter) -> fmt::Result {
          Debug::fmt(self.as_byte_str(), f)
        }
      }

      impl Display for ByteString {
        fn fmt(&self, f: &mut Formatter) -> fmt::Result {
          Display::fmt(self.as_byte_str(), f)
        }
      }

      impl Deref for ByteString {
        type Target = ByteStr;

        fn deref(&self) -> &ByteStr {
          ByteStr::from_byte_chars(&self.0)
        }
      }

      impl DerefMut for ByteString {
        fn deref_mut(&mut self) -> &mut ByteStr {
          ByteStr::from_byte_chars_mut(&mut self.0)
        }
      }
    }

    mod from_byte_str {
      use spella::byte::{ByteChar, ByteStr, ByteString};

      use std::error::Error;
      use std::fmt::{self, Debug, Display, Formatter};
      use std::str::{self, FromStr, Utf8Error};

      pub trait FromByteStr: Sized {
        type Err;

        fn from_byte_str(s: &ByteStr) -> Result<Self, Self::Err>;
      }

      macro_rules! fn_description {
        () => {
          fn description(&self) -> &str {
            "description() is deprecated; use Display"
          }
        };
      }

      #[derive(Debug)]
      pub struct ParseByteCharError(ParseByteCharErrorKind);

      #[derive(Debug)]
      enum ParseByteCharErrorKind {
        EmptyByteStr,
        TooManyByteChars,
      }

      impl Display for ParseByteCharError {
        fn fmt(&self, f: &mut Formatter) -> fmt::Result {
          use self::ParseByteCharErrorKind::*;

          f.write_str(match self.0 {
            EmptyByteStr => "empty `ByteStr`",
            TooManyByteChars => "too many `ByteChar`s",
          })
        }
      }

      impl Error for ParseByteCharError {
        fn_description! {}
      }

      impl FromByteStr for ByteChar {
        type Err = ParseByteCharError;

        fn from_byte_str(s: &ByteStr) -> Result<Self, Self::Err> {
          use self::ParseByteCharErrorKind::*;

          match s.len() {
            1 => Ok(unsafe { *s.get_unchecked(0) }),
            0 => Err(ParseByteCharError(EmptyByteStr)),
            _ => Err(ParseByteCharError(TooManyByteChars)),
          }
        }
      }

      #[derive(Debug)]
      pub enum ParseByteStringError {}

      impl Display for ParseByteStringError {
        fn fmt(&self, _: &mut Formatter) -> fmt::Result {
          match *self {}
        }
      }

      impl Error for ParseByteStringError {
        fn_description! {}
      }

      impl FromByteStr for ByteString {
        type Err = ParseByteStringError;

        fn from_byte_str(s: &ByteStr) -> Result<Self, Self::Err> {
          Ok(ByteString::from(s.to_vec()))
        }
      }

      pub struct ParseFromStrError<T: FromStr>(ParseFromStrErrorKind<T>);

      enum ParseFromStrErrorKind<T: FromStr> {
        Utf8Error(Utf8Error),
        FromStrError(T::Err),
      }

      impl<T: FromStr> Debug for ParseFromStrError<T>
      where
        T::Err: Debug,
      {
        fn fmt(&self, f: &mut Formatter) -> fmt::Result {
          use self::ParseFromStrErrorKind::*;

          match self.0 {
            Utf8Error(ref err) => f.debug_tuple("Utf8Error").field(err).finish(),
            FromStrError(ref err) => f.debug_tuple("FromStrError").field(err).finish(),
          }
        }
      }

      impl<T: FromStr> Display for ParseFromStrError<T>
      where
        T::Err: Display,
      {
        fn fmt(&self, f: &mut Formatter) -> fmt::Result {
          use self::ParseFromStrErrorKind::*;

          match self.0 {
            Utf8Error(ref err) => write!(f, "{}", err),
            FromStrError(ref err) => write!(f, "{}", err),
          }
        }
      }

      impl<T: FromStr> Error for ParseFromStrError<T>
      where
        T::Err: Debug + Display,
      {
        fn_description! {}
      }

      impl<T: FromStr> FromByteStr for T {
        type Err = ParseFromStrError<T>;

        fn from_byte_str(s: &ByteStr) -> Result<T, Self::Err> {
          use self::ParseFromStrErrorKind::*;

          str::from_utf8(s.as_bytes())
            .map_err(|e| ParseFromStrError(Utf8Error(e)))
            .and_then(|s| s.parse().map_err(|e| ParseFromStrError(FromStrError(e))))
        }
      }
    }
  }

  pub mod io {
    pub use self::scanner::*;

    mod scanner {
      use spella::byte::{ByteStr, FromByteStr};

      use std::io::{self, BufRead};

      #[derive(Debug)]
      pub struct Scanner<R> {
        reader: R,
        buf: Vec<u8>,
        pos: usize,
      }

      const INITIAL_CAPACITY: usize = 32;

      impl<R: BufRead> Scanner<R> {
        pub fn new(reader: R) -> Self {
          Scanner {
            reader: reader,
            buf: Vec::with_capacity(INITIAL_CAPACITY),
            pos: 0,
          }
        }

        pub fn next<T: FromByteStr>(&mut self) -> io::Result<Result<T, T::Err>> {
          self.next_byte_str().map(T::from_byte_str)
        }

        pub fn next_byte_str(&mut self) -> io::Result<&ByteStr> {
          if self.buf.is_empty() {
            self.read_line()?;
          }

          loop {
            match self.buf.get(self.pos) {
              Some(&b' ') => self.pos += 1,
              Some(&b'\n') => self.read_line()?,
              Some(_) => break,
              None => return Err(io::Error::from(io::ErrorKind::UnexpectedEof)),
            }
          }

          let start = self.pos;
          self.pos += 1;

          loop {
            match self.buf.get(self.pos) {
              Some(&b' ') | Some(&b'\n') | None => break,
              Some(_) => self.pos += 1,
            }
          }

          Ok(ByteStr::from_bytes(&self.buf[start..self.pos]))
        }

        fn read_line(&mut self) -> io::Result<()> {
          self.buf.clear();
          self.pos = 0;
          self.reader.read_until(b'\n', &mut self.buf)?;

          Ok(())
        }
      }
    }
  }
}

mod prelude {
  pub use spella::byte::{ByteChar, ByteStr, ByteString};
  pub use std::collections::*;
  pub use std::io::prelude::*;
  pub use std::iter::FromIterator;
  pub use std::marker::PhantomData;
  pub use std::num::Wrapping;
  pub use std::ops::{Range, RangeFrom, RangeTo};
  pub use std::{cell, cmp, f64, i32, i64, isize, iter, mem, rc, str, time, u32, u64, usize};
}

use prelude::*;

const CUSTOM_STACK_SIZE_MEBIBYTES: Option<usize> = None;

fn main() {
  fn exec_solver() {
    let stdin = std::io::stdin();
    let stdout = std::io::stdout();
    #[cfg(not(debug_assertions))]
    let mut writer = std::io::BufWriter::new(stdout.lock());
    #[cfg(debug_assertions)]
    let mut writer = stdout.lock();
    solve(stdin.lock(), &mut writer);
    writer.flush().unwrap();
  }

  if let Some(stack_size_mebibytes) = CUSTOM_STACK_SIZE_MEBIBYTES {
    std::thread::Builder::new()
      .name("exec_solver".to_owned())
      .stack_size(stack_size_mebibytes * 1024 * 1024)
      .spawn(exec_solver)
      .unwrap()
      .join()
      .unwrap();
  } else {
    exec_solver();
  }
}

fn solve<R: BufRead, W: Write>(reader: R, mut writer: W) {
  let mut _scanner = spella::io::Scanner::new(reader);

  #[allow(unused_macros)]
  macro_rules! scan {
    ($T:ty) => {
      _scanner.next::<$T>().unwrap().unwrap()
    };
    ($($T:ty),+) => {
      ($(scan!($T)),+)
    };
    ($($T:ty),+; $n:expr $(; $m:expr)*) => {{
      (0..$n).map(|_| scan!($($T),+ $(; $m)*)).collect::<Vec<_>>()
    }};
  }

  #[allow(unused_macros)]
  macro_rules! scan_iter {
    ($($T:ty),+; $n:expr) => {
      (0..$n).map(|_| scan!($($T),+))
    };
  }

  #[allow(unused_macros)]
  macro_rules! print {
    ($fmt:expr) => {
      write!(writer, $fmt).unwrap()
    };
    ($fmt:expr, $($arg:tt)*) => {
      write!(writer, $fmt, $($arg)*).unwrap()
    };
  }

  #[allow(unused_macros)]
  macro_rules! println {
    ($fmt:expr) => {
      writeln!(writer, $fmt).unwrap()
    };
    ($fmt:expr, $($arg:tt)*) => {
      writeln!(writer, $fmt, $($arg)*).unwrap()
    };
  }

  #[allow(unused_macros)]
  macro_rules! eprint {
    ($fmt:expr) => {
      #[cfg(debug_assertions)]
      write!(std::io::stderr(), $fmt).unwrap()
    };
    ($fmt:expr, $($arg:tt)*) => {
      #[cfg(debug_assertions)]
      write!(std::io::stderr(), $fmt, $($arg)*).unwrap()
    };
  }

  #[allow(unused_macros)]
  macro_rules! eprintln {
    ($fmt:expr) => {
      #[cfg(debug_assertions)]
      writeln!(std::io::stderr(), $fmt).unwrap()
    };
    ($fmt:expr, $($arg:tt)*) => {
      #[cfg(debug_assertions)]
      writeln!(std::io::stderr(), $fmt, $($arg)*).unwrap()
    };
  }

  #[allow(unused_macros)]
  macro_rules! dbg {
    ($($x:expr),+) => {{
      eprintln!(concat!("[{}:{}] ", $(stringify!($x), " = {:?}; "),+), file!(), line!(), $($x),+);
    }};
  }

  let s = scan!(ByteString);

  let mut g = Vec::<(usize, usize, usize)>::new();

  {
    let mut first_r = true;
    let mut first_l = true;
    let mut i = 0;
    let mut p = 0;
    let mut q = 0;

    for j in 0..s.len() {
      match s[j] {
        ByteChar(b'R') => {
          if first_r {
            if p > 0 || q > 0 {
              g.push((i, p, q));
            }
            p = 0;
            q = 0;
            first_r = false;
          }
          p += 1;
          first_l = true;
        }
        ByteChar(b'L') => {
          if first_l {
            i = j - 1;
            first_l = false;
          }
          q += 1;
          first_r = true;
        }
        _ => unreachable!(s[j]),
      }
    }

    g.push((i, p, q));
  }

  dbg!(g);

  let mut i = 0;

  for (j, mut p, mut q) in g {
    dbg!(j, p, q, i);

    for _ in i..j {
      print!("0 ");
    }
    i = j + 2;

    let mut r = 1;
    let mut s = 1;
    p -= 1;
    q -= 1;

    let max_p_q = cmp::max(p, q);

    for _ in 0..max_p_q + if max_p_q % 2 != 0 { 1 } else { 0 } {
      dbg!(p, r, s, q);

      mem::swap(&mut r, &mut s);

      if p > 0 {
        r += 1;
        p -= 1;
      }
      if q > 0 {
        s += 1;
        q -= 1;
      }
    }

    dbg!(r, s);
    print!("{} {} ", r, s);
  }

  for _ in i..s.len() {
    print!("0 ");
  }

  println!("");
}


#[allow(unused_imports)]
use std::cmp;
use std::io::Write;

// Input macro from https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
macro_rules! input {
  (source = $s:expr, $($r:tt)*) => {
    let mut iter = $s.split_whitespace();
    input_inner!{iter, $($r)*}
  };
  ($($r:tt)*) => {
    let s = {
      use std::io::Read;
      let mut s = String::new();
      std::io::stdin().read_to_string(&mut s).unwrap();
      s
    };
    let mut iter = s.split_whitespace();
    input_inner!{iter, $($r)*}
  };
}

macro_rules! input_inner {
  ($iter:expr) => {};
  ($iter:expr, ) => {};

  ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
    let $var = read_value!($iter, $t);
    input_inner!{$iter $($r)*}
  };
}

macro_rules! read_value {
  ($iter:expr, ( $($t:tt),* )) => {
    ( $(read_value!($iter, $t)),* )
  };

  ($iter:expr, [ $t:tt ; $len:expr ]) => {
    (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
  };

  ($iter:expr, chars) => {
    read_value!($iter, String).chars().collect::<Vec<char>>()
  };

  ($iter:expr, usize1) => {
    read_value!($iter, usize) - 1
  };

  ($iter:expr, $t:ty) => {
    $iter.next().unwrap().parse::<$t>().expect("Parse error")
  };
}

fn main() {
  let out = std::io::stdout();
  let mut out = std::io::BufWriter::new(out.lock());
  macro_rules! puts {
    ($($format:tt)*) => (write!(out,$($format)*).unwrap());
  }
  input! {
    s: chars,
  }
  let n = s.len();
  let mut stay = vec![false; n];
  for i in 1 .. n {
    if s[i-1] == 'R' && s[i] == 'L' {
      stay[i-1] = true;
      stay[i] = true;
    }
  }
  let mut count = vec![1; n];
  for i in 1 .. n {
    if s[i-1] == 'R' && ! stay[i-1] {
      count[i+1] += count[i-1];
      count[i-1] = 0;
    }
  }
  for i in (1 .. n).rev() {
    if s[i] == 'L' && ! stay[i] {
      count[i-2] += count[i];
      count[i] = 0;
    }
  }
  for &c in &count {
    puts!("{} ", c);
  }
  puts!("\n");
}


#![allow(unused_macros)]
#![allow(dead_code)]
#![allow(unused_imports)]

use itertools::Itertools;

const U_INF: usize = 1 << 60;
const I_INF: isize = 1 << 60;

fn main() {
    let mut sc = Scanner::new();
    let s = sc.next_chars();
    let l = s.len();
    let log = 1e5f64.log2().floor() as usize;

    let mut doubling = Vec::with_capacity(log);

    {
        let mut v = vec![U_INF; l];
        for j in 0..l {
            if s[j] == 'R' {
                v[j] = j + 1;
            } else {
                v[j] = j - 1;
            }
        }
        doubling.push(v);
    }

    for i in 0..log {
        let mut v = vec![U_INF; l];
        for j in 0..l {
            v[j] = doubling[i][doubling[i][j]];
        }
        doubling.push(v);
    }

    let mut now = (0..l).collect_vec();
    for i in 0..=log {
        if (100000 & 1 << i) != 0 {
            let mut v = vec![U_INF; l];
            for j in 0..l {
                v[j] = doubling[i][j];
            }
            now = v;
        }
    }

    let mut ans = vec![0; l];
    for n in now {
        ans[n] += 1;
    }

    println!("{}", ans.into_iter().join(" "));
}

pub struct Scanner {
    buf: std::collections::VecDeque<String>,
}

impl Scanner {
    pub fn new() -> Self {
        Self {
            buf: std::collections::VecDeque::new(),
        }
    }

    fn scan_line(&mut self) {
        let mut flag = 0;
        while self.buf.is_empty() {
            let mut s = String::new();
            std::io::stdin().read_line(&mut s).unwrap();
            let mut iter = s.split_whitespace().peekable();
            if iter.peek().is_none() {
                if flag >= 5 {
                    panic!("There is no input!");
                }
                flag += 1;
                continue;
            }

            for si in iter {
                self.buf.push_back(si.to_string());
            }
        }
    }

    pub fn next<T: std::str::FromStr>(&mut self) -> T {
        self.scan_line();
        self.buf
            .pop_front()
            .unwrap()
            .parse()
            .unwrap_or_else(|_| panic!("Couldn't parse!"))
    }

    pub fn next_usize(&mut self) -> usize {
        self.next()
    }

    pub fn next_isize(&mut self) -> isize {
        self.next()
    }

    pub fn next_chars(&mut self) -> Vec<char> {
        self.next::<String>().chars().collect()
    }

    pub fn next_string(&mut self) -> String {
        self.next()
    }

    pub fn next_char(&mut self) -> char {
        self.next()
    }

    pub fn next_float(&mut self) -> f64 {
        self.next()
    }
}


#![allow(unused_macros)]
#![allow(dead_code)]
#![allow(unused_imports)]

use itertools::Itertools;

const U_INF: usize = 1 << 60;
const I_INF: isize = 1 << 60;

fn main() {
    let mut sc = Scanner::new();
    let s = sc.next_chars();
    let l = s.len();
    let log = 1e5f64.log2().floor() as usize;

    let mut doubling = Vec::with_capacity(log);

    {
        let mut v = vec![U_INF; l];
        for j in 0..l {
            if s[j] == 'R' {
                v[j] = j + 1;
            } else {
                v[j] = j - 1;
            }
        }
        doubling.push(v);
    }

    for i in 0..log {
        let mut v = vec![U_INF; l];
        for j in 0..l {
            v[j] = doubling[i][doubling[i][j]];
        }
        doubling.push(v);
    }

    let mut now = (0..l).collect_vec();
    for i in 0..log {
        if (100000 & 1 << i) != 0 {
            let mut v = vec![U_INF; l];
            for j in 0..l {
                v[j] = doubling[i][j];
            }
            now = v;
        }
    }

    let mut ans = vec![0; l];
    for n in now {
        ans[n] += 1;
    }

    println!("{}", ans.into_iter().join(" "));
}

pub struct Scanner {
    buf: std::collections::VecDeque<String>,
}

impl Scanner {
    pub fn new() -> Self {
        Self {
            buf: std::collections::VecDeque::new(),
        }
    }

    fn scan_line(&mut self) {
        let mut flag = 0;
        while self.buf.is_empty() {
            let mut s = String::new();
            std::io::stdin().read_line(&mut s).unwrap();
            let mut iter = s.split_whitespace().peekable();
            if iter.peek().is_none() {
                if flag >= 5 {
                    panic!("There is no input!");
                }
                flag += 1;
                continue;
            }

            for si in iter {
                self.buf.push_back(si.to_string());
            }
        }
    }

    pub fn next<T: std::str::FromStr>(&mut self) -> T {
        self.scan_line();
        self.buf
            .pop_front()
            .unwrap()
            .parse()
            .unwrap_or_else(|_| panic!("Couldn't parse!"))
    }

    pub fn next_usize(&mut self) -> usize {
        self.next()
    }

    pub fn next_isize(&mut self) -> isize {
        self.next()
    }

    pub fn next_chars(&mut self) -> Vec<char> {
        self.next::<String>().chars().collect()
    }

    pub fn next_string(&mut self) -> String {
        self.next()
    }

    pub fn next_char(&mut self) -> char {
        self.next()
    }

    pub fn next_float(&mut self) -> f64 {
        self.next()
    }
}


#![allow(unused_macros)]
#![allow(dead_code)]
#![allow(unused_imports)]

use itertools::Itertools;

const U_INF: usize = 1 << 60;
const I_INF: isize = 1 << 60;

fn main() {
    let mut sc = Scanner::new();
    let s = sc.next_chars();
    let l = s.len();
    let log = 1e5f64.log2().floor() as usize;
    let mut doubling = Vec::with_capacity(log);
    let now = (0..l).collect_vec();
    doubling.push(now);

    for i in 0..=log {
        let mut v = vec![U_INF; l];
        for j in 0..l {
            if s[doubling[i][j]] == 'R' {
                v[j] = doubling[i][j] + 1;
            } else {
                v[j] = doubling[i][j] - 1;
            }
        }
        doubling.push(v);
    }

    let mut now = (0..l).collect_vec();
    for i in 0..=1e5f64.log2().floor() as usize {
        if (100000 & 1 << i) != 0 {
            let mut v = vec![U_INF; l];
            for j in 0..l {
                v[j] = doubling[i + 1][now[j]];
            }
            now = v;
        }
    }

    let mut ans = vec![0; l];
    for i in now {
        ans[i] += 1;
    }

    println!("{}", ans.into_iter().join(" "));
}

pub struct Scanner {
    buf: std::collections::VecDeque<String>,
}

impl Scanner {
    pub fn new() -> Self {
        Self {
            buf: std::collections::VecDeque::new(),
        }
    }

    fn scan_line(&mut self) {
        let mut flag = 0;
        while self.buf.is_empty() {
            let mut s = String::new();
            std::io::stdin().read_line(&mut s).unwrap();
            let mut iter = s.split_whitespace().peekable();
            if iter.peek().is_none() {
                if flag >= 5 {
                    panic!("There is no input!");
                }
                flag += 1;
                continue;
            }

            for si in iter {
                self.buf.push_back(si.to_string());
            }
        }
    }

    pub fn next<T: std::str::FromStr>(&mut self) -> T {
        self.scan_line();
        self.buf
            .pop_front()
            .unwrap()
            .parse()
            .unwrap_or_else(|_| panic!("Couldn't parse!"))
    }

    pub fn next_usize(&mut self) -> usize {
        self.next()
    }

    pub fn next_isize(&mut self) -> isize {
        self.next()
    }

    pub fn next_chars(&mut self) -> Vec<char> {
        self.next::<String>().chars().collect()
    }

    pub fn next_string(&mut self) -> String {
        self.next()
    }

    pub fn next_char(&mut self) -> char {
        self.next()
    }

    pub fn next_float(&mut self) -> f64 {
        self.next()
    }
}


let S = readLine()!.characters.map{$0}
var ans = (0..<S.count).map{_ in 0}
var odd = 0
var even = 0
for i in 0..<S.count {
    if S[i] == "R" {
        i%2>0 ? (odd+=1) : (even+=1)
    } else {
        ans[i] += (i%2>0 ? odd : even)
        ans[i-1] += (i%2>0 ? even : odd)
        odd = 0
        even = 0
    }
}
for i in (0..<S.count).reverse() {
    if S[i] == "L" {
        i%2>0 ? (even+=1) : (odd+=1)
    } else {
        ans[i] += (i%2>0 ? even : odd)
        ans[i+1] += (i%2>0 ? odd : even)
        odd = 0
        even = 0
    }
}
print(ans.map{String($0)}.joinWithSeparator(" "))


let S = readLine()!.characters.map{$0}
var ans = (0..<S.count).map{_ in 0}
var a = 0
var b = 0
for (i, c) in S.enumerate() {
    if c == "R" {
        i%2>0 ?a++:b++
    } else {
        ans[i] += (i%2>0 ?a:b)
        ans[i-1] += (i%2>0 ?b:a)
        a = 0
        b = 0
    }
}
for (i, c) in S.enumerate().reverse() {
    if c == "L" {
        i%2>0 ?b++:a++
    } else {
        ans[i] += (i%2>0 ?b:a)
        ans[i+1] += (i%2>0 ?a:b)
        a = 0
        b = 0
    }
}
print(ans.map{String($0)}.joinWithSeparator(" "))


import Foundation
import CoreFoundation

#if swift(>=4.0)
#else
extension String {
    func split(separator separator: Character) -> [String] {
        return self.characters.split(separator).map{String($0)}
    }
    var count: Int {
        return self.characters.count
    }
    func uppercased() -> String {
        return self.uppercaseString
    }
    func lowercased() -> String {
        return self.lowercaseString
    }
}
extension Array where Element: Comparable {
    func max() -> Element? {
        return self.maxElement()
    }
    func min() -> Element? {
        return self.minElement()
    }
    func sorted() -> Array {
        return self.sort()
    }
    mutating func sort() {
        self.sortInPlace()
    }
}
extension Array {
    mutating func swapAt(i: Int, _ j: Int) {
        swap(&self[i], &self[j])
    }
    func joined(separator separator: String = " ") -> String {
        return self.map{String($0)}.joinWithSeparator(separator)
    }
    func reversed() -> Array {
        return self.reverse()
    }
    mutating func reverse() {
        self = self.reversed()
    }
    func enumerated() -> EnumerateSequence<[Element]> {
        return self.enumerate()
    }
    init(repeating: Element, count: Int) {
        self.init(count: count, repeatedValue: repeating)
    }
}
func stride<T: Strideable>(from start: T, to end: T, by stride: T.Stride) -> StrideTo<T> {
    return start.stride(to: end, by: stride)
}
#endif
func readInt() -> Int? {
    return Int(readLine()!)
}
func readStringSplit(by separator: Character = " ") -> [String] {
    return readLine()!.split(separator: separator)
}
func readIntSplit(by separator: Character = " ") -> [Int] {
    return readLine()!.split(separator: separator).map{Int($0)!}
}
prefix operator * { }
prefix func * <T> (a: [T]) -> (T, T)          { return (a[0], a[1]) }
prefix func * <T> (a: [T]) -> (T, T, T)       { return (a[0], a[1], a[2]) }
prefix func * <T> (a: [T]) -> (T, T, T, T)    { return (a[0], a[1], a[2], a[3]) }
prefix func * <T> (a: [T]) -> (T, T, T, T, T) { return (a[0], a[1], a[2], a[3], a[4]) }
infix operator ** { associativity right precedence 155 }    // 右結合，乗除算より強くビットシフトより弱い
func **(lhs: Int, rhs: Int) -> Int {
    return (0..<rhs).reduce(1){i,_ in i*lhs}
}
func **(lhs: Int, rhs: Double) -> Double {
    return pow(Double(lhs), rhs)
}
//func gcd(x: Int, _ y: Int) -> Int {
//    return y>0 ? gcd(y, x%y) : x
//}
//func lcm(x: Int, _ y: Int) -> Int {
//    return x * y / gcd(x, y)
//}
let MOD = 10**9+7

/*************** テストスペース ***************/

//arr.sort{$0.0==$1.0 ? $0.1<$1.1 : $0.0<$1.0}  // タプル配列のソート

/*************** メインプログラム ***************/

let S = readLine()!.characters.map{$0}
var ans = (0..<S.count).map{_ in 0}
var a = 0
var b = 0
for i in 0..<S.count {
    if S[i] == "R" {
        i%2==0 ? (a+=1) : (b+=1)
    } else {
        ans[i] += (i%2>0 ? b : a)
        ans[i-1] += (i%2>0 ? a : b)
        a = 0
        b = 0
    }
}
var c = 0
var d = 0
for i in (0..<S.count).reverse() {
    if S[i] == "L" {
        i%2==0 ? (c+=1) : (d+=1)
    } else {
        ans[i] += (i%2>0 ? d : c)
        ans[i+1] += (i%2>0 ? c : d)
        c = 0
        d = 0
    }
}
print(ans.map{String($0)}.joined())


let S = readLine()!.characters.enumerate()
var ans = S.map{_ in 0}
var cnt = [0,0]
for (i,c) in S {
    if c == "R" {
        cnt[i%2]++
    } else {
        ans[i] += a[i%2]
        ans[i-1] += a[i%2^1]
        cnt = [0,0]
    }
}
for (i,c) in S.reverse() {
    if c == "L" {
        cnt[i%2]++
    } else {
        ans[i] += a[i%2]
        ans[i+1] += a[i%2^1]
        cnt = [0,0]
    }
}
ans.forEach{print($0,terminator:" ")}


import * as fs from "fs";

let S = fs.readFileSync("/dev/stdin", "utf8").trim();

let count: number[] = new Array(S.length).fill(0);

for(let i=1; i<S.length; i++) {
    if (S[i-1] == 'R' && S[i] == 'L') {
        let j = i-1;
        let c = 0;
        while (j >= 0 && S[j] == 'R') {
            if (c%2 == 0) {
                count[i-1] += 1;
            } else {
                count[i] += 1;
            }
            c += 1;
            j -= 1;
        }
        j = i;
        c = 0;
        while (j < S.length && S[j] == 'L') {
            if (c%2 == 0) {
                count[i] += 1;
            } else {
                count[i-1] += 1;
            }
            c += 1
            j += 1;
        }
    }
}

console.log(count.join(' '));


const stdin = require('fs').readFileSync('/dev/stdin', 'utf8').trim()

const s = stdin.split('\n')[0]

const ans = () => {
  let arr = [0]

  let rl = []

  for (let i = 1; i < s.length; i++) {
    if (s[i - 1] === 'R' && s[i] === 'L') {
      rl.push(i)
    }

    arr.push(0)
  }

  for (let i = 0; i < rl.length; i++) {
    const ls = countL(rl[i])
    const rs = countR(rl[i])

    const l = 1 + Math.floor(ls / 2) + Math.ceil(rs / 2)
    const r = 1 + Math.ceil(ls / 2) + Math.floor(rs / 2)

    const lIndex = rl[i]
    const rIndex = rl[i] - 1

    arr[lIndex] = l
    arr[rIndex] = r
  }

  console.log(arr.join(' '))
}

const countL = num => {
  let count = 0

  for (let i = num + 1; ; i++) {
    if (s[i] === 'L') {
      count++
    } else {
      return count
    }
  }
}

const countR = num => {
  let count = 0

  for (let i = num - 2; ; i--) {
    if (s[i] === 'R') {
      count++
    } else {
      return count
    }
  }
}

ans()


function main(input: string) {
  const lines = input.trim().split('\n')

  const L = 'L'
  const R = 'R'
  const cs = lines[0].split('')
  let k = 0

  const a = cs.map(() => 0)
  cs.forEach((c, i) => {
    if (c === R) {
      k++
      return
    }
    if (k > 0) {
      a[i - 1] = Math.round(k / 2)
      a[i] = Math.floor(k / 2)
      k = 0
    }
  })

  cs.reverse().forEach((c, i) => {
    const j = a.length - i - 1
    if (c === L) {
      k++
      return
    }
    if (k > 0) {
      a[j + 1] += Math.round(k / 2)
      a[j] += Math.floor(k / 2)
      k = 0
    }
  })
  // console.log(a)
  console.log(a.join(' '))
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'))


import * as fs from "fs";

let S = fs.readFileSync("/dev/stdin", "utf8").trim();

let count: number[] = new Array(S.length).fill(0);

for(let i=1; i<S.length; i++) {
    if (S[i-1] == 'R' && S[i] == 'L') {
        let j = i-1;
        let c = 0;
        while (j >= 0 && S[j] == 'R') {
            if (c%2 == 0) {
                count[i-1] += 1;
            } else {
                count[i] += 1;
            }
            c += 1;
            j -= 1;
        }
        j = i;
        c = 0;
        while (j < S.length && S[j] == 'L') {
            if (c%2 == 0) {
                count[i] += 1;
            } else {
                count[i-1] += 1;
            }
            c += 1
            j += 1;
        }
    }
}

console.log(...count);


// general helpers
const debug = (message?: any, ...optionalParams: any[]) => {
  if (process.env.LOCAL_DEBUG === '1') console.log(message, ...optionalParams)
}

// helpers
const parseLines = (
  lines: string[]
): { S: string[] } => {
  const S = lines[0].split('')
  const obj = { S }
  debug(obj)
  return obj
}

// solver
export const solve = (lines: string[]): string => {
  const { S: definition } = parseLines(lines)
  const digits = new Array(definition.length).fill(1)
  const shift = (definition: string[], digits: number[]): number[] => {
    const result = new Array(definition.length).fill(0)
    for (let i = 0; i < digits.length; i++) {
      if (definition[i] === 'R') {
        result[i + 1] += digits[i]
      } else {
        result[i - 1] += digits[i]
      }
    }
    return result
  }

  let prev = shift(definition, digits.slice())
  let current = shift(definition, prev.slice())

  for (let i = 0; i < 100; i++) {
    prev = current.slice()
    current = shift(definition, prev.slice())
  }
  return current.join(' ')
}

// main
const main = (lines: string[]) => {
  console.log(solve(lines))
}

// exec main function for submit
if (process.env.LOCAL_DEBUG !== '1') {
  const { stdin: input, stdout: output } = process
  input.resume()
  input.setEncoding('utf8')
  const lines: string[] = []
  require('readline')
    .createInterface({ input, output })
    .on('line', (line: string) => lines.push(line))
    .on('close', () => main(lines))
}


// general helpers
const debug = (message?: any, ...optionalParams: any[]) => {
  if (process.env.LOCAL_DEBUG === '1') console.log(message, ...optionalParams)
}

// helpers
const parseLines = (
  lines: string[]
): { S: string[] } => {
  const S = lines[0].split('')
  const obj = { S }
  debug(obj)
  return obj
}

// solver
export const solve = (lines: string[]): string => {
  const { S: definition } = parseLines(lines)
  const digits = new Array(definition.length).fill(1)
  const shift = (definition: string[], digits: number[]): number[] => {
    const result = new Array(definition.length).fill(0)
    for (let i = 0; i < digits.length; i++) {
      if (definition[i] === 'R') {
        result[i + 1] += digits[i]
      } else {
        result[i - 1] += digits[i]
      }
    }
    return result
  }

  let prev = shift(definition, digits.slice())
  let current = shift(definition, prev.slice())

  for (let i = 0; i < 100000; i++) {
    prev = current.slice()
    current = shift(definition, prev.slice())
  }
  return current.join(' ')
}

// main
const main = (lines: string[]) => {
  console.log(solve(lines))
}

// exec main function for submit
if (process.env.LOCAL_DEBUG !== '1') {
  const { stdin: input, stdout: output } = process
  input.resume()
  input.setEncoding('utf8')
  const lines: string[] = []
  require('readline')
    .createInterface({ input, output })
    .on('line', (line: string) => lines.push(line))
    .on('close', () => main(lines))
}


# import sys
# import math #sqrt
# import decimal
# import queue # queue
# import bisect
# import heapq # priolity-queue
# import time
# import itertools
# import collections # deque
# from operator import itemgetter
# from fractions import Fraction

mod = int(1e9+7)
INF = 1<<29
lINF = 1<<35

def main():
    h,w = map(int,input().split())
    s = []
    for i in range(h):
        s.append(list(input()))
    ans = [[0 for i in range(w+2)] for j in range(h+2)]
    for i in range(h):
        for j in range(w):
            if s[i][j]=="#":
                ans[i][j] += 1
                ans[i+1][j] += 1
                ans[i+2][j] += 1
                ans[i][j+1] += 1
                ans[i+2][j+1] += 1
                ans[i][j+2] += 1
                ans[i+1][j+2] += 1
                ans[i+2][j+2] += 1
    for i in range(h):
        for j in range(w):
            if s[i][j]=="#":
                ans[i+1][j+1] = "#"
            else:
                ans[i+1][j+1] = str(ans[i+1][j+1])
    for i in range(1,h+1):
        print(''.join(ans[i][1:w+1]))
    return

if __name__=='__main__':
    main()


h,w=map(int,input().split())
s=["*"*(w+2)]
for i in range(h):
  s.append("*"+input()+"*")
s+=["*"*(w+2)]
a=[[0]*w for _ in range(h)]
for i in range(h):
  for j in range(w):
    if s[i+1][j+1]=="#":
      a[i][j]="#"
    else:
      a[i][j]=(s[i][j:j+3]+s[i+1][j:j+3]+s[i+2][j:j+3]).count("#")
for i in a:
  print("".join(map(str,i)))


def solve():
    H, W = map(int, input().split())
    a = [list("."+input()+".") for _ in [0]*H]
    a.insert(0, list("."*(W+2)))
    a.append(list("."*(W+2)))
    result = []

    for y in range(1, H+1):
        for x in range(1, W+1):
            if a[y][x] == "#":
                result.append("#")
            else:
                result.append(str((a[y-1][x-1:x+2]+a[y][x-1:x+2]+a[y+1][x-1:x+2]).count("#")))
        result.append("\n")

    print("".join(result))

if __name__ == "__main__":
    solve()


import numpy as np

h,w = map(int,(input().split()))
s = [list(map(str,input())) for i in range(h)]
l = [[0]*(w+2) for i in range(h+2)]

def addFlag(i,j):
    for x in range(3):
        for y in range(3):
            if l[i+x][j+y] != '#':
                l[i+x][j+y] += 1

for i in range(h):
    for j in range(w):
        if s[i][j] == '#':
            l[i+1][j+1] = '#'
            addFlag(i,j)

l = np.delete(l,[0,h+1],0)
l = np.delete(l,[0,w+1],1)

for i in l:
    if len(i)>1:
        ans = ''.join(i)
    else:
        ans = int(i)
    print(ans)


import numpy as np

h,w = map(int,(input().split()))
s = [list(map(str,input())) for i in range(h)]
l = [[0]*(w+2) for i in range(h+2)]

def addFlag(i,j):
    for x in range(3):
        for y in range(3):
            if l[i+x][j+y] != '#':
                l[i+x][j+y] += 1

for i in range(h):
    for j in range(w):
        if s[i][j] == '#':
            l[i+1][j+1] = '#'
            addFlag(i,j)

l = np.delete(l,[0,h+1],0)
l = np.delete(l,[0,w+1],1)

for i in l:
    if len(i)>1:
        ans = ''.join(i)
    else:
        ans = print(*i)
    print(ans)


import numpy as np

h,w = map(int,(input().split()))
s = [list(map(str,input())) for i in range(h)]
l = [[0]*(w+2) for i in range(h+2)]

def addFlag(i,j):
    for x in range(3):
        for y in range(3):
            if l[i+x][j+y] != '#':
                l[i+x][j+y] += 1

for i in range(h):
    for j in range(w):
        if s[i][j] == '#':
            l[i+1][j+1] = '#'
            addFlag(i,j)

l = np.delete(l,[0,h+1],0)
l = np.delete(l,[0,w+1],1)

for i in l:
    if len(i)>1:
        ans = ''.join(i)
    else:
        ans = i
    print(*ans)