import java.util.Scanner; public class Main { public static void main(String[] args) { Solve.run(); } } class Solve { private static int N; private static int[] vec; static void run() { input(); solve(); } static void input() { Scanner sc = new Scanner(System.in); N = sc.nextInt(); vec = new int[N]; for (int i = 0; i < N; i++) { vec[i] = sc.nextInt(); } } static void solve() { int tmp; for (int i = 0, j; i < N; i++) { tmp = vec[i]; j = i - 1; while (j >= 0 && vec[j] > tmp) { vec[j + 1] = vec[j]; j--; } vec[j + 1] = tmp; for (int i1 = 0; i1 < vec.length; i1++) { System.out.print(vec[i1]); if (i1 != vec.length - 1) { System.out.print(" "); } } System.out.println(); } } }  import java.util.Scanner; Scanner java.util public class Main { public static void main(String[] args) { Solve.run(); } } Main public static void main(String[] args) { Solve.run(); } main { Solve.run(); } Solve.run() Solve.run Solve String[] args args class Solve { private static int N; private static int[] vec; static void run() { input(); solve(); } static void input() { Scanner sc = new Scanner(System.in); N = sc.nextInt(); vec = new int[N]; for (int i = 0; i < N; i++) { vec[i] = sc.nextInt(); } } static void solve() { int tmp; for (int i = 0, j; i < N; i++) { tmp = vec[i]; j = i - 1; while (j >= 0 && vec[j] > tmp) { vec[j + 1] = vec[j]; j--; } vec[j + 1] = tmp; for (int i1 = 0; i1 < vec.length; i1++) { System.out.print(vec[i1]); if (i1 != vec.length - 1) { System.out.print(" "); } } System.out.println(); } } } Solve private static int N; N private static int[] vec; vec static void run() { input(); solve(); } run { input(); solve(); } input() input solve() solve static void input() { Scanner sc = new Scanner(System.in); N = sc.nextInt(); vec = new int[N]; for (int i = 0; i < N; i++) { vec[i] = sc.nextInt(); } } input { Scanner sc = new Scanner(System.in); N = sc.nextInt(); vec = new int[N]; for (int i = 0; i < N; i++) { vec[i] = sc.nextInt(); } } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) N = sc.nextInt() N sc.nextInt() sc.nextInt sc vec = new int[N] vec new int[N] N for (int i = 0; i < N; i++) { vec[i] = sc.nextInt(); } int i = 0; int i = 0; i 0 i < N i N i++ i++ i { vec[i] = sc.nextInt(); } { vec[i] = sc.nextInt(); } vec[i] = sc.nextInt() vec[i] vec i sc.nextInt() sc.nextInt sc static void solve() { int tmp; for (int i = 0, j; i < N; i++) { tmp = vec[i]; j = i - 1; while (j >= 0 && vec[j] > tmp) { vec[j + 1] = vec[j]; j--; } vec[j + 1] = tmp; for (int i1 = 0; i1 < vec.length; i1++) { System.out.print(vec[i1]); if (i1 != vec.length - 1) { System.out.print(" "); } } System.out.println(); } } solve { int tmp; for (int i = 0, j; i < N; i++) { tmp = vec[i]; j = i - 1; while (j >= 0 && vec[j] > tmp) { vec[j + 1] = vec[j]; j--; } vec[j + 1] = tmp; for (int i1 = 0; i1 < vec.length; i1++) { System.out.print(vec[i1]); if (i1 != vec.length - 1) { System.out.print(" "); } } System.out.println(); } } int tmp; tmp for (int i = 0, j; i < N; i++) { tmp = vec[i]; j = i - 1; while (j >= 0 && vec[j] > tmp) { vec[j + 1] = vec[j]; j--; } vec[j + 1] = tmp; for (int i1 = 0; i1 < vec.length; i1++) { System.out.print(vec[i1]); if (i1 != vec.length - 1) { System.out.print(" "); } } System.out.println(); } int i = 0, j; int i = 0 i 0 j; j i < N i N i++ i++ i { tmp = vec[i]; j = i - 1; while (j >= 0 && vec[j] > tmp) { vec[j + 1] = vec[j]; j--; } vec[j + 1] = tmp; for (int i1 = 0; i1 < vec.length; i1++) { System.out.print(vec[i1]); if (i1 != vec.length - 1) { System.out.print(" "); } } System.out.println(); } { tmp = vec[i]; j = i - 1; while (j >= 0 && vec[j] > tmp) { vec[j + 1] = vec[j]; j--; } vec[j + 1] = tmp; for (int i1 = 0; i1 < vec.length; i1++) { System.out.print(vec[i1]); if (i1 != vec.length - 1) { System.out.print(" "); } } System.out.println(); } tmp = vec[i] tmp vec[i] vec i j = i - 1 j i - 1 i 1 while (j >= 0 && vec[j] > tmp) { vec[j + 1] = vec[j]; j--; } j >= 0 && vec[j] > tmp j >= 0 j 0 vec[j] > tmp vec[j] vec j tmp { vec[j + 1] = vec[j]; j--; } vec[j + 1] = vec[j] vec[j + 1] vec j + 1 j 1 vec[j] vec j j-- j vec[j + 1] = tmp vec[j + 1] vec j + 1 j 1 tmp for (int i1 = 0; i1 < vec.length; i1++) { System.out.print(vec[i1]); if (i1 != vec.length - 1) { System.out.print(" "); } } int i1 = 0; int i1 = 0; i1 0 i1 < vec.length i1 vec.length vec vec.length i1++ i1++ i1 { System.out.print(vec[i1]); if (i1 != vec.length - 1) { System.out.print(" "); } } { System.out.print(vec[i1]); if (i1 != vec.length - 1) { System.out.print(" "); } } System.out.print(vec[i1]) System.out.print System.out System System.out vec[i1] vec i1 if (i1 != vec.length - 1) { System.out.print(" "); } i1 != vec.length - 1 i1 vec.length - 1 vec.length vec vec.length 1 { System.out.print(" "); } System.out.print(" ") System.out.print System.out System System.out " " System.out.println() System.out.println System.out System System.out public class Main { public static void main(String[] args) { Solve.run(); } } public class Main { public static void main(String[] args) { Solve.run(); } } Main
import java.util.Scanner; public class Main { public static void main(String[] args) { Solve.run(); } } class Solve { private static int N; private static int[] vec; static void run() { input(); solve(); } static void input() { Scanner sc = new Scanner(System.in); N = sc.nextInt(); vec = new int[N]; for (int i = 0; i < N; i++) { vec[i] = sc.nextInt(); } } static void solve() { int tmp; for (int i = 0, j; i < N; i++) { tmp = vec[i]; j = i - 1; while (j >= 0 && vec[j] > tmp) { vec[j + 1] = vec[j]; j--; } vec[j + 1] = tmp; for (int i1 = 0; i1 < vec.length; i1++) { System.out.print(vec[i1]); if (i1 != vec.length - 1) { System.out.print(" "); } } System.out.println(); } } } 
