#include <iostream> 
#include <string>      
using namespace std;

class MyShape
{
public:
	MyShape()
	{
		cout << 1 << endl;
	}
	~MyShape()
	{
		cout << 6 << endl;
	}
};
class MySize
{
public:
	MySize()
	{
		cout << 2 << endl;
	}
	~MySize()
	{
		cout << 5 << endl;
	}
};
class MyRectangle
{
public:
	MyShape p;
	MySize  z;
	MyRectangle()
	{
		cout << 3 << endl;
	}
	~MyRectangle()
	{
		cout << 4 << endl;
	}
};

int main()
{
	MyRectangle R2; //display 123456 in output
}

