1#include <iostream>
2using namespace std;
3#define MAX 100
4void main() {
5 int A[MAX], n, I, J, X;
6 cin >> n;
7 for (I = 0; I < n; I++)
8 cin >> A[I];
9 for (I = 0; I < n; I++) {
10 J = I;
11 X = A[I];
12 while (J > 0 && A[J - 1] > X) {
13 A[J] = A[J - 1];
14 J--;
15 }
16 A[J] = X;
17 }
18 for (I = 0; I < n; I++)
19 cout << A[I] << " ";
20}