#include <iostream>
using namespace std;
class A{
public:
int a;
A (int a_ = 0) : a(a_) {}
};
int * c;
A& generator(int b = 5) {
A& a = *new A(b);
c = &(a.a);
return a;
}
int main() {
// your code goes here
A& a = generator();
std::cout << a.a << std::endl;
*c = 6;
std::cout << a.a << std::endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKY2xhc3MgQXsKcHVibGljOgogICAgaW50IGE7CiAgICBBIChpbnQgYV8gPSAwKSA6IGEoYV8pIHt9Cn07CgppbnQgKiBjOwoKQSYgZ2VuZXJhdG9yKGludCBiID0gNSkgewogICAgQSYgYSA9ICpuZXcgQShiKTsKICAgIGMgPSAmKGEuYSk7CiAgICByZXR1cm4gYTsKfQoKaW50IG1haW4oKSB7CgkvLyB5b3VyIGNvZGUgZ29lcyBoZXJlCiAgICBBJiBhID0gZ2VuZXJhdG9yKCk7CiAgICBzdGQ6OmNvdXQgPDwgYS5hIDw8IHN0ZDo6ZW5kbDsKICAgICpjID0gNjsKICAgIHN0ZDo6Y291dCA8PCBhLmEgPDwgc3RkOjplbmRsOwoJcmV0dXJuIDA7Cn0=