#include<iostream>
#include<malloc.h>
using namespace std;
typedef struct Node
{
int data;
struct Node *next;
}Node;
int a[10];
Node *creat(int a[], int n)
{
Node *s = NULL;
Node *first = (Node *)malloc(sizeof(Node));
first -> next = NULL;
for(int i = 0; i < n; i ++)
{
s = (Node *)malloc(sizeof(Node));
s -> data = a[i];
s -> next = first -> next;
first -> next= s;
}
return first;
}
void PrintList(Node *first)
{
Node *p = first -> next;
while(p != NULL)
{
cout << p->data << " ";
p = p -> next;
}
}
int main()
{
for(int i = 0; i < 10; i ++)
{
cin >> a[i];
}
int n = 10;
Node *first = creat(a, n);
PrintList(first);
return 0;
}