#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>

typedef struct Node {
    int data;
    struct Node *prev, *next;
} Node;
Node* createNode(int data) {
    Node* newNode = (Node*)malloc(sizeof(Node));
    newNode->data = data;
    newNode->prev = newNode->next = NULL;
    return newNode;
}
* head, int data) {
    Node* newNode = createNode(data);
    if (*head == NULL) {
        *head = newNode;
        return;
    }
    Node* temp = *head;
    while (temp->next)
        temp = temp->next;
    temp->next = newNode;
    newNode->prev = temp;
}

void sortList(Node* head) {
    Node *i, *j;
    int tempData;
    for (i = head; i != NULL; i = i->next) {
        for (j = i->next; j != NULL; j = j->next) {
            if (i->data > j->data) { 
                tempData = i->data;
                i->data = j->data;
                j->data = tempData;
            }
        }
    }
}
void displayList(Node* head) {
    Node* temp = head;
    while (temp) {
        printf("%d", temp->data);
        if (temp->next) printf(" ");
        temp = temp->next;
    }
    printf("\n");
}
int isValidNumber(char *str) {
    for (int i = 0; str[i] != '\0'; i++) {
        if (!isdigit(str[i])) return 0;
    }
    return 1;
}

int main() {
    int n;
    if (scanf("%d", &n) != 1 || n < 1 || n > 1000) {
        printf("Invalid input\n");
        return 0;
    }
    Node* head = NULL;
    char buffer[100];
    for (int i = 0; i < n; i++) {
        if (scanf("%s", buffer) != 1 || !isValidNumber(buffer)) {
            printf("Invalid input\n");
            return 0;
        }
        insertEnd(&head, atoi(buffer));
    }

    sortList(head);
    displayList(head);
    return 0;
}