#include <stdio.h>
#include <string.h>
#include <iostream>
#include <ctime>
#include <algorithm>
#define re register
#pragma GCC optimize(3)
typedef unsigned int u32;
typedef unsigned long long u64;
#define N 256
int cnt[N], cnt1[N], cnt2[N], cnt3[N];
u32 a[200000000], b[200000000];
void sort(unsigned *a, int n) {
for (re int i = 0;i < n; i++) {
++cnt[a[i] & 255];
++cnt1[a[i] >> 8 & 255];
++cnt2[a[i] >> 16 & 255];
++cnt3[a[i] >> 24];
}
for (re int i = 1;i <= 255; ++i)
cnt[i] += cnt[i-1],
cnt1[i] += cnt1[i-1],
cnt2[i] += cnt2[i-1],
cnt3[i] += cnt3[i-1];
for (re int i = n - 1; ~i; --i) b[--cnt[a[i]&255]] = a[i];
for (re int i = n - 1; ~i; --i) a[--cnt1[(b[i]>>8)&255]] = b[i];
for (re int i = n - 1; ~i; --i) b[--cnt2[(a[i]>>16)&255]] = a[i];
for (re int i = n - 1; ~i; --i) a[--cnt3[b[i]>>24]] = b[i];
}