import java.util.Scanner;

class Main {
	static void drawBox(int w, int h){
		for(int i = 0; i < h; i ++){
			for(int j = 0; j < w; j ++){
				System.out.print("#");
			}
			System.out.print("\n");
		}
		System.out.print("\n");
	}
	
    public static void main(String[] args){
    	Scanner in = new Scanner(System.in);
    	
    	while(in.hasNextLine()){
    		int h = in.nextInt(), w = in.nextInt();
    		int i = 0;
    		
    		if(w == 0 && h == 0){
    			break;
    		}else{
    			if(i != 0){
    				System.out.print("\n");
    			}
    			drawBox(w, h);
    			i ++;
    		}
       	}
    	
    	in.close();
	}
} import java.util.Scanner; Scanner java.util class Main {
	static void drawBox(int w, int h){
		for(int i = 0; i < h; i ++){
			for(int j = 0; j < w; j ++){
				System.out.print("#");
			}
			System.out.print("\n");
		}
		System.out.print("\n");
	}
	
    public static void main(String[] args){
    	Scanner in = new Scanner(System.in);
    	
    	while(in.hasNextLine()){
    		int h = in.nextInt(), w = in.nextInt();
    		int i = 0;
    		
    		if(w == 0 && h == 0){
    			break;
    		}else{
    			if(i != 0){
    				System.out.print("\n");
    			}
    			drawBox(w, h);
    			i ++;
    		}
       	}
    	
    	in.close();
	}
} Main static void drawBox(int w, int h){
		for(int i = 0; i < h; i ++){
			for(int j = 0; j < w; j ++){
				System.out.print("#");
			}
			System.out.print("\n");
		}
		System.out.print("\n");
	} drawBox {
		for(int i = 0; i < h; i ++){
			for(int j = 0; j < w; j ++){
				System.out.print("#");
			}
			System.out.print("\n");
		}
		System.out.print("\n");
	} for(int i = 0; i < h; i ++){
			for(int j = 0; j < w; j ++){
				System.out.print("#");
			}
			System.out.print("\n");
		} int i = 0; int i = 0; i 0 i < h i h i ++ i ++ i {
			for(int j = 0; j < w; j ++){
				System.out.print("#");
			}
			System.out.print("\n");
		} {
			for(int j = 0; j < w; j ++){
				System.out.print("#");
			}
			System.out.print("\n");
		} for(int j = 0; j < w; j ++){
				System.out.print("#");
			} int j = 0; int j = 0; j 0 j < w j w j ++ j ++ j {
				System.out.print("#");
			} {
				System.out.print("#");
			} System.out.print("#") System.out.print System.out System System.out "#" System.out.print("\n") System.out.print System.out System System.out "\n" System.out.print("\n") System.out.print System.out System System.out "\n" int w w int h h public static void main(String[] args){
    	Scanner in = new Scanner(System.in);
    	
    	while(in.hasNextLine()){
    		int h = in.nextInt(), w = in.nextInt();
    		int i = 0;
    		
    		if(w == 0 && h == 0){
    			break;
    		}else{
    			if(i != 0){
    				System.out.print("\n");
    			}
    			drawBox(w, h);
    			i ++;
    		}
       	}
    	
    	in.close();
	} main {
    	Scanner in = new Scanner(System.in);
    	
    	while(in.hasNextLine()){
    		int h = in.nextInt(), w = in.nextInt();
    		int i = 0;
    		
    		if(w == 0 && h == 0){
    			break;
    		}else{
    			if(i != 0){
    				System.out.print("\n");
    			}
    			drawBox(w, h);
    			i ++;
    		}
       	}
    	
    	in.close();
	} Scanner in = new Scanner(System.in); in new Scanner(System.in) while(in.hasNextLine()){
    		int h = in.nextInt(), w = in.nextInt();
    		int i = 0;
    		
    		if(w == 0 && h == 0){
    			break;
    		}else{
    			if(i != 0){
    				System.out.print("\n");
    			}
    			drawBox(w, h);
    			i ++;
    		}
       	} in.hasNextLine() in.hasNextLine in {
    		int h = in.nextInt(), w = in.nextInt();
    		int i = 0;
    		
    		if(w == 0 && h == 0){
    			break;
    		}else{
    			if(i != 0){
    				System.out.print("\n");
    			}
    			drawBox(w, h);
    			i ++;
    		}
       	} int h = in.nextInt() h in.nextInt() in.nextInt in w = in.nextInt(); w in.nextInt() in.nextInt in int i = 0; i 0 if(w == 0 && h == 0){
    			break;
    		}else{
    			if(i != 0){
    				System.out.print("\n");
    			}
    			drawBox(w, h);
    			i ++;
    		} w == 0 && h == 0 w == 0 w 0 h == 0 h 0 {
    			break;
    		} break; {
    			if(i != 0){
    				System.out.print("\n");
    			}
    			drawBox(w, h);
    			i ++;
    		} if(i != 0){
    				System.out.print("\n");
    			} i != 0 i 0 {
    				System.out.print("\n");
    			} System.out.print("\n") System.out.print System.out System System.out "\n" drawBox(w, h) drawBox w h i ++ i in.close() in.close in String[] args args
import java.util.Scanner;

class Main {
	static void drawBox(int w, int h){
		for(int i = 0; i < h; i ++){
			for(int j = 0; j < w; j ++){
				System.out.print("#");
			}
			System.out.print("\n");
		}
		System.out.print("\n");
	}
	
    public static void main(String[] args){
    	Scanner in = new Scanner(System.in);
    	
    	while(in.hasNextLine()){
    		int h = in.nextInt(), w = in.nextInt();
    		int i = 0;
    		
    		if(w == 0 && h == 0){
    			break;
    		}else{
    			if(i != 0){
    				System.out.print("\n");
    			}
    			drawBox(w, h);
    			i ++;
    		}
       	}
    	
    	in.close();
	}
}