// editor1
#include<stdio.h>
#include<stdlib.h>
#include<ctype.h>
struct node{
    float data;
    struct node*next;
}node;
struct node*head=NULL;
struct node*temp;
void createList()
{
    struct node*newnode=(struct node*)malloc(sizeof(struct node));
    if(scanf("%f",&newnode->data)!=1)
    {
        printf("Invalid input");
        exit(1);
    }
    newnode->next=NULL;
    if(head==NULL){
        head=temp=newnode;
    }
    else{
        temp->next=newnode;
        temp=temp->next;
    }
}
void display(){
    if(head->next==NULL){
        printf("%g",head->data);
        exit(1);
    }
    temp=head;
    while(temp!=NULL){
        if(temp->data==(int)temp->data)
        {
            printf("%.1f",temp->data);
        }
        else{
            printf("%g ",temp->data);
        }
    }
    temp=temp->next;
}
void insertAtend(float val){
    struct node*newnode=(struct node*)malloc(sizeof(struct node));
    newnode->data=val;
    newnode->next=NULL;
    if(head==NULL){
        head==newnode;
        display();
    }
    temp=head;
    while(temp->next!=NULL){
        temp=temp->next;
    }
    temp->next=newnode;
    display();}
    int main()
    {
        int n;
        scanf("%d",&n);
        if(n<0)
        {
            printf("Invalid input");
            return 0;
        }
        for(int i=0;i<n;i++){
        createList();
        }
        float val;
        if(scanf("%f",&val)!=1)
        {
            printf("Invalid input");
            exit(1);
        }
        insertAtend(val);
    }