#include <string>
#include <iostream>
using namespace std;
class A
{
public:
A() : test{10} {}
protected:
int test;
};
class C;
class B : public A
{
private:
C *c;
public:
B();
int gettest() { return test;}
};
class C
{
public:
C(B *b) {
cout << b->gettest();
}
};
B::B() {
c = new C(this);
}
int main()
{
B();
}
I2luY2x1ZGUgPHN0cmluZz4KI2luY2x1ZGUgPGlvc3RyZWFtPgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmNsYXNzIEEKewpwdWJsaWM6IAogICAgQSgpIDogdGVzdHsxMH0ge30KcHJvdGVjdGVkOgogICAgaW50IHRlc3Q7Cn07CgpjbGFzcyBDOwoKY2xhc3MgQiA6IHB1YmxpYyBBCnsKcHJpdmF0ZToKICAgIEMgKmM7CgpwdWJsaWM6CiAgICBCKCk7CiAgICBpbnQgZ2V0dGVzdCgpIHsgcmV0dXJuIHRlc3Q7fQp9OwoKY2xhc3MgQwp7CnB1YmxpYzoKICAgIEMoQiAqYikgewogICAgICAgIGNvdXQgPDwgYi0+Z2V0dGVzdCgpOwogICAgfQp9OwoKQjo6QigpIHsKICAgIGMgPSBuZXcgQyh0aGlzKTsKfSAgCgppbnQgbWFpbigpCnsKICAgIEIoKTsKfQo=