import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws Exception {
	//??\??????????????????
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        //????????°?????????
        int numberCount = Integer.parseInt(br.readLine());
        //???????????¶????????°??????????????????
        String[] sNumbers = br.readLine().split(" ");
        //????????°?????????????????????
        int[] numbers = new int[numberCount];
        //?????????????????°????????????
        for(int i = 0 ; i < numberCount ; i++){
        	numbers[i] = Integer.parseInt(sNumbers[i]);
        }
        insertionSort(numbers);
	}
	
	private static void insertionSort(int[] numbers){
		displayNumbers(numbers);
		for(int i = 1 ; i < numbers.length ; i++){
			int currentNumber = numbers[i];
			int insertIndex = i;
			for(int y = i - 1 ; y >= 0 ; y--){
				if(currentNumber < numbers[y]){
					numbers[y + 1] = numbers[y];
					insertIndex = y;
				}else{
					break;
				}
			}
			numbers[insertIndex] = currentNumber;
			displayNumbers(numbers);
		}
	}
	
	private static void displayNumbers(int[] numbers){
		StringBuffer sb = new StringBuffer();
		for(int i = 0 ; i < numbers.length ; i++){
			sb.append(numbers[i]);
			sb.append(" ");
		}
		System.out.println(sb.toString().trim());
	}

}
/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz