#include <iostream>
#include <string>
#include <vector>
#include <cctype>
#include <cstdlib>
#include <stdexcept>
#include <initializer_list>
using namespace std;
const string& f(const string &s1, const string &s2)
{
return s1.size() < s2.size() ? s1 : s2;
}
string& f(string &s1, string &s2)
{
auto ret = f(const_cast<const string&>(s1), const_cast<const string&>(s2));
return const_cast<string&>(ret);
}
int main(int argc, char *argv[])
{
string x = "xxxxxx";
string y = "yyy";
string &z = f(x, y);
cout << z << endl;
cout << z << y << endl;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgojaW5jbHVkZSA8dmVjdG9yPgojaW5jbHVkZSA8Y2N0eXBlPgojaW5jbHVkZSA8Y3N0ZGxpYj4KI2luY2x1ZGUgPHN0ZGV4Y2VwdD4KI2luY2x1ZGUgPGluaXRpYWxpemVyX2xpc3Q+Cgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKY29uc3Qgc3RyaW5nJiBmKGNvbnN0IHN0cmluZyAmczEsIGNvbnN0IHN0cmluZyAmczIpCnsKICAgICAgICByZXR1cm4gczEuc2l6ZSgpIDwgczIuc2l6ZSgpID8gczEgOiBzMjsKfQoKc3RyaW5nJiBmKHN0cmluZyAmczEsIHN0cmluZyAmczIpCnsKICAgICAgICBhdXRvIHJldCA9IGYoY29uc3RfY2FzdDxjb25zdCBzdHJpbmcmPihzMSksIGNvbnN0X2Nhc3Q8Y29uc3Qgc3RyaW5nJj4oczIpKTsKICAgICAgICByZXR1cm4gY29uc3RfY2FzdDxzdHJpbmcmPihyZXQpOwp9CgppbnQgbWFpbihpbnQgYXJnYywgY2hhciAqYXJndltdKQp7CiAgICAgICAgc3RyaW5nIHggPSAieHh4eHh4IjsKICAgICAgICBzdHJpbmcgeSA9ICJ5eXkiOwoKICAgICAgICBzdHJpbmcgJnogPSBmKHgsIHkpOwoKICAgICAgICBjb3V0IDw8IHogPDwgZW5kbDsKCiAgICAgICAgY291dCA8PCB6IDw8IHkgPDwgZW5kbDsKfQo=