import java.util.*;
public class PrintMatrix{
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
System.out.println("Enter no of rows and columns");
int n = sc.nextInt();
random_Mat(n);
}
public static void random_Mat(int n){
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
System.out.print((int)(Math.random()*2) + " ");
}
System.out.println();
}
}
}