#include <iostream>
#include <string>
#include <stdlib.h>
using namespace std;
 
 
 
void Insert(int *S, int k)
{
        int key = S[k];
        int j = k-1;
        while(j>=0 && S[j] > key)
        {
                S[j+1] = S[j];
                j--;
        }
 
        S[j+1] = key;
}
 
 
void Insertionsort(int S[], int n)
{
        if(n>1)
                Insertionsort(S,n-1);
        Insert(S,n-1);
 
}
 
int main()
{
        srand ( time(NULL) );
        int S1_8[8];
        for(int i=0; i<8; i++)
                S1_8[i] = rand()%100;
 
        Insertionsort(S1_8,8);
 
        for(int i=0; i<8; i++)
        {
                cout << S1_8[i] << endl;
        }
 
        return 0;
}