#include <iostream>
using namespace std;

void odliczanie( int tab[], int ilosc )
{
    for( int i = 0; i < ilosc; i++ )
    {
        for( int j = 0; j < ilosc - 1; j++ )
        {
            if( tab[ j ] > tab[ j + 1 ] )
                 swap( tab[ j ], tab[ j + 1 ] );
            
        }
        cout << tab[ i ];
    }
    
}

void print(int t[], int s)
{
   cout << endl;
   for(int i = 0; i < s; ++i)
       cout << t[i] << ' ';
}

int main()
{
    int tab[ 5 ] = { 4, 5, 1, 3, 7 };
    int ilosc;
    cin >> ilosc;
    odliczanie( tab, ilosc );
    print(tab, 5);
    return 0;
}