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