// 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));
    scanf("%f", &newnode->data);
    newnode->next=NULL;
    if(head==NULL){
        head=temp=newnode;
    }
    else{
        temp->next=newnode;
        temp=temp->next;
    }
}

void display(){
    temp=head;
    while(temp!=NULL){
        printf("%f ", temp->data);
        temp=temp->next;
    }
}

void insertAtEnd(float val){
    temp=head;
    struct node *newnode;
    newnode->next=NULL;
    newnode->data= val;
    while(temp->next!=NULL){
        temp=temp->next;
    }
    temp->next=newnode;
    
    display();
}

int main(){
    int n;
    scanf("%d", &n);
    for(int i=0; i<n; i++){
        createList();
    }
    float val;
    scanf("%f", &val);
    insertAtEnd(val);
}