#include<iostream> #include<algorithm> #include<cstdio> #include<cstring> using namespace std; int main() { int n; cin >> n; int a[n]; memset(a,0,sizeof(a)); for(int i=1;i<=n;i++) cin >> a[i]; for(int i=2;i<=n;i++) { if(a[i]<a[i-1]) { a[0] = a[i]; int j; for(j=i-1;a[j]>a[0];j--) a[j+1] = a[j]; a[j+1] = a[0]; } } for(int i=1;i<=n;i++) cout << a[i] << endl; return 0; }