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

struct Test{

	shared_ptr< Test > ptr;

	 Test(){ cout<<"Test c-tor"<<endl; }

	~Test(){ cout<<"Test d-tor"<<endl; }

};

int main() {

	cout<<"BOP"<<endl;

	{

		auto  ptr1 = make_shared<Test>();

		ptr1->ptr  = ptr1;

	}

	cout<<"EOP"<<endl;

	return 0;

}