#include <memory>
template < typename T>
class m_Mono_directional_node
{
public :
typedef std:: shared_ptr < m_Mono_directional_node< T>> Ptr;
m_Mono_directional_node( const T & _data,
Ptr _next = nullptr) :
data( _data) ,
next( _next)
{ }
~m_Mono_directional_node( ) { }
void set_data( const T & _newdata) { data = _newdata; }
T get_data( ) { return data; }
void set_next( Ptr _newnext) { next = _newnext; }
Ptr get_next( ) { return next; }
protected :
private :
Ptr next;
T data;
} ;
I2luY2x1ZGUgPG1lbW9yeT4KCnRlbXBsYXRlIDx0eXBlbmFtZSBUPgpjbGFzcyBtX01vbm9fZGlyZWN0aW9uYWxfbm9kZQp7CnB1YmxpYzoKCXR5cGVkZWYgc3RkOjpzaGFyZWRfcHRyPG1fTW9ub19kaXJlY3Rpb25hbF9ub2RlPFQ+PiBQdHI7IAogICAgbV9Nb25vX2RpcmVjdGlvbmFsX25vZGUoY29uc3QgVCAmX2RhdGEsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBQdHIgX25leHQgPSBudWxscHRyKToKICAgICAgICBkYXRhKF9kYXRhKSwKICAgICAgICBuZXh0KF9uZXh0KQogICAge30KCiAgICB+bV9Nb25vX2RpcmVjdGlvbmFsX25vZGUoKXt9CgogICAgdm9pZCBzZXRfZGF0YShjb25zdCBUICZfbmV3ZGF0YSkgeyBkYXRhID0gX25ld2RhdGE7fQogICAgVCBnZXRfZGF0YSgpIHtyZXR1cm4gZGF0YTt9CgogICAgdm9pZCBzZXRfbmV4dChQdHIgX25ld25leHQpIHtuZXh0ID0gX25ld25leHQ7fQogICAgUHRyIGdldF9uZXh0KCkge3JldHVybiBuZXh0O30KCgpwcm90ZWN0ZWQ6CnByaXZhdGU6CiAgICBQdHIgbmV4dDsKICAgIFQgZGF0YTsKCn07Cg==