#include using namespace std; #define FOR(i, j, k) for(int i = j; i < k; ++i) #define rep(i, j) FOR(i, 0, j) #define repr(i, j) for(int i = j; i >= 0; --i) #define INF (1 << 30) #define MOD 1e9 + 7 typedef long long ll; typedef unsigned long long ull; typedef pair P; int N; int a[2000]; int main() { scanf("%d", &N); rep(i, N) scanf("%d", &a[i]); rep(i, 2 * N - 3) { rep(p, N) { if(i - p < 0 || a[p] == 0 || a[i - p] == 0) continue; if(a[p] < a[i - p]) swap(a[p], a[i - p]); } } rep(i, N) { if(i != N - 1) printf("%d ", a[i]); else printf("%d\n", a[i]); } return 0; }