#include"bits/stdc++.h" using namespace std; int main() { int n, q; cin >> n; vector a(n); for (int i = 0; i < n; i++)cin >> a[i]; for (int i = 1; i < 2 * n - 3; i++) { for (int p = 0; p < i; p++) { q = i - p; if (p a[q])swap(a[p], a[q]); } } for (int i = 0; i < n; i++)cout << a[i] << ' '; cout << endl; }