import java.util.*;

class hello
{
	public static void main(String[] args)
	{
		// Defines x as a reference/pointer to a Vector object
		// The definition also specifies that each element
		// of the Vector is itself a Vector of Integer objects
		// So you should think of x as a 2-dimensional object
		Vector<Vector<Integer>> x;
	
		// Allocates space for x by calling a constructor in
		// the Vector class that takes a single argument that
		// specifies the initial capacity of the Vector.
		// Now x contains 3 items, each item currently points
		// to nothing 
		x = new Vector<Vector<Integer>>(3);

		
		// Now each item in x is a reference/pointer to a Vector
		// of size 4. So now x can be thought of as a matrix
		// with 3 rows and 4 columns
		for(int i = 0; i < 3; i++)
			x.add(new Vector<Integer>(4));	


		// Add code here that reads 12 integers input by a user.
		// Assume that the user inputs the 4 numbers in row 1
		// followed by the 4 numbers in row 2, followed by the 
		// 4 numbers in row 3
 		Scanner input = new Scanner(System.in);
	     	System.out.println("Enter 12 integers");

     		for(int i = 0; i < 3; i++)
			for(int j = 0; j < 4; j++)
     				(x.get(i)).add(input.nextInt());

		// Add code here to output the 12 numbers in the matrix.
		// The output is required to contain the 3 numbers in column
		// 1, followed by the 3 numbers in column 2, etc.

     		for(int j = 0; j < 4; j++)
		{
			for(int i = 0; i < 3; i++)
			{
     				System.out.print(x.get(i).get(j));
     				System.out.print(" ");
			}
			System.out.println();
		}
	}
}
