#include<bits/stdc++.h> #define STC static #define geted(x, d) (((x) >> ((d) * Bit)) & (R - 1)) usingnamespace std; constint N = 1e5 + 5; constint Bit = 8, R = 256; int n, a[N]; voidradix_sort() { STC int cnt[R], t[N]; int *x = a, *y = t; for (int d = 0; d < 4; ++d) { for (int i = 0; i < R; ++i) cnt[i] = 0; for (int i = 0; i < n; ++i) ++cnt[geted(x[i], d)]; for (int i = 1; i < R; ++i) cnt[i] += cnt[i - 1]; for (int i = n - 1; i >= 0; --i) y[--cnt[geted(x[i], d)]] = x[i]; swap(x, y); } for (int i = 0; i < n; ++i) a[i] = x[i]; } intmain() { scanf("%d", &n); for (int i = 0; i < n; ++i) scanf("%d", &a[i]); radix_sort(); for (int i = 0; i < n; ++i) printf("%d ", a[i]); return0; }