import java.io.*;

class Main {
	public static void main(String[] args){
		try {
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));


			while(true){
			String[] line = br.readLine().split(" ");
			int H =Integer.parseInt(line[0]);
			int W =Integer.parseInt(line[1]);
				if(H == 0 && W == 0) break;
				for(int a = 1; a <=H; a++){
					for(int i = 1;i <= W;i++){
						System.out.print("#");
					}
					System.out.print("\n");
				}
				System.out.print("\n");
			}	
		} catch(Exception e){
		}
	}
} import java.io.*; io.* java class Main {
	public static void main(String[] args){
		try {
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));


			while(true){
			String[] line = br.readLine().split(" ");
			int H =Integer.parseInt(line[0]);
			int W =Integer.parseInt(line[1]);
				if(H == 0 && W == 0) break;
				for(int a = 1; a <=H; a++){
					for(int i = 1;i <= W;i++){
						System.out.print("#");
					}
					System.out.print("\n");
				}
				System.out.print("\n");
			}	
		} catch(Exception e){
		}
	}
} Main public static void main(String[] args){
		try {
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));


			while(true){
			String[] line = br.readLine().split(" ");
			int H =Integer.parseInt(line[0]);
			int W =Integer.parseInt(line[1]);
				if(H == 0 && W == 0) break;
				for(int a = 1; a <=H; a++){
					for(int i = 1;i <= W;i++){
						System.out.print("#");
					}
					System.out.print("\n");
				}
				System.out.print("\n");
			}	
		} catch(Exception e){
		}
	} main {
		try {
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));


			while(true){
			String[] line = br.readLine().split(" ");
			int H =Integer.parseInt(line[0]);
			int W =Integer.parseInt(line[1]);
				if(H == 0 && W == 0) break;
				for(int a = 1; a <=H; a++){
					for(int i = 1;i <= W;i++){
						System.out.print("#");
					}
					System.out.print("\n");
				}
				System.out.print("\n");
			}	
		} catch(Exception e){
		}
	} try {
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));


			while(true){
			String[] line = br.readLine().split(" ");
			int H =Integer.parseInt(line[0]);
			int W =Integer.parseInt(line[1]);
				if(H == 0 && W == 0) break;
				for(int a = 1; a <=H; a++){
					for(int i = 1;i <= W;i++){
						System.out.print("#");
					}
					System.out.print("\n");
				}
				System.out.print("\n");
			}	
		} catch(Exception e){
		} catch(Exception e){
		} Exception e {
		} {
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));


			while(true){
			String[] line = br.readLine().split(" ");
			int H =Integer.parseInt(line[0]);
			int W =Integer.parseInt(line[1]);
				if(H == 0 && W == 0) break;
				for(int a = 1; a <=H; a++){
					for(int i = 1;i <= W;i++){
						System.out.print("#");
					}
					System.out.print("\n");
				}
				System.out.print("\n");
			}	
		} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) while(true){
			String[] line = br.readLine().split(" ");
			int H =Integer.parseInt(line[0]);
			int W =Integer.parseInt(line[1]);
				if(H == 0 && W == 0) break;
				for(int a = 1; a <=H; a++){
					for(int i = 1;i <= W;i++){
						System.out.print("#");
					}
					System.out.print("\n");
				}
				System.out.print("\n");
			} true {
			String[] line = br.readLine().split(" ");
			int H =Integer.parseInt(line[0]);
			int W =Integer.parseInt(line[1]);
				if(H == 0 && W == 0) break;
				for(int a = 1; a <=H; a++){
					for(int i = 1;i <= W;i++){
						System.out.print("#");
					}
					System.out.print("\n");
				}
				System.out.print("\n");
			} String[] line = br.readLine().split(" "); line br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int H =Integer.parseInt(line[0]); H Integer.parseInt(line[0]) Integer.parseInt Integer line[0] line 0 int W =Integer.parseInt(line[1]); W Integer.parseInt(line[1]) Integer.parseInt Integer line[1] line 1 if(H == 0 && W == 0) break; H == 0 && W == 0 H == 0 H 0 W == 0 W 0 break; for(int a = 1; a <=H; a++){
					for(int i = 1;i <= W;i++){
						System.out.print("#");
					}
					System.out.print("\n");
				} int a = 1; int a = 1; a 1 a <=H a H a++ a++ a {
					for(int i = 1;i <= W;i++){
						System.out.print("#");
					}
					System.out.print("\n");
				} {
					for(int i = 1;i <= W;i++){
						System.out.print("#");
					}
					System.out.print("\n");
				} for(int i = 1;i <= W;i++){
						System.out.print("#");
					} int i = 1; int i = 1; i 1 i <= W i W i++ i++ i {
						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" String[] args args
import java.io.*;

class Main {
	public static void main(String[] args){
		try {
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));


			while(true){
			String[] line = br.readLine().split(" ");
			int H =Integer.parseInt(line[0]);
			int W =Integer.parseInt(line[1]);
				if(H == 0 && W == 0) break;
				for(int a = 1; a <=H; a++){
					for(int i = 1;i <= W;i++){
						System.out.print("#");
					}
					System.out.print("\n");
				}
				System.out.print("\n");
			}	
		} catch(Exception e){
		}
	}
}