import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
 
public class Main {
 
    public static void main(String[] args) throws Exception {
        
    	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    	StringBuffer sb = new StringBuffer();
    	
        int count = Integer.parseInt(br.readLine());
        String[] str = br.readLine().split(" ");
 
        for (int i = 1; i < count; i++) {
            System.out.println(String.join(" ",str));
            for (int j = i - 1; j >= 0; j--) {
                if (Integer.parseInt(str[j]) > Integer.parseInt(str[j + 1])) {
                    String tmpNum = str[j];
                    str[j] = str[j + 1];
                    str[j + 1] = tmpNum;
                }
            }
        }
        System.out.println(String.join(" ",str));
    }
}
/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