#include <iostream>
using namespace std;
struct A
{
virtual void method1()
{
cout << "Am1" << endl;
A::method2();
}
virtual void method2()
{
cout << "Am2" << endl;
}
};
struct B : public A
{
void method1()
{
A::method1();
cout << "Bm1" << endl;
}
void method2()
{
cout << "Bm2" << endl;
}
};
int main() {
B b;
b.method1();
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKc3RydWN0IEEKewoJdmlydHVhbCB2b2lkIG1ldGhvZDEoKQoJewoJCWNvdXQgPDwgIkFtMSIgPDwgZW5kbDsKCQlBOjptZXRob2QyKCk7Cgl9Cgl2aXJ0dWFsIHZvaWQgbWV0aG9kMigpCgl7CgkJY291dCA8PCAiQW0yIiA8PCBlbmRsOwoJfQp9OwpzdHJ1Y3QgQiA6IHB1YmxpYyBBCnsKCXZvaWQgbWV0aG9kMSgpCgl7CgkJQTo6bWV0aG9kMSgpOwoJCWNvdXQgPDwgIkJtMSIgPDwgZW5kbDsKCX0KCXZvaWQgbWV0aG9kMigpCgl7CgkJY291dCA8PCAiQm0yIiA8PCBlbmRsOwoJfQp9OwoKCmludCBtYWluKCkgewoJQiBiOwoJYi5tZXRob2QxKCk7Cn0=