import java.util.Scanner;

public class Main {
	public static boolean debug =  true;
	
	public static void print_arr(int [] arr) {
		int i = 0;
		while(i < arr.length) {
			System.out.print(arr[i]);
			if(i < arr.length-1) {
				System.out.print(" ");
			}else {
				System.out.print("\n");
			}
			i++;
		}
	}
	
	public static void insertion_sort(int [] arr) {
		for(int i = 1; i < arr.length;  i++) {
			if(debug) {
				print_arr(arr);
			}
			int j = i - 1;
			int key = arr[i];
			while(j >= 0 && arr[j] > key) {
				arr[j+1] = arr[j];
				j--;
			}
			arr[j+1] = key;

		}
		
		if(debug) {
			print_arr(arr);
			
		}
	
	}
	public static void main(String[] args) {
		Scanner cin = new Scanner(System.in);
		int n = 0;
		
		n = cin.nextInt();
		
		int [] arr = new int[n];
		
		int x_i = 0;
		
		for(int i = 0; i < n; i++) {
			x_i = cin.nextInt();
			arr[i] = x_i;
		}
		
		insertion_sort(arr);
		
	
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static boolean debug =  true;
	
	public static void print_arr(int [] arr) {
		int i = 0;
		while(i < arr.length) {
			System.out.print(arr[i]);
			if(i < arr.length-1) {
				System.out.print(" ");
			}else {
				System.out.print("\n");
			}
			i++;
		}
	}
	
	public static void insertion_sort(int [] arr) {
		for(int i = 1; i < arr.length;  i++) {
			if(debug) {
				print_arr(arr);
			}
			int j = i - 1;
			int key = arr[i];
			while(j >= 0 && arr[j] > key) {
				arr[j+1] = arr[j];
				j--;
			}
			arr[j+1] = key;

		}
		
		if(debug) {
			print_arr(arr);
			
		}
	
	}
	public static void main(String[] args) {
		Scanner cin = new Scanner(System.in);
		int n = 0;
		
		n = cin.nextInt();
		
		int [] arr = new int[n];
		
		int x_i = 0;
		
		for(int i = 0; i < n; i++) {
			x_i = cin.nextInt();
			arr[i] = x_i;
		}
		
		insertion_sort(arr);
		
	
	}
} Main public static boolean debug =  true; debug true public static void print_arr(int [] arr) {
		int i = 0;
		while(i < arr.length) {
			System.out.print(arr[i]);
			if(i < arr.length-1) {
				System.out.print(" ");
			}else {
				System.out.print("\n");
			}
			i++;
		}
	} print_arr {
		int i = 0;
		while(i < arr.length) {
			System.out.print(arr[i]);
			if(i < arr.length-1) {
				System.out.print(" ");
			}else {
				System.out.print("\n");
			}
			i++;
		}
	} int i = 0; i 0 while(i < arr.length) {
			System.out.print(arr[i]);
			if(i < arr.length-1) {
				System.out.print(" ");
			}else {
				System.out.print("\n");
			}
			i++;
		} i < arr.length i arr.length arr arr.length {
			System.out.print(arr[i]);
			if(i < arr.length-1) {
				System.out.print(" ");
			}else {
				System.out.print("\n");
			}
			i++;
		} System.out.print(arr[i]) System.out.print System.out System System.out arr[i] arr i if(i < arr.length-1) {
				System.out.print(" ");
			}else {
				System.out.print("\n");
			} i < arr.length-1 i arr.length-1 arr.length arr arr.length 1 {
				System.out.print(" ");
			} System.out.print(" ") System.out.print System.out System System.out " " {
				System.out.print("\n");
			} System.out.print("\n") System.out.print System.out System System.out "\n" i++ i int [] arr arr public static void insertion_sort(int [] arr) {
		for(int i = 1; i < arr.length;  i++) {
			if(debug) {
				print_arr(arr);
			}
			int j = i - 1;
			int key = arr[i];
			while(j >= 0 && arr[j] > key) {
				arr[j+1] = arr[j];
				j--;
			}
			arr[j+1] = key;

		}
		
		if(debug) {
			print_arr(arr);
			
		}
	
	} insertion_sort {
		for(int i = 1; i < arr.length;  i++) {
			if(debug) {
				print_arr(arr);
			}
			int j = i - 1;
			int key = arr[i];
			while(j >= 0 && arr[j] > key) {
				arr[j+1] = arr[j];
				j--;
			}
			arr[j+1] = key;

		}
		
		if(debug) {
			print_arr(arr);
			
		}
	
	} for(int i = 1; i < arr.length;  i++) {
			if(debug) {
				print_arr(arr);
			}
			int j = i - 1;
			int key = arr[i];
			while(j >= 0 && arr[j] > key) {
				arr[j+1] = arr[j];
				j--;
			}
			arr[j+1] = key;

		} int i = 1; int i = 1; i 1 i < arr.length i arr.length arr arr.length i++ i++ i {
			if(debug) {
				print_arr(arr);
			}
			int j = i - 1;
			int key = arr[i];
			while(j >= 0 && arr[j] > key) {
				arr[j+1] = arr[j];
				j--;
			}
			arr[j+1] = key;

		} {
			if(debug) {
				print_arr(arr);
			}
			int j = i - 1;
			int key = arr[i];
			while(j >= 0 && arr[j] > key) {
				arr[j+1] = arr[j];
				j--;
			}
			arr[j+1] = key;

		} if(debug) {
				print_arr(arr);
			} debug {
				print_arr(arr);
			} print_arr(arr) print_arr arr int j = i - 1; j i - 1 i 1 int key = arr[i]; key arr[i] arr i while(j >= 0 && arr[j] > key) {
				arr[j+1] = arr[j];
				j--;
			} j >= 0 && arr[j] > key j >= 0 j 0 arr[j] > key arr[j] arr j key {
				arr[j+1] = arr[j];
				j--;
			} arr[j+1] = arr[j] arr[j+1] arr j+1 j 1 arr[j] arr j j-- j arr[j+1] = key arr[j+1] arr j+1 j 1 key if(debug) {
			print_arr(arr);
			
		} debug {
			print_arr(arr);
			
		} print_arr(arr) print_arr arr int [] arr arr public static void main(String[] args) {
		Scanner cin = new Scanner(System.in);
		int n = 0;
		
		n = cin.nextInt();
		
		int [] arr = new int[n];
		
		int x_i = 0;
		
		for(int i = 0; i < n; i++) {
			x_i = cin.nextInt();
			arr[i] = x_i;
		}
		
		insertion_sort(arr);
		
	
	} main {
		Scanner cin = new Scanner(System.in);
		int n = 0;
		
		n = cin.nextInt();
		
		int [] arr = new int[n];
		
		int x_i = 0;
		
		for(int i = 0; i < n; i++) {
			x_i = cin.nextInt();
			arr[i] = x_i;
		}
		
		insertion_sort(arr);
		
	
	} Scanner cin = new Scanner(System.in); cin new Scanner(System.in) int n = 0; n 0 n = cin.nextInt() n cin.nextInt() cin.nextInt cin int [] arr = new int[n]; arr new int[n] n int x_i = 0; x_i 0 for(int i = 0; i < n; i++) {
			x_i = cin.nextInt();
			arr[i] = x_i;
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			x_i = cin.nextInt();
			arr[i] = x_i;
		} {
			x_i = cin.nextInt();
			arr[i] = x_i;
		} x_i = cin.nextInt() x_i cin.nextInt() cin.nextInt cin arr[i] = x_i arr[i] arr i x_i insertion_sort(arr) insertion_sort arr String[] args args public class Main {
	public static boolean debug =  true;
	
	public static void print_arr(int [] arr) {
		int i = 0;
		while(i < arr.length) {
			System.out.print(arr[i]);
			if(i < arr.length-1) {
				System.out.print(" ");
			}else {
				System.out.print("\n");
			}
			i++;
		}
	}
	
	public static void insertion_sort(int [] arr) {
		for(int i = 1; i < arr.length;  i++) {
			if(debug) {
				print_arr(arr);
			}
			int j = i - 1;
			int key = arr[i];
			while(j >= 0 && arr[j] > key) {
				arr[j+1] = arr[j];
				j--;
			}
			arr[j+1] = key;

		}
		
		if(debug) {
			print_arr(arr);
			
		}
	
	}
	public static void main(String[] args) {
		Scanner cin = new Scanner(System.in);
		int n = 0;
		
		n = cin.nextInt();
		
		int [] arr = new int[n];
		
		int x_i = 0;
		
		for(int i = 0; i < n; i++) {
			x_i = cin.nextInt();
			arr[i] = x_i;
		}
		
		insertion_sort(arr);
		
	
	}
} public class Main {
	public static boolean debug =  true;
	
	public static void print_arr(int [] arr) {
		int i = 0;
		while(i < arr.length) {
			System.out.print(arr[i]);
			if(i < arr.length-1) {
				System.out.print(" ");
			}else {
				System.out.print("\n");
			}
			i++;
		}
	}
	
	public static void insertion_sort(int [] arr) {
		for(int i = 1; i < arr.length;  i++) {
			if(debug) {
				print_arr(arr);
			}
			int j = i - 1;
			int key = arr[i];
			while(j >= 0 && arr[j] > key) {
				arr[j+1] = arr[j];
				j--;
			}
			arr[j+1] = key;

		}
		
		if(debug) {
			print_arr(arr);
			
		}
	
	}
	public static void main(String[] args) {
		Scanner cin = new Scanner(System.in);
		int n = 0;
		
		n = cin.nextInt();
		
		int [] arr = new int[n];
		
		int x_i = 0;
		
		for(int i = 0; i < n; i++) {
			x_i = cin.nextInt();
			arr[i] = x_i;
		}
		
		insertion_sort(arr);
		
	
	}
} Main
import java.util.Scanner;

public class Main {
	public static boolean debug =  true;
	
	public static void print_arr(int [] arr) {
		int i = 0;
		while(i < arr.length) {
			System.out.print(arr[i]);
			if(i < arr.length-1) {
				System.out.print(" ");
			}else {
				System.out.print("\n");
			}
			i++;
		}
	}
	
	public static void insertion_sort(int [] arr) {
		for(int i = 1; i < arr.length;  i++) {
			if(debug) {
				print_arr(arr);
			}
			int j = i - 1;
			int key = arr[i];
			while(j >= 0 && arr[j] > key) {
				arr[j+1] = arr[j];
				j--;
			}
			arr[j+1] = key;

		}
		
		if(debug) {
			print_arr(arr);
			
		}
	
	}
	public static void main(String[] args) {
		Scanner cin = new Scanner(System.in);
		int n = 0;
		
		n = cin.nextInt();
		
		int [] arr = new int[n];
		
		int x_i = 0;
		
		for(int i = 0; i < n; i++) {
			x_i = cin.nextInt();
			arr[i] = x_i;
		}
		
		insertion_sort(arr);
		
	
	}
}