#include<iostream>
using namespace std;
struct Node
{
int val;
Node* next;
};
int main()
{
Node* head = new Node(); // 头结点
Node* tail = head;
int num;
// 建立链表
while(cin >> num && num != 0)
{
Node* p = new Node();
p->val = num;
p->next = nullptr;
tail->next = p;
tail = p;
}
// 输出
cout << "The data of link:" << endl;
Node* p = head->next;
while(p)
{
cout << p->val;
if(p->next) cout << " ";
p = p->next;
}
return 0;
}