#include <memory>
template < typename T>
class m_Mono_directional_node
{
public :
m_Mono_directional_node( const T & _data,
std:: shared_ptr < m_Mono_directional_node< T>> _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( std:: shared_ptr < m_Mono_directional_node< T>> _newnext) { next = _newnext; }
std:: shared_ptr < m_Mono_directional_node< T>> get_next( ) { return next; }
protected :
private :
std:: shared_ptr < m_Mono_directional_node< T>> next;
T data;
} ;
I2luY2x1ZGUgPG1lbW9yeT4KCnRlbXBsYXRlIDx0eXBlbmFtZSBUPgpjbGFzcyBtX01vbm9fZGlyZWN0aW9uYWxfbm9kZQp7CnB1YmxpYzoKICAgIG1fTW9ub19kaXJlY3Rpb25hbF9ub2RlKGNvbnN0IFQgJl9kYXRhLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RkOjpzaGFyZWRfcHRyPG1fTW9ub19kaXJlY3Rpb25hbF9ub2RlPFQ+PiBfbmV4dCA9IG51bGxwdHIpOgogICAgICAgIGRhdGEoX2RhdGEpLAogICAgICAgIG5leHQoX25leHQpCiAgICB7fQoKICAgIH5tX01vbm9fZGlyZWN0aW9uYWxfbm9kZSgpe30KCiAgICB2b2lkIHNldF9kYXRhKGNvbnN0IFQgJl9uZXdkYXRhKSB7IGRhdGEgPSBfbmV3ZGF0YTt9CiAgICBUIGdldF9kYXRhKCkge3JldHVybiBkYXRhO30KCiAgICB2b2lkIHNldF9uZXh0KHN0ZDo6c2hhcmVkX3B0cjxtX01vbm9fZGlyZWN0aW9uYWxfbm9kZTxUPj4gX25ld25leHQpIHtuZXh0ID0gX25ld25leHQ7fQogICAgc3RkOjpzaGFyZWRfcHRyPG1fTW9ub19kaXJlY3Rpb25hbF9ub2RlPFQ+PiBnZXRfbmV4dCgpIHtyZXR1cm4gbmV4dDt9CgoKcHJvdGVjdGVkOgpwcml2YXRlOgogICAgc3RkOjpzaGFyZWRfcHRyPG1fTW9ub19kaXJlY3Rpb25hbF9ub2RlPFQ+PiBuZXh0OwogICAgVCBkYXRhOwoKfTsK