int main() {
    int n, temp;
    scanf("%d", &n);
    int m[n];
    for (int i = 0; i < n; i++) {
        scanf("%d ", &m[i]);
    }
    for (int j = 0; j < n; j++) {
        for (int k = 0; k < n; k++) {
            if (m[j] > m[k]) {
                temp = m[j];
                m[j] = m[k];
                m[k] = temp;
            }
        }
    }
    printf("%d %d %d %d %d", m[0], m[1], m[2], m[3], m[4]);
    return 0;
}