#include <iostream>
using namespace std;
struct A{
void print() const {cout << "A\n";}
};
struct B: public A{
void print() const {cout << "B\n";}
};
struct C: public B{
void print() const {cout << "C\n";}
};
template<class T>
void print(const T &someClass){
someClass.print();
}
int main() {
print(A());
print(B());
print(C());
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKc3RydWN0IEF7Cgl2b2lkIHByaW50KCkgY29uc3Qge2NvdXQgPDwgIkFcbiI7fQp9OwoKc3RydWN0IEI6IHB1YmxpYyBBewoJdm9pZCBwcmludCgpIGNvbnN0IHtjb3V0IDw8ICJCXG4iO30KfTsKCnN0cnVjdCBDOiBwdWJsaWMgQnsKCXZvaWQgcHJpbnQoKSBjb25zdCB7Y291dCA8PCAiQ1xuIjt9Cn07Cgp0ZW1wbGF0ZTxjbGFzcyBUPgp2b2lkIHByaW50KGNvbnN0IFQgJnNvbWVDbGFzcyl7Cglzb21lQ2xhc3MucHJpbnQoKTsKfQoKaW50IG1haW4oKSB7CglwcmludChBKCkpOwoJcHJpbnQoQigpKTsKCXByaW50KEMoKSk7CgkKCXJldHVybiAwOwp9