import java.lang.*;
import java.util.*;

class b {
	public static void main( String[] args ) {
		int [][] a = new int[2][];

		a[0] = new int[2];
		a[0][0] = 2;
		a[0][1] = 2;

		a[1] = new int[] {1, 2, 3};

		for (int i = 0; i < a.length; i++) {
			for (int j = 0; j < a[i].length; j++) {
				System.out.print(a[i][j] + " ");
			}
			System.out.println();
		}
			
		Arrays.sort(a, new Comparator<int[]>() {
			 public int compare(int[] a, int[] b) {
			 	for (int i = 0; i < Math.min(a.length, b.length); i++)
			 		if (a[i] != b[i])
			 			return a[i] - b[i];
			 	return a.length - b.length;
			 }
		});

		for (int i = 0; i < a.length; i++) {
			for (int j = 0; j < a[i].length; j++) {
				System.out.print(a[i][j] + " ");
			}
			System.out.println();
		}
	}
}