/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
	public static <C extends Comparable<C>> void insertionSort(C[] a) {
		for (int i = 1; i < a.length; i++) {
		    C ithElement = a[i];
    		int j = i;
    		for (j = i; j > 0 && ithElement.compareTo(a[j - 1]) < 0; --j) {
      			a[j] = a[j - 1];
    		}
    		a[j] = ithElement;
		}
	}
	
	public static void main (String[] args) throws java.lang.Exception
	{
		Integer[] a = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
		Collections.shuffle(Arrays.asList(a));
		System.out.println(Arrays.toString(a));
		insertionSort(a);
		System.out.println(Arrays.toString(a));
	}
}