import java.util.Scanner;
public class ARRAY_DEMO {
public static void main(String[] args) {
int[][] arr=takeinput();
display(arr);
}
private static int[][] takeinput(){
Scanner s=new Scanner(System.in);
System.out.println("ENTER NO OF ROWS");
int row=s.nextInt();
int[][] arr=new int[row][];
for(int rows=0;rows<row;rows++) {
System.out.println("ENTER NUMBER OF COLUMN");
int col=s.nextInt();
arr[row]=new int[col];
for(int cols=0;cols<col;col++) {
System.out.println("ENTER THE VALUE OF "+row+" "+col);
arr[row][col]=s.nextInt();
}
}
return arr;
}
private static void display(int[][]arr){
for(int row=0;row<arr.length;row++) {
for(int cols=0;cols<arr[row].length;cols++) {
System.out.println(arr[row][cols]);
}
}
}