#include <iostream>
#include <string>
#include <sstream>
int main() {
std::string ID1 = "111223333";
std::string ID2 = "222114444";
auto printDashes = [](const std::string& id) {
std::ostringstream out;
for (std::string::const_iterator it = id.begin(); it != id.end(); ++it) {
switch (std::distance(id.begin(), it)) {
case 3:
case 5:
out << '-';
default:
out << *it;
}
}
return out.str();
};
std::cout << printDashes(ID1) << std::endl;
std::cout << printDashes(ID2) << std::endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgojaW5jbHVkZSA8c3N0cmVhbT4KCmludCBtYWluKCkgewoJc3RkOjpzdHJpbmcgSUQxID0gIjExMTIyMzMzMyI7CglzdGQ6OnN0cmluZyBJRDIgPSAiMjIyMTE0NDQ0IjsKCQoJYXV0byBwcmludERhc2hlcyA9IFtdKGNvbnN0IHN0ZDo6c3RyaW5nJiBpZCkgewogICAgICAgIHN0ZDo6b3N0cmluZ3N0cmVhbSBvdXQ7CiAgICAgICAgZm9yIChzdGQ6OnN0cmluZzo6Y29uc3RfaXRlcmF0b3IgaXQgPSBpZC5iZWdpbigpOyBpdCAhPSBpZC5lbmQoKTsgKytpdCkgewogICAgICAgICAgICBzd2l0Y2ggKHN0ZDo6ZGlzdGFuY2UoaWQuYmVnaW4oKSwgaXQpKSB7CiAgICAgICAgICAgICAgICBjYXNlIDM6CiAgICAgICAgICAgICAgICBjYXNlIDU6IAogICAgICAgICAgICAgICAgICAgIG91dCA8PCAnLSc7CgogICAgICAgICAgICAgICAgZGVmYXVsdDoKICAgICAgICAgICAgICAgICAgICBvdXQgPDwgKml0OwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIHJldHVybiBvdXQuc3RyKCk7CiAgICB9OwogICAgCiAgICBzdGQ6OmNvdXQgPDwgcHJpbnREYXNoZXMoSUQxKSA8PCBzdGQ6OmVuZGw7CiAgICBzdGQ6OmNvdXQgPDwgcHJpbnREYXNoZXMoSUQyKSA8PCBzdGQ6OmVuZGw7CgkKCXJldHVybiAwOwp9