// editor1
#include<stdio.h>
#include<stdlib.h>

struct node{
    float data;
    struct node *next;
};
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(){
    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){
    temp=head;
    struct node *newnode=(struct node*)malloc(sizeof(struct node));
    newnode->next=NULL;
    newnode->data= val;
    if(head==NULL){
        head=newnode;
        printf("%g ",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);
}