#include <iostream>
using namespace std;
struct Node
{
int data;
Node *next;
};
Node *Start=NULL;
void traverse()
{
Node *ptr= Start;
while(ptr!=NULL)
{
cout<<ptr->data<<" ";
ptr=ptr->next;
}
cout<<endl;
}
int main()
{
int n;
cin>>n;
Node *save;
while(n--)
{
Node *newnode=new Node;
cin>>newnode->data;
newnode->next=NULL;
if(Start==NULL)
{
Start=newnode;
}
else
{
save->next=newnode;
}
save=newnode;
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwpzdHJ1Y3QgTm9kZSAKewogICAgaW50IGRhdGE7CiAgICBOb2RlICpuZXh0Owp9OwpOb2RlICpTdGFydD1OVUxMOwp2b2lkIHRyYXZlcnNlKCkKewogICAgTm9kZSAqcHRyPSBTdGFydDsKICAgIHdoaWxlKHB0ciE9TlVMTCkKICAgIHsKICAgICAgICBjb3V0PDxwdHItPmRhdGE8PCIgIjsKICAgICAgICBwdHI9cHRyLT5uZXh0OwogICAgfQogICAgY291dDw8ZW5kbDsKfQppbnQgbWFpbigpCnsKICAgIGludCBuOwogICAgY2luPj5uOwogICAgTm9kZSAqc2F2ZTsKICAgIHdoaWxlKG4tLSkKICAgIHsKICAgICAgICBOb2RlICpuZXdub2RlPW5ldyBOb2RlOwogICAgICAgIGNpbj4+bmV3bm9kZS0+ZGF0YTsKICAgICAgICBuZXdub2RlLT5uZXh0PU5VTEw7CiAgICAgICAgaWYoU3RhcnQ9PU5VTEwpCiAgICAgICAgewogICAgICAgICAgICBTdGFydD1uZXdub2RlOwogICAgICAgIH0KICAgICAgICBlbHNlIAogICAgICAgIHsKICAgICAgICAgICAgc2F2ZS0+bmV4dD1uZXdub2RlOwogICAgICAgIH0KICAgICAgICBzYXZlPW5ld25vZGU7CiAgICB9CiAgICByZXR1cm4gMDsKfQ==