#include<stdio.h>
#include<stdlib.h>
#define max 100
int stack[max],tempstack[max];
int top=-1,temptop=-1;
void push(int *stack,int*top,int val)
{
    if(*top<max-1)
    {
        (*top)++;
        stack[*top]=val;
    }
}
int pop(int *stack,int *top)
{
    if(*top>=0)
    {
        int val=stack[*top];
        (*top)--;
        return val;
    }
    return -1;
}
int isempty(int top)
{
    return top==-1;
}
void sortstack()
{
    while(!isempty(top))
    {
        int temp=pop(stack,&top);
        while(!isempty(temptop)&&tempstack[temptop]>temp)
        {
            push(stack,&op,pop(tempstack,&temptop));
        }
        push(tempstack,&temptop,temp);
    }
    while(!isempty(temptop))
    {
        push(stack,&top,pop(tempstack,&temptop));
    }
}
int main()
{
    int n;
    scanf("%d",&n);
    if(n<0)
    {
        printf("Invalid input");
        return 0;
    }
    for(int i=0;i<n;i++)
    {
        int val;
        scanf("%d",&val);
        push(stack,&top,val);
    }
    sortstack();
    while(!isempty(top))
    {
        printf("%d ",pop(stack,&top));
    }
    printf("\n");
}