public static void print(int[][] m, char GS) {
        // Print the matrix header
        String row= "";
        for (int r= 0; r < m.length; r= r+1) {
            if (r < 10)
                row= row + "    " + GS + r;
            else if (r < 100) row= row + "   " + GS + r;
            else row= row + "  " + GS + r;
        }
        System.out.println(row);

        // Print the matrix
        for (int r= 0; r < m.length; r= r+1) {
            row= "";
            for (int c= 0; c < m[r].length; c= c+1) {
                row= row + String.format("%6d", m[r][c]);
            }
            row= row + "     // " + GS + r;
            System.out.println(row);
        }
    }