#include<iostream>
#include<math.h>
#include <string>
using namespace std;
class LIST
{
LIST *next;
string name;
string surname;
string mname;
public:
LIST(string _surname,string _name, string _mname, LIST *oldlist);
~LIST();
virtual void print();
};
LIST::LIST(string _surname,string _name, string _mname, LIST *oldlist)
{ name=_name;
surname=_surname;
mname=_mname;
next=oldlist; }
LIST::~LIST()
{
if (next)
delete next;
}
void LIST::print()
{
cout<<surname<<'\t'<<name<<'\t'<<mname<<endl;
cout<<surname<<" "<<name[0]<<". "<<mname[0]<<"."<<endl;
if (next)
next->print();
}
int main()
{LIST *mylist;
mylist=new LIST("Koval","Nazar","Jaros",mylist);
mylist=new LIST("Mazyr","Dima","Anton",mylist);
mylist->print();
return 0;
}
I2luY2x1ZGU8aW9zdHJlYW0+CiNpbmNsdWRlPG1hdGguaD4KI2luY2x1ZGUgPHN0cmluZz4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKY2xhc3MgTElTVAp7CiAgTElTVCAqbmV4dDsKICBzdHJpbmcgbmFtZTsKICBzdHJpbmcgc3VybmFtZTsKICBzdHJpbmcgbW5hbWU7CnB1YmxpYzoKICBMSVNUKHN0cmluZyBfc3VybmFtZSxzdHJpbmcgX25hbWUsIHN0cmluZyBfbW5hbWUsICBMSVNUICpvbGRsaXN0KTsgCiAgfkxJU1QoKTsKICB2aXJ0dWFsIHZvaWQgcHJpbnQoKTsKfTsKTElTVDo6TElTVChzdHJpbmcgX3N1cm5hbWUsc3RyaW5nIF9uYW1lLCBzdHJpbmcgX21uYW1lLCAgTElTVCAqb2xkbGlzdCkgCnsJbmFtZT1fbmFtZTsgCglzdXJuYW1lPV9zdXJuYW1lOwoJbW5hbWU9X21uYW1lOwoJbmV4dD1vbGRsaXN0Owl9CkxJU1Q6On5MSVNUKCkKewogICBpZiAobmV4dCkKICAgICAgZGVsZXRlIG5leHQ7Cn0Kdm9pZCBMSVNUOjpwcmludCgpCnsKICAgY291dDw8c3VybmFtZTw8J1x0Jzw8bmFtZTw8J1x0Jzw8bW5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