#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<ctype.h>
struct Node {
    int data;
    struct Node *prev;
    struct Node *next;
};
struct Node* createList(int val){
    struct Node* newNode=(struct Node*)malloc(sizeof(struct Node));
    newNode->data=val;
    newNode->prev=NULL;
    newNode->next=NULL;
    return newNode;
}
int isValidNumber(char *s){
    for(int i=0;s[i];i++){
        if(!isdigit(s[i])) return 0;
    }
    return 1;
}
void sortList(struct Node *head){
    struct Node *temp,*index;
    int t;
    for(temp=head;temp!=NULL;temp=temp->next){
        for(index=temp->next;index!=NULL;index=index->next){
            if(temp->data>index->data){
                t=temp->data;
                temp->data=index->data;
                index->data=t;
            }
        }
    }
}
void printList(struct Node *head){
    struct Node *curr=head;
    while(curr!=NULL){
        printf("%d",curr->data);
        if(curr->next!=NULL)printf(" ");
        curr=curr->next;
    }
    printf("\n");
}
int main() {
    int n;
    scanf("%d",&n);
    struct Node *head=NULL,*tail=NULL;
    for(int i=0;i<n;i++){
        char input[100];
        scanf("%s",input);
        if(!isValidNumber(input)){
            printf("Invalid input\n");
            return 0;
        }
        int val=atoi(input);
        struct Node* newNode=createNode(val);
        if(head==NULL){
            head=newNode;
            tail=newNode;
        } else {
            tail->next=newNode;
            newNode->prev=tail;
            tail=newNode;
        }
    }
    sortList(head);
    printList(head);
    return 0;
}