#include <iostream>
#include <string>
using namespace std;

int main() {
	std::string newDes = "1111P1P";
	size_t start = 0, end, count;
	while ((start = newDes.find('1', start)) != std::string::npos)
	{
	    if ((end = newDes.find_first_not_of('1', start+1)) == std::string::npos)
	    	end = newDes.size();
    	count = end - start;
	    std::string replacement = std::to_string(count);
    	newDes.replace(start, count, replacement);
    	start += replacement.size();
	}
	std::cout << newDes;
	return 0;
}