import java.io.*;
import java.util.StringTokenizer;
 
class Main{
 
static final PrintWriter out=new PrintWriter(System.out);
 
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
while((line=br.readLine())!=null&&!line.isEmpty()){
int n=Integer.parseInt(line);
int[] a=new int[n];
StringTokenizer st=new StringTokenizer(br.readLine());
for(int i=0;i<n;i++) a[i]=Integer.parseInt(st.nextToken());
InsertionSort(a);
out.flush();
}
}
 
static void InsertionSort(int[] a){
getValue(a);
for(int i=1;i<a.length;i++){
int j=i-1;
int tmp=a[i];
while(j>=0&&a[j]>tmp){
a[j+1]=a[j];
a[j]=tmp;
j--;
}
getValue(a);
}
}
 
private static void getValue(int[] a){
for(int i=0;i<a.length-1;i++) out.print(a[i]+" ");
out.println(a[a.length-1]);
}
} import java.io.*; io.* java import java.util.StringTokenizer; StringTokenizer java.util class Main{
 
static final PrintWriter out=new PrintWriter(System.out);
 
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
while((line=br.readLine())!=null&&!line.isEmpty()){
int n=Integer.parseInt(line);
int[] a=new int[n];
StringTokenizer st=new StringTokenizer(br.readLine());
for(int i=0;i<n;i++) a[i]=Integer.parseInt(st.nextToken());
InsertionSort(a);
out.flush();
}
}
 
static void InsertionSort(int[] a){
getValue(a);
for(int i=1;i<a.length;i++){
int j=i-1;
int tmp=a[i];
while(j>=0&&a[j]>tmp){
a[j+1]=a[j];
a[j]=tmp;
j--;
}
getValue(a);
}
}
 
private static void getValue(int[] a){
for(int i=0;i<a.length-1;i++) out.print(a[i]+" ");
out.println(a[a.length-1]);
}
} Main static final PrintWriter out=new PrintWriter(System.out); out new PrintWriter(System.out) public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
while((line=br.readLine())!=null&&!line.isEmpty()){
int n=Integer.parseInt(line);
int[] a=new int[n];
StringTokenizer st=new StringTokenizer(br.readLine());
for(int i=0;i<n;i++) a[i]=Integer.parseInt(st.nextToken());
InsertionSort(a);
out.flush();
}
} main {
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
while((line=br.readLine())!=null&&!line.isEmpty()){
int n=Integer.parseInt(line);
int[] a=new int[n];
StringTokenizer st=new StringTokenizer(br.readLine());
for(int i=0;i<n;i++) a[i]=Integer.parseInt(st.nextToken());
InsertionSort(a);
out.flush();
}
} BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String line=""; line "" while((line=br.readLine())!=null&&!line.isEmpty()){
int n=Integer.parseInt(line);
int[] a=new int[n];
StringTokenizer st=new StringTokenizer(br.readLine());
for(int i=0;i<n;i++) a[i]=Integer.parseInt(st.nextToken());
InsertionSort(a);
out.flush();
} (line=br.readLine())!=null&&!line.isEmpty() (line=br.readLine())!=null (line=br.readLine()) line br.readLine() br.readLine br null !line.isEmpty() line.isEmpty() line.isEmpty line {
int n=Integer.parseInt(line);
int[] a=new int[n];
StringTokenizer st=new StringTokenizer(br.readLine());
for(int i=0;i<n;i++) a[i]=Integer.parseInt(st.nextToken());
InsertionSort(a);
out.flush();
} int n=Integer.parseInt(line); n Integer.parseInt(line) Integer.parseInt Integer line int[] a=new int[n]; a new int[n] n StringTokenizer st=new StringTokenizer(br.readLine()); st new StringTokenizer(br.readLine()) for(int i=0;i<n;i++) a[i]=Integer.parseInt(st.nextToken()); int i=0; int i=0; i 0 i<n i n i++ i++ i a[i]=Integer.parseInt(st.nextToken()); a[i]=Integer.parseInt(st.nextToken()) a[i] a i Integer.parseInt(st.nextToken()) Integer.parseInt Integer st.nextToken() st.nextToken st InsertionSort(a) InsertionSort a out.flush() out.flush out String[] args args static void InsertionSort(int[] a){
getValue(a);
for(int i=1;i<a.length;i++){
int j=i-1;
int tmp=a[i];
while(j>=0&&a[j]>tmp){
a[j+1]=a[j];
a[j]=tmp;
j--;
}
getValue(a);
}
} InsertionSort {
getValue(a);
for(int i=1;i<a.length;i++){
int j=i-1;
int tmp=a[i];
while(j>=0&&a[j]>tmp){
a[j+1]=a[j];
a[j]=tmp;
j--;
}
getValue(a);
}
} getValue(a) getValue a for(int i=1;i<a.length;i++){
int j=i-1;
int tmp=a[i];
while(j>=0&&a[j]>tmp){
a[j+1]=a[j];
a[j]=tmp;
j--;
}
getValue(a);
} int i=1; int i=1; i 1 i<a.length i a.length a a.length i++ i++ i {
int j=i-1;
int tmp=a[i];
while(j>=0&&a[j]>tmp){
a[j+1]=a[j];
a[j]=tmp;
j--;
}
getValue(a);
} {
int j=i-1;
int tmp=a[i];
while(j>=0&&a[j]>tmp){
a[j+1]=a[j];
a[j]=tmp;
j--;
}
getValue(a);
} int j=i-1; j i-1 i 1 int tmp=a[i]; tmp a[i] a i while(j>=0&&a[j]>tmp){
a[j+1]=a[j];
a[j]=tmp;
j--;
} j>=0&&a[j]>tmp j>=0 j 0 a[j]>tmp a[j] a j tmp {
a[j+1]=a[j];
a[j]=tmp;
j--;
} a[j+1]=a[j] a[j+1] a j+1 j 1 a[j] a j a[j]=tmp a[j] a j tmp j-- j getValue(a) getValue a int[] a a private static void getValue(int[] a){
for(int i=0;i<a.length-1;i++) out.print(a[i]+" ");
out.println(a[a.length-1]);
} getValue {
for(int i=0;i<a.length-1;i++) out.print(a[i]+" ");
out.println(a[a.length-1]);
} for(int i=0;i<a.length-1;i++) out.print(a[i]+" "); int i=0; int i=0; i 0 i<a.length-1 i a.length-1 a.length a a.length 1 i++ i++ i out.print(a[i]+" "); out.print(a[i]+" ") out.print out a[i]+" " a[i] a i " " out.println(a[a.length-1]) out.println out a[a.length-1] a a.length-1 a.length a a.length 1 int[] a a
import java.io.*;
import java.util.StringTokenizer;
 
class Main{
 
static final PrintWriter out=new PrintWriter(System.out);
 
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
while((line=br.readLine())!=null&&!line.isEmpty()){
int n=Integer.parseInt(line);
int[] a=new int[n];
StringTokenizer st=new StringTokenizer(br.readLine());
for(int i=0;i<n;i++) a[i]=Integer.parseInt(st.nextToken());
InsertionSort(a);
out.flush();
}
}
 
static void InsertionSort(int[] a){
getValue(a);
for(int i=1;i<a.length;i++){
int j=i-1;
int tmp=a[i];
while(j>=0&&a[j]>tmp){
a[j+1]=a[j];
a[j]=tmp;
j--;
}
getValue(a);
}
}
 
private static void getValue(int[] a){
for(int i=0;i<a.length-1;i++) out.print(a[i]+" ");
out.println(a[a.length-1]);
}
}
