#include<stdio.h>
#include<iostream>
using namespace std;
struct node {
int data;
node* link;
};
node* a;
void insert(int x) {
node* temp = new node();
temp->data = x;
temp->link = a;
a = temp;
}
void print() {
node* temp = new node();
temp = a;
while (temp != NULL) {
cout << temp->data;
temp = temp->link;
}
cout << endl;
}
int main() {
int n,x;
cout << "How many numbers?";
cin >> n;
for (int i = 0; i < n; i++) {
cout << "input";
cin >> x;
insert(x);
print();
}
}