#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;
}