#include <iostream>
#include <functional>
using namespace std;
int main()
{
auto adder = [](int x){ return [x](int y) { return x+y; }; };
auto add4 = adder(4);
cout << add4(6) << endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8ZnVuY3Rpb25hbD4KCnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgbWFpbigpCnsKCWF1dG8gYWRkZXIgPSBbXShpbnQgeCl7IHJldHVybiBbeF0oaW50IHkpIHsgcmV0dXJuIHgreTsgfTsgfTsKICAgIGF1dG8gYWRkNCA9IGFkZGVyKDQpOwogICAJY291dCA8PCBhZGQ0KDYpIDw8IGVuZGw7IAogICAKICAgCXJldHVybiAwOwp9Cg==