#include <iostream>
#include <string>
#include <sstream>
std::string Indent(std::string s)
{
std::string result;
std::istringstream iss(s);
for (std::string line; std::getline(iss, line); )
{
result += " " + line + "\n";
}
return result;
}
int main() {
std::string in;
in += "<region>test\n";
in += " <left>3</left>\n";
in += " <right>4</right>\n";
in += "</region>\n";
std::string out;
out += "<texture>lel\n";
out += Indent(in);
out += "</texture>\n";
printf("%s\n", out.c_str());
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgojaW5jbHVkZSA8c3N0cmVhbT4KCgpzdGQ6OnN0cmluZyBJbmRlbnQoc3RkOjpzdHJpbmcgcykKewoJc3RkOjpzdHJpbmcgcmVzdWx0OwoKCXN0ZDo6aXN0cmluZ3N0cmVhbSBpc3Mocyk7CgoJZm9yIChzdGQ6OnN0cmluZyBsaW5lOyBzdGQ6OmdldGxpbmUoaXNzLCBsaW5lKTsgKQoJewogICAgCXJlc3VsdCArPSAiICAiICsgbGluZSArICJcbiI7Cgl9CgkKCXJldHVybiByZXN1bHQ7Cn0KCQoKaW50IG1haW4oKSB7CglzdGQ6OnN0cmluZyBpbjsKCWluICs9ICI8cmVnaW9uPnRlc3RcbiI7CglpbiArPSAiICA8bGVmdD4zPC9sZWZ0PlxuIjsKCWluICs9ICIgIDxyaWdodD40PC9yaWdodD5cbiI7CglpbiArPSAiPC9yZWdpb24+XG4iOwoJCglzdGQ6OnN0cmluZyBvdXQ7CglvdXQgKz0gIjx0ZXh0dXJlPmxlbFxuIjsKCW91dCArPSBJbmRlbnQoaW4pOwoJb3V0ICs9ICI8L3RleHR1cmU+XG4iOwoJCglwcmludGYoIiVzXG4iLCBvdXQuY19zdHIoKSk7CglyZXR1cm4gMDsKfQ==