#include <iostream>
using namespace std;
struct sum
{
int val;
sum(int a) : val(a) {}
sum operator()(int a) { return val + a; }
operator int() { return val; }
};
sum f(int a)
{
return a;
}
int main() {
std::cout << f(1)(2)(3)(4) << std::endl;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKc3RydWN0IHN1bSAKewoJaW50IHZhbDsKCXN1bShpbnQgYSkgOiB2YWwoYSkge30KCQoJc3VtIG9wZXJhdG9yKCkoaW50IGEpIHsgcmV0dXJuIHZhbCArIGE7IH0KCQoJb3BlcmF0b3IgaW50KCkgeyByZXR1cm4gdmFsOyB9Cn07CgpzdW0gZihpbnQgYSkKewoJcmV0dXJuIGE7Cn0KCmludCBtYWluKCkgewoJc3RkOjpjb3V0IDw8IGYoMSkoMikoMykoNCkgPDwgc3RkOjplbmRsOwp9