#include <iostream>
struct A {
void operator()() { std::cout << "foo" << std::endl; }
};
struct B {
A* operator->() { return (A*)0; }
};
struct C {
B& operator->() { return *(B*)0; }
};
struct D {
C& operator->() { return *(C*)0; }
};
int main()
{
D()->operator()();
}
I2luY2x1ZGUgPGlvc3RyZWFtPgogCnN0cnVjdCBBIHsKICAgIHZvaWQgb3BlcmF0b3IoKSgpIHsgc3RkOjpjb3V0IDw8ICJmb28iIDw8IHN0ZDo6ZW5kbDsgfQp9OwogCnN0cnVjdCBCIHsKICAgIEEqIG9wZXJhdG9yLT4oKSB7IHJldHVybiAoQSopMDsgfQp9OwogCnN0cnVjdCBDIHsKICAgIEImIG9wZXJhdG9yLT4oKSB7IHJldHVybiAqKEIqKTA7IH0KfTsKIApzdHJ1Y3QgRCB7CiAgICBDJiBvcGVyYXRvci0+KCkgeyByZXR1cm4gKihDKikwOyB9Cn07CiAKaW50IG1haW4oKQp7CiAgICBEKCktPm9wZXJhdG9yKCkoKTsKfQo=