#include <iostream>
#include <memory>

typedef std::shared_ptr<int> ptr;

ptr test()
{
	return ptr(new int[10] {0, 1, 2, 3, 4, 5, 6, 7, 8, 9});
}

int main() {
	ptr a = test();
	for (int i = 0; i < 10; ++i)
		std::cout << a.get()[i];
	return 0;
}