#include <iostream>
#include <regex>

int main() {
	std::string S = "-0001011101";
	std::regex reg("([^1]|^)1(?!1)");
	std::cout << std::regex_replace(S, reg, "$012") << std::endl;
	return 0;
}