#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();
friend C;
};
class C
{
public:
C(B *b) {
cout << b->test;
}
};
B::B() {
c = new C(this);
}
int main()
{
B();
}
I2luY2x1ZGUgPHN0cmluZz4KI2luY2x1ZGUgPGlvc3RyZWFtPgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmNsYXNzIEEKewpwdWJsaWM6IAogICAgQSgpIDogdGVzdHsxMH0ge30KcHJvdGVjdGVkOgogICAgaW50IHRlc3Q7Cn07CgpjbGFzcyBDOwoKY2xhc3MgQiA6IHB1YmxpYyBBCnsKcHJpdmF0ZToKICAgIEMgKmM7CgpwdWJsaWM6CiAgICBCKCk7CmZyaWVuZCBDOyAKfTsKCmNsYXNzIEMKewpwdWJsaWM6CiAgICBDKEIgKmIpIHsKICAgICAgICBjb3V0IDw8IGItPnRlc3Q7CiAgICB9Cn07CgpCOjpCKCkgewogICAgYyA9IG5ldyBDKHRoaXMpOwp9ICAKCmludCBtYWluKCkKewogICAgQigpOwp9Cg==