#include <iostream>
#include <sstream>
#include <vector>
#include <iomanip>
#include <algorithm>
#include <set>
#include <memory>

struct TestData
{
  int testNum;
  std::string input;
  std::string expectedOutput;
};

struct TestResult
{
  std::string testOutput;
  bool testPassed;
};

void testSolution();
TestResult runTestCase(const TestData& testData);
std::string formatResult(const TestData& testData, const TestResult& testResult);
std::string formatOverallResult(const std::vector<TestResult>& testResult);
void solution(std::istream& is, std::ostream& os);
size_t findNextRL(const std::string& rls, size_t startpos);
size_t findNextLR(const std::string& rls, size_t startpos);
int calculateNumChildrenLeftOfRL(size_t rlpos, size_t lastlrpos);
int calculateNumChildrenRightOfRL(size_t rlpos, size_t lrpos, size_t lastpos);
void calculateNumChildren(std::vector<int>& numChildrenOnSquare, size_t rlpos, size_t lastlrpos, size_t lrpos);

static const bool IS_TESTING = false;

// define test data
static const std::vector<TestData> testDatas = {
  {1, "RRLRL\n", "0 1 2 1 1\n"},
  {2, "RRLLLLRLRRLL\n", "0 3 3 0 0 0 1 1 0 2 2 0\n"},
  {3, "RRRLLRLLRRRLLLLL\n", "0 0 3 2 0 2 1 0 0 0 4 4 0 0 0 0\n"},
};

int main()
{
  if (IS_TESTING)
    testSolution();
  else
    solution(std::cin, std::cout);

  return 0;
}

void testSolution()
{
  auto results = std::vector<TestResult>();

  for (const auto& testData : testDatas) {
    auto testResult = runTestCase(testData);
    results.push_back(testResult);

    std::cout << formatResult(testData, testResult);
  }
  std::cout << formatOverallResult(results);
}

TestResult runTestCase(const TestData& testData)
{
    std::istringstream iss {testData.input};
    std::ostringstream oss {};

    solution(iss, oss);

    auto testOutput = oss.str();
    auto testPassed = testData.expectedOutput.compare(testOutput) == 0;
    
    return {testOutput, testPassed};
}

std::string formatResult(const TestData& testData, const TestResult& testResult)
{
  std::ostringstream oss {};

  oss << "Test " << std::setw(2) << testData.testNum << ": "
    << (testResult.testPassed ? "Passed!" : "Failed!") << std::endl;
  
  oss << "\tExpected: " << testData.expectedOutput << "\tActual  : " << testResult.testOutput << std::endl;

  return oss.str();
}

std::string formatOverallResult(const std::vector<TestResult>& testResults)
{
  std::ostringstream oss {};

  int passedTestCount = 0;
  for (const auto& result : testResults) {
    if (result.testPassed) passedTestCount++;
  }

  oss << passedTestCount << "/" << testResults.size()
    << " tests passed" << std::endl;

  return oss.str();
}

// solution to the problem
void solution(std::istream& is, std::ostream& os)
{
  // read from input
  std::string RLs;
  is >> RLs;

  auto numChildrenOnSquare = std::vector<int>(RLs.size(), 0);

  auto lastRLPos = -1;
  auto lastLRPos = -1;
  while (true) {
    auto rlpos = findNextRL(RLs, lastRLPos + 1);
    if (rlpos == std::string::npos) break;
    auto lrpos = findNextLR(RLs, rlpos + 1);

    calculateNumChildren(numChildrenOnSquare, rlpos, lastLRPos, lrpos);

    lastRLPos = rlpos;
    lastLRPos = lrpos;
  }

  // print to output
  for (auto i = 0; i < numChildrenOnSquare.size(); ++i) {
    os << numChildrenOnSquare[i] << ((i == numChildrenOnSquare.size() - 1) ? "" : " ");
  }
  os << std::endl;
}

size_t findNextRL(const std::string& rls, size_t startpos)
{
  return rls.find("RL", startpos);
}
size_t findNextLR(const std::string& rls, size_t startpos)
{
  return rls.find("LR", startpos);
}
int calculateNumChildrenLeftOfRL(size_t rlpos, size_t lastlrpos)
{
  if (lastlrpos == -1) return rlpos;

  return rlpos - lastlrpos - 1;
}
int calculateNumChildrenRightOfRL(size_t rlpos, size_t lrpos, size_t lastpos)
{
  if (lrpos == std::string::npos) return lastpos - rlpos - 1;

  return lrpos - rlpos - 1;
}
void calculateNumChildren(std::vector<int>& numChildrenOnSquare, size_t rlpos, size_t lastlrpos, size_t lrpos)
{
    auto numChildrenLeft = calculateNumChildrenLeftOfRL(rlpos, lastlrpos);
    auto numChildrenRight = calculateNumChildrenRightOfRL(rlpos, lrpos, numChildrenOnSquare.size() - 1);

    auto r = (numChildrenLeft + numChildrenRight) / 2 + 1;
    auto l = (numChildrenLeft + numChildrenRight) / 2 + 1;
    if ((numChildrenLeft + numChildrenRight) % 2 == 1) {
      if (numChildrenLeft % 2 == 0)
        r += 1;
      else
        l += 1;
    }

    numChildrenOnSquare[rlpos] = r;
    numChildrenOnSquare[rlpos + 1] = l;
}

Measured memory_bytes: 1152