class Baza;
class Stiva;
class Coada;

class ElementLista
{
	int valoare;
	ElementLista* urmatorul;
public:
	ElementLista(int i=0);
	friend class Baza;
	friend class Stiva;
	friend class Coada;
};

class Baza
{
protected:
	ElementLista* CapLista;
public:
//	Baza(): CapLista(NULL){}
	Baza() {CapLista=NULL;}
	~Baza();
	virtual void Afisez();
	virtual void Push(int)=0;
	virtual int Pop() =0;
};

class Stiva: public Baza
{
public:
	virtual void Afisez();
	virtual void Push(int);
	virtual int Pop();
};

class Coada: public Baza
{
public:
	virtual void Afisez();
	virtual void Push(int);
	virtual int Pop();
};