class Base {
Base* bp;
public:
Base() : bp(new Base) {
bp->bp = 0;
}
Base* pointer() { return bp->bp; }
~Base() { delete bp; }
};
int main()
{
Base b;
Base* bp = b.pointer();
bp = new Base;
bp = bp->pointer();
bp = new Base;
bp = bp->pointer();
bp = new Base;
}
Y2xhc3MgQmFzZSB7IApCYXNlKiBicDsgCnB1YmxpYzogCkJhc2UoKSA6IGJwKG5ldyBCYXNlKSB7IApicC0+YnAgPSAwOyAKfSAKQmFzZSogcG9pbnRlcigpIHsgcmV0dXJuIGJwLT5icDsgfSAKfkJhc2UoKSB7IGRlbGV0ZSBicDsgfSAKfTsgCgppbnQgbWFpbigpIAp7IApCYXNlIGI7IAoKQmFzZSogYnAgPSBiLnBvaW50ZXIoKTsgCmJwID0gbmV3IEJhc2U7IApicCA9IGJwLT5wb2ludGVyKCk7IApicCA9IG5ldyBCYXNlOyAKYnAgPSBicC0+cG9pbnRlcigpOyAKYnAgPSBuZXcgQmFzZTsgCn0g