{"problem":{"name":"LR insertion","description":{"content":"There is a sequence that contains one $0$, $A=(0)$.   Additionally, you are given a string of length $N$, $S=s_1s_2\\ldots s_N$, consisting of `L` and `R`. For each $i=1, 2, \\ldots, N$ in this order, t","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc237_d"},"statements":[{"statement_type":"Markdown","content":"There is a sequence that contains one $0$, $A=(0)$.  \nAdditionally, you are given a string of length $N$, $S=s_1s_2\\ldots s_N$, consisting of `L` and `R`.\nFor each $i=1, 2, \\ldots, N$ in this order, the following will be done.\n\n*   If $s_i$ is `L`, insert $i$ to the immediate left of $i-1$ in $A$.\n*   If $s_i$ is `R`, insert $i$ to the immediate right of $i-1$ in $A$.\n\nFind the final contents of $A$.\n\n## Constraints\n\n*   $1\\leq N \\leq 5\\times 10^5$\n*   $N$ is an integer.\n*   $|S| = N$\n*   $s_i$ is `L` or `R`.\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$N$\n$S$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"abc237_d","tags":[],"sample_group":[["5\nLRRLR","1 2 4 5 3 0\n\nInitially, $A=(0)$.  \n$S_1$ is `L`, which makes it $A=(1,0)$.  \n$S_2$ is `R`, which makes it $A=(1,2,0)$.  \n$S_3$ is `R`, which makes it $A=(1,2,3,0)$.  \n$S_4$ is `L`, which makes it $A=(1,2,4,3,0)$.  \n$S_5$ is `R`, which makes it $A=(1,2,4,5,3,0)$."],["7\nLLLLLLL","7 6 5 4 3 2 1 0"]],"created_at":"2026-03-03 11:01:13"}}