\#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>

// Doubly linked list node
typedef struct Node {
    int data;
    struct Node* next;
    struct Node* prev;
} Node;

// Function to create a new node
Node* newNode(int val) {
    Node* temp = (Node*)malloc(sizeof(Node));
    temp->data = val;
    temp->next = temp->prev = NULL;
    return temp;
}

// Insert node at end
void insertEnd(Node** head, int val) {
    Node* node = newNode(val);
    if (*head == NULL) {
        *head = node;
        return;
    }
    Node* temp = *head;
    while (temp->next != NULL) temp = temp->next;
    temp->next = node;
    node->prev = temp;
}

// Sort linked list (bubble sort-like)
void sortList(Node* head) {
    Node* i, *j;
    int temp;
    for (i = head; i != NULL; i = i->next) {
        for (j = i->next; j != NULL; j = j->next) {
            if (i->data > j->data) {
                temp = i->data;
                i->data = j->data;
                j->data = temp;
            }
        }
    }
}

// Print linked list
void printList(Node* head) {
    Node* temp = head;
    while (temp != NULL) {
        printf("%d", temp->data);
        if (temp->next != NULL) printf(" ");
        temp = temp->next;
    }
}

int main() {
    int n;
    if (scanf("%d", &n) != 1 || n < 1 || n > 1000) {
        printf("Invalid input");
        return 0;
    }

    Node* head = NULL;

    for (int i = 0; i < n; i++) {
        char buffer[100];
        if (scanf("%s", buffer) != 1) {
            printf("Invalid input");
            return 0;
        }

        // Check if input is valid integer
        for (int k = 0; buffer[k] != '\0'; k++) {
            if (!isdigit(buffer[k]) && !(k == 0 && buffer[k] == '-')) {
                printf("Invalid input");
                return 0;
            }
        }

        int val = atoi(buffer);
        insertEnd(&head, val);
    }

    sortList(head);
    printList(head);

    return 0;
}