import java.util.Scanner;

class Main{
     public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
    	int H;
    	int W;
    	
    	for(;;){
    		H = scan.nextInt();
        	W = scan.nextInt();
        	if(H == 0 && W == 0){
        		break;
        	}
        	
        	for(int y = 0; y < H; y++){
        		for(int x = 0; x < W; x++){
        			System.out.print("#");
        		}
        		System.out.println("");
        	}
         System.out.println("");
        	
    	}
    	
     }
} import java.util.Scanner; Scanner java.util class Main{
     public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
    	int H;
    	int W;
    	
    	for(;;){
    		H = scan.nextInt();
        	W = scan.nextInt();
        	if(H == 0 && W == 0){
        		break;
        	}
        	
        	for(int y = 0; y < H; y++){
        		for(int x = 0; x < W; x++){
        			System.out.print("#");
        		}
        		System.out.println("");
        	}
         System.out.println("");
        	
    	}
    	
     }
} Main public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
    	int H;
    	int W;
    	
    	for(;;){
    		H = scan.nextInt();
        	W = scan.nextInt();
        	if(H == 0 && W == 0){
        		break;
        	}
        	
        	for(int y = 0; y < H; y++){
        		for(int x = 0; x < W; x++){
        			System.out.print("#");
        		}
        		System.out.println("");
        	}
         System.out.println("");
        	
    	}
    	
     } main {
    	Scanner scan = new Scanner(System.in);
    	int H;
    	int W;
    	
    	for(;;){
    		H = scan.nextInt();
        	W = scan.nextInt();
        	if(H == 0 && W == 0){
        		break;
        	}
        	
        	for(int y = 0; y < H; y++){
        		for(int x = 0; x < W; x++){
        			System.out.print("#");
        		}
        		System.out.println("");
        	}
         System.out.println("");
        	
    	}
    	
     } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int H; H int W; W for(;;){
    		H = scan.nextInt();
        	W = scan.nextInt();
        	if(H == 0 && W == 0){
        		break;
        	}
        	
        	for(int y = 0; y < H; y++){
        		for(int x = 0; x < W; x++){
        			System.out.print("#");
        		}
        		System.out.println("");
        	}
         System.out.println("");
        	
    	} ; {
    		H = scan.nextInt();
        	W = scan.nextInt();
        	if(H == 0 && W == 0){
        		break;
        	}
        	
        	for(int y = 0; y < H; y++){
        		for(int x = 0; x < W; x++){
        			System.out.print("#");
        		}
        		System.out.println("");
        	}
         System.out.println("");
        	
    	} {
    		H = scan.nextInt();
        	W = scan.nextInt();
        	if(H == 0 && W == 0){
        		break;
        	}
        	
        	for(int y = 0; y < H; y++){
        		for(int x = 0; x < W; x++){
        			System.out.print("#");
        		}
        		System.out.println("");
        	}
         System.out.println("");
        	
    	} H = scan.nextInt() H scan.nextInt() scan.nextInt scan W = scan.nextInt() W scan.nextInt() scan.nextInt scan if(H == 0 && W == 0){
        		break;
        	} H == 0 && W == 0 H == 0 H 0 W == 0 W 0 {
        		break;
        	} break; for(int y = 0; y < H; y++){
        		for(int x = 0; x < W; x++){
        			System.out.print("#");
        		}
        		System.out.println("");
        	} int y = 0; int y = 0; y 0 y < H y H y++ y++ y {
        		for(int x = 0; x < W; x++){
        			System.out.print("#");
        		}
        		System.out.println("");
        	} {
        		for(int x = 0; x < W; x++){
        			System.out.print("#");
        		}
        		System.out.println("");
        	} for(int x = 0; x < W; x++){
        			System.out.print("#");
        		} int x = 0; int x = 0; x 0 x < W x W x++ x++ x {
        			System.out.print("#");
        		} {
        			System.out.print("#");
        		} System.out.print("#") System.out.print System.out System System.out "#" System.out.println("") System.out.println System.out System System.out "" System.out.println("") System.out.println System.out System System.out "" String[] args args
import java.util.Scanner;

class Main{
     public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
    	int H;
    	int W;
    	
    	for(;;){
    		H = scan.nextInt();
        	W = scan.nextInt();
        	if(H == 0 && W == 0){
        		break;
        	}
        	
        	for(int y = 0; y < H; y++){
        		for(int x = 0; x < W; x++){
        			System.out.print("#");
        		}
        		System.out.println("");
        	}
         System.out.println("");
        	
    	}
    	
     }
}