#include <iostream>
using namespace std;
class A;
class B;
class A
{
public:
A(B& b, int v);
B& m_b;
int m_value;
};
class B
{
public:
B(A& a, int v);
A& m_a;
int m_value;
};
A::A(B& b, int v) : m_b(b), m_value(v) { }
B::B(A& a, int v) : m_a(a) ,m_value(v) { }
class C
{
public:
C() : a(b, 2), b(a, 5) {
cout << a.m_value;
cout << b.m_value;
cout << a.m_b.m_value;
cout << b.m_a.m_value;
}
A a;
B b;
};
int main() {
C c;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKY2xhc3MgQTsKY2xhc3MgQjsKCmNsYXNzIEEgCnsKcHVibGljOgoJQShCJiBiLCBpbnQgdik7CgkKCUImIG1fYjsKCWludCBtX3ZhbHVlOwp9OwoKY2xhc3MgQgp7CnB1YmxpYzoKICAgIEIoQSYgYSwgaW50IHYpOwogICAgCiAgICBBJiBtX2E7CiAgICBpbnQgbV92YWx1ZTsKfTsKCkE6OkEoQiYgYiwgaW50IHYpIDogbV9iKGIpLCBtX3ZhbHVlKHYpIHsgfQpCOjpCKEEmIGEsIGludCB2KSA6IG1fYShhKSAsbV92YWx1ZSh2KSB7IH0KCgpjbGFzcyBDCnsKcHVibGljOgogICAgQygpIDogYShiLCAyKSwgYihhLCA1KSB7CiAgICAJY291dCA8PCBhLm1fdmFsdWU7CiAgICAJY291dCA8PCBiLm1fdmFsdWU7CiAgICAJY291dCA8PCBhLm1fYi5tX3ZhbHVlOwogICAgCWNvdXQgPDwgYi5tX2EubV92YWx1ZTsKICAgIH0KCQoJQSBhOwoJQiBiOwp9OwoJCgppbnQgbWFpbigpIHsKCUMgYzsKCXJldHVybiAwOwp9