// editor3
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>

// Definition of a node in the doubly linked list
typedef struct Node {
    int data;
    struct Node* next;
    struct Node* prev;
} Node;

// Function to create a new node
Node* createNode(int data) {
    Node* newNode = (Node*)malloc(sizeof(Node));
    newNode->data = data;
    newNode->next = NULL;
    newNode->prev = NULL;
    return newNode;
}

// Function to insert a node at the end of the doubly linked list
void insert(Node** head, int data) {
    Node* newNode = createNode(data);
    if (head == NULL) {
        head = newNode;
        return;
    }
    Node temp = head;
    while (temp->next != NULL) {
        temp = temp->next;
    }
    temp->next = newNode;
    newNode->prev = temp;
}

// Function to sort the doubly linked list
void sortList(Node head) {
    Node temp;
    Node* index;
    int swap;

    for (temp = head; temp != NULL; temp = temp->next) {
        for (index = temp->next; index != NULL; index = index->next) {
            if (temp->data > index->data) {  // Manual sorting logic
                swap = temp->data;
                temp->data = index->data;
                index->data = swap;
            }
        }
    }
}

// Function to print the doubly linked list
void printList(Node* head) {
    Node* temp = head;
    while (temp != NULL) {
        printf("%d ", temp->data);
        temp = temp->next;
    }
    printf("\n");
}

// Function to validate input for non-integer characters
int isValidInput(char* input) {
    for (int i = 0; i < strlen(input); i++) {
        if (!isdigit(input[i]) && input[i] != ' ') {
            return 0;  // Invalid input
        }
    }
    return 1;  // Valid input
}

int main() {
    int n;
    Node* head = NULL;

    // Reading the number of bids
    scanf("%d", &n);

    if (n < 1 || n > 1000) {
        printf("Invalid input\n");
        return 0;
    }

    // Reading the bids
    char buffer[10000];
    getchar();  // To consume the leftover newline character
    fgets(buffer, sizeof(buffer), stdin);

    if (!isValidInput(buffer)) {
        printf("Invalid input\n");
        return 0;
    }

    char* token = strtok(buffer, " ");
    while (token != NULL) {
        int bid = atoi(token);  // Convert the bid string to an integer
        insert(&head, bid);  // Insert the bid into the doubly linked list
        token = strtok(NULL, " ");
    }

    // Sorting the doubly linked list
    sortList(head);

    // Printing the sorted list
    printList(head);

    return 0;
}