#include <iostream>
using namespace std;
class A;
typedef int (A::*FPTR)();
class A {
private:
int a;
virtual int f() {return a;}
public:
A(int t) {a = t;}
FPTR get_private() { return &A::f; }
};
int main() {
A a(123);
FPTR fp = a.get_private();
int res = (a.*fp)();
cout << res << endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKY2xhc3MgQTsKCnR5cGVkZWYgIGludCAoQTo6KkZQVFIpKCk7CgpjbGFzcyBBIHsKcHJpdmF0ZToKICAgIGludCBhOwogICAgdmlydHVhbCBpbnQgZigpIHtyZXR1cm4gYTt9CnB1YmxpYzoKICAgIEEoaW50IHQpIHthID0gdDt9CiAgICBGUFRSIGdldF9wcml2YXRlKCkgeyByZXR1cm4gJkE6OmY7IH0KfTsKCgoKaW50IG1haW4oKSB7CglBIGEoMTIzKTsKCUZQVFIgZnAgPSBhLmdldF9wcml2YXRlKCk7CglpbnQgcmVzID0gKGEuKmZwKSgpOwoJY291dCA8PCByZXMgPDwgZW5kbDsKCXJldHVybiAwOwp9