import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		Scanner std = new Scanner(System.in);
		while(true){
			int h = Integer.parseInt(std.next());
			int w = Integer.parseInt(std.next());
			if(h!=0 && w!=0){
				String line = "";
				for(int m=1; m<=w; m++){
					line += "#";
				}
				for(int n=1; n<=h; n++){
					System.out.println(line);
				}
				System.out.println();
			}else break;
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args){
		Scanner std = new Scanner(System.in);
		while(true){
			int h = Integer.parseInt(std.next());
			int w = Integer.parseInt(std.next());
			if(h!=0 && w!=0){
				String line = "";
				for(int m=1; m<=w; m++){
					line += "#";
				}
				for(int n=1; n<=h; n++){
					System.out.println(line);
				}
				System.out.println();
			}else break;
		}
	}
} Main public static void main(String[] args){
		Scanner std = new Scanner(System.in);
		while(true){
			int h = Integer.parseInt(std.next());
			int w = Integer.parseInt(std.next());
			if(h!=0 && w!=0){
				String line = "";
				for(int m=1; m<=w; m++){
					line += "#";
				}
				for(int n=1; n<=h; n++){
					System.out.println(line);
				}
				System.out.println();
			}else break;
		}
	} main {
		Scanner std = new Scanner(System.in);
		while(true){
			int h = Integer.parseInt(std.next());
			int w = Integer.parseInt(std.next());
			if(h!=0 && w!=0){
				String line = "";
				for(int m=1; m<=w; m++){
					line += "#";
				}
				for(int n=1; n<=h; n++){
					System.out.println(line);
				}
				System.out.println();
			}else break;
		}
	} Scanner std = new Scanner(System.in); std new Scanner(System.in) while(true){
			int h = Integer.parseInt(std.next());
			int w = Integer.parseInt(std.next());
			if(h!=0 && w!=0){
				String line = "";
				for(int m=1; m<=w; m++){
					line += "#";
				}
				for(int n=1; n<=h; n++){
					System.out.println(line);
				}
				System.out.println();
			}else break;
		} true {
			int h = Integer.parseInt(std.next());
			int w = Integer.parseInt(std.next());
			if(h!=0 && w!=0){
				String line = "";
				for(int m=1; m<=w; m++){
					line += "#";
				}
				for(int n=1; n<=h; n++){
					System.out.println(line);
				}
				System.out.println();
			}else break;
		} int h = Integer.parseInt(std.next()); h Integer.parseInt(std.next()) Integer.parseInt Integer std.next() std.next std int w = Integer.parseInt(std.next()); w Integer.parseInt(std.next()) Integer.parseInt Integer std.next() std.next std if(h!=0 && w!=0){
				String line = "";
				for(int m=1; m<=w; m++){
					line += "#";
				}
				for(int n=1; n<=h; n++){
					System.out.println(line);
				}
				System.out.println();
			}else break; h!=0 && w!=0 h!=0 h 0 w!=0 w 0 {
				String line = "";
				for(int m=1; m<=w; m++){
					line += "#";
				}
				for(int n=1; n<=h; n++){
					System.out.println(line);
				}
				System.out.println();
			} String line = ""; line "" for(int m=1; m<=w; m++){
					line += "#";
				} int m=1; int m=1; m 1 m<=w m w m++ m++ m {
					line += "#";
				} {
					line += "#";
				} line += "#" line "#" for(int n=1; n<=h; n++){
					System.out.println(line);
				} int n=1; int n=1; n 1 n<=h n h n++ n++ n {
					System.out.println(line);
				} {
					System.out.println(line);
				} System.out.println(line) System.out.println System.out System System.out line System.out.println() System.out.println System.out System System.out break; String[] args args public class Main {
	public static void main(String[] args){
		Scanner std = new Scanner(System.in);
		while(true){
			int h = Integer.parseInt(std.next());
			int w = Integer.parseInt(std.next());
			if(h!=0 && w!=0){
				String line = "";
				for(int m=1; m<=w; m++){
					line += "#";
				}
				for(int n=1; n<=h; n++){
					System.out.println(line);
				}
				System.out.println();
			}else break;
		}
	}
} public class Main {
	public static void main(String[] args){
		Scanner std = new Scanner(System.in);
		while(true){
			int h = Integer.parseInt(std.next());
			int w = Integer.parseInt(std.next());
			if(h!=0 && w!=0){
				String line = "";
				for(int m=1; m<=w; m++){
					line += "#";
				}
				for(int n=1; n<=h; n++){
					System.out.println(line);
				}
				System.out.println();
			}else break;
		}
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		Scanner std = new Scanner(System.in);
		while(true){
			int h = Integer.parseInt(std.next());
			int w = Integer.parseInt(std.next());
			if(h!=0 && w!=0){
				String line = "";
				for(int m=1; m<=w; m++){
					line += "#";
				}
				for(int n=1; n<=h; n++){
					System.out.println(line);
				}
				System.out.println();
			}else break;
		}
	}
}