import java.util.*;

public class Main {
   public static void main(String[] args) {
      Scanner sc = new Scanner(System.in);
      
      int size = Integer.parseInt(sc.nextLine());
      int[] arr = new int[size];
      
      String[] input = sc.nextLine().split(" ");
      
      for(int i = 0; i < size; i ++) {
         arr[i] = Integer.parseInt(input[i]);
      }
      printArray(arr);
      
      for(int i = 1; i < size; i ++) {
         int key = arr[i];
         int index = i - 1;
         
         while (index >= 0 && arr[index] > key) {
            arr[index + 1] = arr[index];
            index --;
         }
         
         arr[index + 1] = key;
         printArray(arr);
      }
   }//main
   public static void printArray(int[] arr) {
      for(int i = 0; i < arr.length; i ++) {
         System.out.print(arr[i]);
         if(i != arr.length - 1) {
            System.out.print(" ");
         } else {
            System.out.println();
         }
      }
         
   }
      
      
} import java.util.*; util.* java public class Main {
   public static void main(String[] args) {
      Scanner sc = new Scanner(System.in);
      
      int size = Integer.parseInt(sc.nextLine());
      int[] arr = new int[size];
      
      String[] input = sc.nextLine().split(" ");
      
      for(int i = 0; i < size; i ++) {
         arr[i] = Integer.parseInt(input[i]);
      }
      printArray(arr);
      
      for(int i = 1; i < size; i ++) {
         int key = arr[i];
         int index = i - 1;
         
         while (index >= 0 && arr[index] > key) {
            arr[index + 1] = arr[index];
            index --;
         }
         
         arr[index + 1] = key;
         printArray(arr);
      }
   }//main
   public static void printArray(int[] arr) {
      for(int i = 0; i < arr.length; i ++) {
         System.out.print(arr[i]);
         if(i != arr.length - 1) {
            System.out.print(" ");
         } else {
            System.out.println();
         }
      }
         
   }
      
      
} Main public static void main(String[] args) {
      Scanner sc = new Scanner(System.in);
      
      int size = Integer.parseInt(sc.nextLine());
      int[] arr = new int[size];
      
      String[] input = sc.nextLine().split(" ");
      
      for(int i = 0; i < size; i ++) {
         arr[i] = Integer.parseInt(input[i]);
      }
      printArray(arr);
      
      for(int i = 1; i < size; i ++) {
         int key = arr[i];
         int index = i - 1;
         
         while (index >= 0 && arr[index] > key) {
            arr[index + 1] = arr[index];
            index --;
         }
         
         arr[index + 1] = key;
         printArray(arr);
      }
   }//main main {
      Scanner sc = new Scanner(System.in);
      
      int size = Integer.parseInt(sc.nextLine());
      int[] arr = new int[size];
      
      String[] input = sc.nextLine().split(" ");
      
      for(int i = 0; i < size; i ++) {
         arr[i] = Integer.parseInt(input[i]);
      }
      printArray(arr);
      
      for(int i = 1; i < size; i ++) {
         int key = arr[i];
         int index = i - 1;
         
         while (index >= 0 && arr[index] > key) {
            arr[index + 1] = arr[index];
            index --;
         }
         
         arr[index + 1] = key;
         printArray(arr);
      }
   } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int size = Integer.parseInt(sc.nextLine()); size Integer.parseInt(sc.nextLine()) Integer.parseInt Integer sc.nextLine() sc.nextLine sc int[] arr = new int[size]; arr new int[size] size String[] input = sc.nextLine().split(" "); input sc.nextLine().split(" ") sc.nextLine().split sc.nextLine() sc.nextLine sc " " for(int i = 0; i < size; i ++) {
         arr[i] = Integer.parseInt(input[i]);
      } int i = 0; int i = 0; i 0 i < size i size i ++ i ++ i {
         arr[i] = Integer.parseInt(input[i]);
      } {
         arr[i] = Integer.parseInt(input[i]);
      } arr[i] = Integer.parseInt(input[i]) arr[i] arr i Integer.parseInt(input[i]) Integer.parseInt Integer input[i] input i printArray(arr) printArray arr for(int i = 1; i < size; i ++) {
         int key = arr[i];
         int index = i - 1;
         
         while (index >= 0 && arr[index] > key) {
            arr[index + 1] = arr[index];
            index --;
         }
         
         arr[index + 1] = key;
         printArray(arr);
      } int i = 1; int i = 1; i 1 i < size i size i ++ i ++ i {
         int key = arr[i];
         int index = i - 1;
         
         while (index >= 0 && arr[index] > key) {
            arr[index + 1] = arr[index];
            index --;
         }
         
         arr[index + 1] = key;
         printArray(arr);
      } {
         int key = arr[i];
         int index = i - 1;
         
         while (index >= 0 && arr[index] > key) {
            arr[index + 1] = arr[index];
            index --;
         }
         
         arr[index + 1] = key;
         printArray(arr);
      } int key = arr[i]; key arr[i] arr i int index = i - 1; index i - 1 i 1 while (index >= 0 && arr[index] > key) {
            arr[index + 1] = arr[index];
            index --;
         } index >= 0 && arr[index] > key index >= 0 index 0 arr[index] > key arr[index] arr index key {
            arr[index + 1] = arr[index];
            index --;
         } arr[index + 1] = arr[index] arr[index + 1] arr index + 1 index 1 arr[index] arr index index -- index arr[index + 1] = key arr[index + 1] arr index + 1 index 1 key printArray(arr) printArray arr String[] args args public static void printArray(int[] arr) {
      for(int i = 0; i < arr.length; i ++) {
         System.out.print(arr[i]);
         if(i != arr.length - 1) {
            System.out.print(" ");
         } else {
            System.out.println();
         }
      }
         
   } printArray {
      for(int i = 0; i < arr.length; i ++) {
         System.out.print(arr[i]);
         if(i != arr.length - 1) {
            System.out.print(" ");
         } else {
            System.out.println();
         }
      }
         
   } for(int i = 0; i < arr.length; i ++) {
         System.out.print(arr[i]);
         if(i != arr.length - 1) {
            System.out.print(" ");
         } else {
            System.out.println();
         }
      } int i = 0; int i = 0; i 0 i < arr.length i arr.length arr arr.length i ++ i ++ i {
         System.out.print(arr[i]);
         if(i != arr.length - 1) {
            System.out.print(" ");
         } else {
            System.out.println();
         }
      } {
         System.out.print(arr[i]);
         if(i != arr.length - 1) {
            System.out.print(" ");
         } else {
            System.out.println();
         }
      } 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.println();
         } 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.println();
         } System.out.println() System.out.println System.out System System.out int[] arr arr public class Main {
   public static void main(String[] args) {
      Scanner sc = new Scanner(System.in);
      
      int size = Integer.parseInt(sc.nextLine());
      int[] arr = new int[size];
      
      String[] input = sc.nextLine().split(" ");
      
      for(int i = 0; i < size; i ++) {
         arr[i] = Integer.parseInt(input[i]);
      }
      printArray(arr);
      
      for(int i = 1; i < size; i ++) {
         int key = arr[i];
         int index = i - 1;
         
         while (index >= 0 && arr[index] > key) {
            arr[index + 1] = arr[index];
            index --;
         }
         
         arr[index + 1] = key;
         printArray(arr);
      }
   }//main
   public static void printArray(int[] arr) {
      for(int i = 0; i < arr.length; i ++) {
         System.out.print(arr[i]);
         if(i != arr.length - 1) {
            System.out.print(" ");
         } else {
            System.out.println();
         }
      }
         
   }
      
      
} public class Main {
   public static void main(String[] args) {
      Scanner sc = new Scanner(System.in);
      
      int size = Integer.parseInt(sc.nextLine());
      int[] arr = new int[size];
      
      String[] input = sc.nextLine().split(" ");
      
      for(int i = 0; i < size; i ++) {
         arr[i] = Integer.parseInt(input[i]);
      }
      printArray(arr);
      
      for(int i = 1; i < size; i ++) {
         int key = arr[i];
         int index = i - 1;
         
         while (index >= 0 && arr[index] > key) {
            arr[index + 1] = arr[index];
            index --;
         }
         
         arr[index + 1] = key;
         printArray(arr);
      }
   }//main
   public static void printArray(int[] arr) {
      for(int i = 0; i < arr.length; i ++) {
         System.out.print(arr[i]);
         if(i != arr.length - 1) {
            System.out.print(" ");
         } else {
            System.out.println();
         }
      }
         
   }
      
      
} Main
import java.util.*;

public class Main {
   public static void main(String[] args) {
      Scanner sc = new Scanner(System.in);
      
      int size = Integer.parseInt(sc.nextLine());
      int[] arr = new int[size];
      
      String[] input = sc.nextLine().split(" ");
      
      for(int i = 0; i < size; i ++) {
         arr[i] = Integer.parseInt(input[i]);
      }
      printArray(arr);
      
      for(int i = 1; i < size; i ++) {
         int key = arr[i];
         int index = i - 1;
         
         while (index >= 0 && arr[index] > key) {
            arr[index + 1] = arr[index];
            index --;
         }
         
         arr[index + 1] = key;
         printArray(arr);
      }
   }//main
   public static void printArray(int[] arr) {
      for(int i = 0; i < arr.length; i ++) {
         System.out.print(arr[i]);
         if(i != arr.length - 1) {
            System.out.print(" ");
         } else {
            System.out.println();
         }
      }
         
   }
      
      
}
