#include <algorithm>
void sort(unsigned *a, int n) {
bool tag = true;
while (tag) {
tag = false;
int i = 0;
for ( ; i < n - 1; ++i)
if (a[i] > a[i + 1]) {
std::swap(a[i], a[i + 1]);
tag = true;
for ( ; i < n - 1; ++i)
if (a[i] > a[i + 1])
std::swap(a[i], a[i + 1]);
}
}
}