import java.util.Scanner;

public class Main {
	private void rect(){
		Scanner scanner = new Scanner(System.in);
		
		while(scanner.hasNextInt()){
			int h =scanner.nextInt();
			int w =scanner.nextInt();
			if(h==0 && w==0)break;
			
			if(h<=300 && w<=300){
				for(int i=0; i<h; i++){
					for(int j=1; j<w; j++){
						System.out.printf("#");
					}
					System.out.println("#");
				}
				System.out.println("");
				
			}
			
		}
	}
	
	public static void main(String[] args) {
		Main run =new Main();
		run.rect();

	}
} import java.util.Scanner; Scanner java.util public class Main {
	private void rect(){
		Scanner scanner = new Scanner(System.in);
		
		while(scanner.hasNextInt()){
			int h =scanner.nextInt();
			int w =scanner.nextInt();
			if(h==0 && w==0)break;
			
			if(h<=300 && w<=300){
				for(int i=0; i<h; i++){
					for(int j=1; j<w; j++){
						System.out.printf("#");
					}
					System.out.println("#");
				}
				System.out.println("");
				
			}
			
		}
	}
	
	public static void main(String[] args) {
		Main run =new Main();
		run.rect();

	}
} Main private void rect(){
		Scanner scanner = new Scanner(System.in);
		
		while(scanner.hasNextInt()){
			int h =scanner.nextInt();
			int w =scanner.nextInt();
			if(h==0 && w==0)break;
			
			if(h<=300 && w<=300){
				for(int i=0; i<h; i++){
					for(int j=1; j<w; j++){
						System.out.printf("#");
					}
					System.out.println("#");
				}
				System.out.println("");
				
			}
			
		}
	} rect {
		Scanner scanner = new Scanner(System.in);
		
		while(scanner.hasNextInt()){
			int h =scanner.nextInt();
			int w =scanner.nextInt();
			if(h==0 && w==0)break;
			
			if(h<=300 && w<=300){
				for(int i=0; i<h; i++){
					for(int j=1; j<w; j++){
						System.out.printf("#");
					}
					System.out.println("#");
				}
				System.out.println("");
				
			}
			
		}
	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) while(scanner.hasNextInt()){
			int h =scanner.nextInt();
			int w =scanner.nextInt();
			if(h==0 && w==0)break;
			
			if(h<=300 && w<=300){
				for(int i=0; i<h; i++){
					for(int j=1; j<w; j++){
						System.out.printf("#");
					}
					System.out.println("#");
				}
				System.out.println("");
				
			}
			
		} scanner.hasNextInt() scanner.hasNextInt scanner {
			int h =scanner.nextInt();
			int w =scanner.nextInt();
			if(h==0 && w==0)break;
			
			if(h<=300 && w<=300){
				for(int i=0; i<h; i++){
					for(int j=1; j<w; j++){
						System.out.printf("#");
					}
					System.out.println("#");
				}
				System.out.println("");
				
			}
			
		} int h =scanner.nextInt(); h scanner.nextInt() scanner.nextInt scanner int w =scanner.nextInt(); w scanner.nextInt() scanner.nextInt scanner if(h==0 && w==0)break; h==0 && w==0 h==0 h 0 w==0 w 0 break; if(h<=300 && w<=300){
				for(int i=0; i<h; i++){
					for(int j=1; j<w; j++){
						System.out.printf("#");
					}
					System.out.println("#");
				}
				System.out.println("");
				
			} h<=300 && w<=300 h<=300 h 300 w<=300 w 300 {
				for(int i=0; i<h; i++){
					for(int j=1; j<w; j++){
						System.out.printf("#");
					}
					System.out.println("#");
				}
				System.out.println("");
				
			} for(int i=0; i<h; i++){
					for(int j=1; j<w; j++){
						System.out.printf("#");
					}
					System.out.println("#");
				} int i=0; int i=0; i 0 i<h i h i++ i++ i {
					for(int j=1; j<w; j++){
						System.out.printf("#");
					}
					System.out.println("#");
				} {
					for(int j=1; j<w; j++){
						System.out.printf("#");
					}
					System.out.println("#");
				} for(int j=1; j<w; j++){
						System.out.printf("#");
					} int j=1; int j=1; j 1 j<w j w j++ j++ j {
						System.out.printf("#");
					} {
						System.out.printf("#");
					} System.out.printf("#") System.out.printf 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 "" public static void main(String[] args) {
		Main run =new Main();
		run.rect();

	} main {
		Main run =new Main();
		run.rect();

	} Main run =new Main(); run new Main() run.rect() run.rect run String[] args args public class Main {
	private void rect(){
		Scanner scanner = new Scanner(System.in);
		
		while(scanner.hasNextInt()){
			int h =scanner.nextInt();
			int w =scanner.nextInt();
			if(h==0 && w==0)break;
			
			if(h<=300 && w<=300){
				for(int i=0; i<h; i++){
					for(int j=1; j<w; j++){
						System.out.printf("#");
					}
					System.out.println("#");
				}
				System.out.println("");
				
			}
			
		}
	}
	
	public static void main(String[] args) {
		Main run =new Main();
		run.rect();

	}
} public class Main {
	private void rect(){
		Scanner scanner = new Scanner(System.in);
		
		while(scanner.hasNextInt()){
			int h =scanner.nextInt();
			int w =scanner.nextInt();
			if(h==0 && w==0)break;
			
			if(h<=300 && w<=300){
				for(int i=0; i<h; i++){
					for(int j=1; j<w; j++){
						System.out.printf("#");
					}
					System.out.println("#");
				}
				System.out.println("");
				
			}
			
		}
	}
	
	public static void main(String[] args) {
		Main run =new Main();
		run.rect();

	}
} Main
import java.util.Scanner;

public class Main {
	private void rect(){
		Scanner scanner = new Scanner(System.in);
		
		while(scanner.hasNextInt()){
			int h =scanner.nextInt();
			int w =scanner.nextInt();
			if(h==0 && w==0)break;
			
			if(h<=300 && w<=300){
				for(int i=0; i<h; i++){
					for(int j=1; j<w; j++){
						System.out.printf("#");
					}
					System.out.println("#");
				}
				System.out.println("");
				
			}
			
		}
	}
	
	public static void main(String[] args) {
		Main run =new Main();
		run.rect();

	}
}