#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;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKdm9pZCBvZGxpY3phbmllKCBpbnQgdGFiW10sIGludCBpbG9zYyApCnsKICAgIGZvciggaW50IGkgPSAwOyBpIDwgaWxvc2M7IGkrKyApCiAgICB7CiAgICAgICAgZm9yKCBpbnQgaiA9IDA7IGogPCBpbG9zYyAtIDE7IGorKyApCiAgICAgICAgewogICAgICAgICAgICBpZiggdGFiWyBqIF0gPiB0YWJbIGogKyAxIF0gKQogICAgICAgICAgICAgICAgIHN3YXAoIHRhYlsgaiBdLCB0YWJbIGogKyAxIF0gKTsKICAgICAgICAgICAgCiAgICAgICAgfQogICAgICAgIGNvdXQgPDwgdGFiWyBpIF07CiAgICB9CiAgICAKfQoKdm9pZCBwcmludChpbnQgdFtdLCBpbnQgcykKewogICBjb3V0IDw8IGVuZGw7CiAgIGZvcihpbnQgaSA9IDA7IGkgPCBzOyArK2kpCiAgICAgICBjb3V0IDw8IHRbaV0gPDwgJyAnOwp9CgppbnQgbWFpbigpCnsKICAgIGludCB0YWJbIDUgXSA9IHsgNCwgNSwgMSwgMywgNyB9OwogICAgaW50IGlsb3NjOwogICAgY2luID4+IGlsb3NjOwogICAgb2RsaWN6YW5pZSggdGFiLCBpbG9zYyApOwogICAgcHJpbnQodGFiLCA1KTsKICAgIHJldHVybiAwOwp9