#include <iostream>
struct atama_
{
int operator ()(){ return 1; }
};
struct mune_
{
char const * operator ()(int i){ return "tekitou"; }
};
struct robo_ {
atama_ a;
mune_ m;
char const * operator ()(){ return m(a()); }
};
struct gattai {};
struct g_a
{
atama_ a;
};
g_a operator +(gattai const &g, atama_ const &a)
{
return {a};
}
robo_ operator +(g_a const &g, mune_ const &m)
{
return {g.a, m};
}
int main()
{
using namespace std;
auto atama = atama_();
auto mune = mune_();
auto robo = gattai() + atama + mune;
cout << robo() << endl;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKc3RydWN0IGF0YW1hXwp7CiAgICBpbnQgb3BlcmF0b3IgKCkoKXsgcmV0dXJuIDE7IH0KfTsKCnN0cnVjdCBtdW5lXwp7CgljaGFyIGNvbnN0ICogb3BlcmF0b3IgKCkoaW50IGkpeyByZXR1cm4gInRla2l0b3UiOyB9Cn07CgpzdHJ1Y3Qgcm9ib18gewoJYXRhbWFfIGE7CgltdW5lXyBtOwoJY2hhciBjb25zdCAqIG9wZXJhdG9yICgpKCl7IHJldHVybiBtKGEoKSk7IH0KfTsKCnN0cnVjdCBnYXR0YWkge307CnN0cnVjdCBnX2EKewoJYXRhbWFfIGE7Cn07CgpnX2Egb3BlcmF0b3IgKyhnYXR0YWkgY29uc3QgJmcsIGF0YW1hXyBjb25zdCAmYSkKewoJcmV0dXJuIHthfTsKfQoKcm9ib18gb3BlcmF0b3IgKyhnX2EgY29uc3QgJmcsIG11bmVfIGNvbnN0ICZtKQp7CglyZXR1cm4ge2cuYSwgbX07Cn0KCmludCBtYWluKCkKewoJdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCglhdXRvIGF0YW1hID0gYXRhbWFfKCk7CglhdXRvIG11bmUgPSBtdW5lXygpOwoJYXV0byByb2JvID0gZ2F0dGFpKCkgKyBhdGFtYSArIG11bmU7Cgljb3V0IDw8IHJvYm8oKSA8PCBlbmRsOwp9Cg==