#include<iostream>
class a
{
public:
virtual void add()
{ std::cout << "in A"; }
void fn()
{ add(); }
};
class b: public a
{
public:
virtual void add() override
{ std::cout << "in b"; }
};
int main()
{
b d;
d.fn();
}
I2luY2x1ZGU8aW9zdHJlYW0+CgpjbGFzcyBhCnsKcHVibGljOgogICAgdmlydHVhbCB2b2lkIGFkZCgpCiAgICB7IHN0ZDo6Y291dCA8PCAiaW4gQSI7IH0KCiAgICB2b2lkIGZuKCkKICAgIHsgYWRkKCk7IH0KfTsKCmNsYXNzIGI6IHB1YmxpYyBhCnsKcHVibGljOgogICAgdmlydHVhbCB2b2lkIGFkZCgpIG92ZXJyaWRlCiAgICB7IHN0ZDo6Y291dCA8PCAiaW4gYiI7IH0KfTsKCmludCBtYWluKCkKewogICAgYiBkOwogICAgZC5mbigpOwp9Cg==