#include <iostream>
#include <string>
struct Container {
std::string s;
Container() {
s = "Init";
std::cout << "Constructed" << std::endl;
}
~Container() {
s = "UNSAFE";
std::cout << "Destructed" << std::endl;
}
const std::string& GetS() const {
return s;
}
};
int main() {
const std::string& s = Container().GetS();
std::cout << s << std::endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgoKc3RydWN0IENvbnRhaW5lciB7CiAgICBzdGQ6OnN0cmluZyBzOwoKICAgIENvbnRhaW5lcigpIHsKICAgICAgICBzID0gIkluaXQiOwogICAgICAgIHN0ZDo6Y291dCA8PCAiQ29uc3RydWN0ZWQiIDw8IHN0ZDo6ZW5kbDsKICAgIH0KCiAgICB+Q29udGFpbmVyKCkgewogICAgICAgIHMgPSAiVU5TQUZFIjsKICAgICAgICBzdGQ6OmNvdXQgPDwgIkRlc3RydWN0ZWQiIDw8IHN0ZDo6ZW5kbDsKICAgIH0KCiAgICBjb25zdCBzdGQ6OnN0cmluZyYgR2V0UygpIGNvbnN0IHsKICAgICAgICByZXR1cm4gczsKICAgIH0KfTsKCmludCBtYWluKCkgewogICAgY29uc3Qgc3RkOjpzdHJpbmcmIHMgPSBDb250YWluZXIoKS5HZXRTKCk7CiAgICBzdGQ6OmNvdXQgPDwgcyA8PCBzdGQ6OmVuZGw7CgogICAgcmV0dXJuIDA7Cn0=