#include <iostream> 
#include <string>      
using namespace std;
//					father
//					  ^^
//					 /  \
//					/    \
//				      boy     girl
class Father
{
public:
	string FName;
	Father(string s)
	{
		FName = s;
	}
	virtual void DisplayName()
	{
		cout << "I'm a father, my name is : " + FName << endl;
	}
};
class Boy : public Father
{
public:
	Boy(string s) : Father(s)
	{
	}
	void DisplayName()
	{
		cout << "I'm a Boy, my name is : " + FName << endl;
	}
};

class Girl : public Father
{
public:
	Girl(string s) : Father(s)
	{
	}
	void DisplayName()
	{	
		cout << "I'm a Girl, my name is : " + FName << endl;
	}
};

void MyFunction(Father *);
int main()
{
	Father F("Ali");
	Boy B("Hasan");
	Girl G("Mitra");

	Father *Fptr[3];
	Fptr[0] = &F;
	Fptr[1] = &B;
	Fptr[2] = &G;

	for(int i=0; i < 3; i++)
		MyFunction(Fptr[i]);
}

void MyFunction(Father *paramPtr)
{
	paramPtr-> DisplayName();
}

