import java.util.Scanner;
class Main {
	int W = 0,H = 0,I = 0,F = 0;
	public void pr() {
		Scanner sc = new Scanner(System.in);
		H = sc.nextInt();
		W = sc.nextInt();
		while(H != 0 || W != 0) {
			for(I = 0;I < H; I++) {
				for(F = 0;F < W; F++) {
					System.out.print("#");
					if(F == W-1) {
						System.out.println();
					}
				}
			}
				System.out.println();
			H = sc.nextInt();
			W = sc.nextInt();
		}
	}
	public static void main(String[] args) {
		new Main().pr();
	}
} import java.util.Scanner; Scanner java.util class Main {
	int W = 0,H = 0,I = 0,F = 0;
	public void pr() {
		Scanner sc = new Scanner(System.in);
		H = sc.nextInt();
		W = sc.nextInt();
		while(H != 0 || W != 0) {
			for(I = 0;I < H; I++) {
				for(F = 0;F < W; F++) {
					System.out.print("#");
					if(F == W-1) {
						System.out.println();
					}
				}
			}
				System.out.println();
			H = sc.nextInt();
			W = sc.nextInt();
		}
	}
	public static void main(String[] args) {
		new Main().pr();
	}
} Main int W = 0 W 0 H = 0 H 0 I = 0 I 0 F = 0; F 0 public void pr() {
		Scanner sc = new Scanner(System.in);
		H = sc.nextInt();
		W = sc.nextInt();
		while(H != 0 || W != 0) {
			for(I = 0;I < H; I++) {
				for(F = 0;F < W; F++) {
					System.out.print("#");
					if(F == W-1) {
						System.out.println();
					}
				}
			}
				System.out.println();
			H = sc.nextInt();
			W = sc.nextInt();
		}
	} pr {
		Scanner sc = new Scanner(System.in);
		H = sc.nextInt();
		W = sc.nextInt();
		while(H != 0 || W != 0) {
			for(I = 0;I < H; I++) {
				for(F = 0;F < W; F++) {
					System.out.print("#");
					if(F == W-1) {
						System.out.println();
					}
				}
			}
				System.out.println();
			H = sc.nextInt();
			W = sc.nextInt();
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) H = sc.nextInt() H sc.nextInt() sc.nextInt sc W = sc.nextInt() W sc.nextInt() sc.nextInt sc while(H != 0 || W != 0) {
			for(I = 0;I < H; I++) {
				for(F = 0;F < W; F++) {
					System.out.print("#");
					if(F == W-1) {
						System.out.println();
					}
				}
			}
				System.out.println();
			H = sc.nextInt();
			W = sc.nextInt();
		} H != 0 || W != 0 H != 0 H 0 W != 0 W 0 {
			for(I = 0;I < H; I++) {
				for(F = 0;F < W; F++) {
					System.out.print("#");
					if(F == W-1) {
						System.out.println();
					}
				}
			}
				System.out.println();
			H = sc.nextInt();
			W = sc.nextInt();
		} for(I = 0;I < H; I++) {
				for(F = 0;F < W; F++) {
					System.out.print("#");
					if(F == W-1) {
						System.out.println();
					}
				}
			} I = 0; I = 0 I 0 I < H I H I++ I++ I {
				for(F = 0;F < W; F++) {
					System.out.print("#");
					if(F == W-1) {
						System.out.println();
					}
				}
			} {
				for(F = 0;F < W; F++) {
					System.out.print("#");
					if(F == W-1) {
						System.out.println();
					}
				}
			} for(F = 0;F < W; F++) {
					System.out.print("#");
					if(F == W-1) {
						System.out.println();
					}
				} F = 0; F = 0 F 0 F < W F W F++ F++ F {
					System.out.print("#");
					if(F == W-1) {
						System.out.println();
					}
				} {
					System.out.print("#");
					if(F == W-1) {
						System.out.println();
					}
				} System.out.print("#") System.out.print System.out System System.out "#" if(F == W-1) {
						System.out.println();
					} F == W-1 F W-1 W 1 {
						System.out.println();
					} System.out.println() System.out.println System.out System System.out System.out.println() System.out.println System.out System System.out H = sc.nextInt() H sc.nextInt() sc.nextInt sc W = sc.nextInt() W sc.nextInt() sc.nextInt sc public static void main(String[] args) {
		new Main().pr();
	} main {
		new Main().pr();
	} new Main().pr() new Main().pr new Main() String[] args args
import java.util.Scanner;
class Main {
	int W = 0,H = 0,I = 0,F = 0;
	public void pr() {
		Scanner sc = new Scanner(System.in);
		H = sc.nextInt();
		W = sc.nextInt();
		while(H != 0 || W != 0) {
			for(I = 0;I < H; I++) {
				for(F = 0;F < W; F++) {
					System.out.print("#");
					if(F == W-1) {
						System.out.println();
					}
				}
			}
				System.out.println();
			H = sc.nextInt();
			W = sc.nextInt();
		}
	}
	public static void main(String[] args) {
		new Main().pr();
	}
}