import java.util.*; import java.io.*; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int d = sc.nextInt(); if(d == 1){ for(int i = 0; i < n; i++){ for(int j = 0; j < n; j++){ System.out.print(1); } System.out.println(); } }else{ for(int i = 0; i < n; i++){ for(int j = 0; j < n; j++){ if(i == 0 || j == 0){ System.out.print(1); }else{ System.out.print(0); } } System.out.println(); } } } }