import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuilder text = new StringBuilder();

		while (true) {
			int H = sc.nextInt();
			int W = sc.nextInt();

			if (H == 0 && W == 0) {
				sc.close();
				text.deleteCharAt(text.lastIndexOf("\n"));
				System.out.println(text.toString());
				break;
			} else {
				for (int i = 0; i < H; i++) {
					for (int t = 0; t < W; t++) {
						text.append("#");
					}
					text.append("\n");
				}
				text.append("\n");
			}

		}
	}

}
 import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuilder text = new StringBuilder();

		while (true) {
			int H = sc.nextInt();
			int W = sc.nextInt();

			if (H == 0 && W == 0) {
				sc.close();
				text.deleteCharAt(text.lastIndexOf("\n"));
				System.out.println(text.toString());
				break;
			} else {
				for (int i = 0; i < H; i++) {
					for (int t = 0; t < W; t++) {
						text.append("#");
					}
					text.append("\n");
				}
				text.append("\n");
			}

		}
	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuilder text = new StringBuilder();

		while (true) {
			int H = sc.nextInt();
			int W = sc.nextInt();

			if (H == 0 && W == 0) {
				sc.close();
				text.deleteCharAt(text.lastIndexOf("\n"));
				System.out.println(text.toString());
				break;
			} else {
				for (int i = 0; i < H; i++) {
					for (int t = 0; t < W; t++) {
						text.append("#");
					}
					text.append("\n");
				}
				text.append("\n");
			}

		}
	} main {
		Scanner sc = new Scanner(System.in);
		StringBuilder text = new StringBuilder();

		while (true) {
			int H = sc.nextInt();
			int W = sc.nextInt();

			if (H == 0 && W == 0) {
				sc.close();
				text.deleteCharAt(text.lastIndexOf("\n"));
				System.out.println(text.toString());
				break;
			} else {
				for (int i = 0; i < H; i++) {
					for (int t = 0; t < W; t++) {
						text.append("#");
					}
					text.append("\n");
				}
				text.append("\n");
			}

		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) StringBuilder text = new StringBuilder(); text new StringBuilder() while (true) {
			int H = sc.nextInt();
			int W = sc.nextInt();

			if (H == 0 && W == 0) {
				sc.close();
				text.deleteCharAt(text.lastIndexOf("\n"));
				System.out.println(text.toString());
				break;
			} else {
				for (int i = 0; i < H; i++) {
					for (int t = 0; t < W; t++) {
						text.append("#");
					}
					text.append("\n");
				}
				text.append("\n");
			}

		} true {
			int H = sc.nextInt();
			int W = sc.nextInt();

			if (H == 0 && W == 0) {
				sc.close();
				text.deleteCharAt(text.lastIndexOf("\n"));
				System.out.println(text.toString());
				break;
			} else {
				for (int i = 0; i < H; i++) {
					for (int t = 0; t < W; t++) {
						text.append("#");
					}
					text.append("\n");
				}
				text.append("\n");
			}

		} int H = sc.nextInt(); H sc.nextInt() sc.nextInt sc int W = sc.nextInt(); W sc.nextInt() sc.nextInt sc if (H == 0 && W == 0) {
				sc.close();
				text.deleteCharAt(text.lastIndexOf("\n"));
				System.out.println(text.toString());
				break;
			} else {
				for (int i = 0; i < H; i++) {
					for (int t = 0; t < W; t++) {
						text.append("#");
					}
					text.append("\n");
				}
				text.append("\n");
			} H == 0 && W == 0 H == 0 H 0 W == 0 W 0 {
				sc.close();
				text.deleteCharAt(text.lastIndexOf("\n"));
				System.out.println(text.toString());
				break;
			} sc.close() sc.close sc text.deleteCharAt(text.lastIndexOf("\n")) text.deleteCharAt text text.lastIndexOf("\n") text.lastIndexOf text "\n" System.out.println(text.toString()) System.out.println System.out System System.out text.toString() text.toString text break; {
				for (int i = 0; i < H; i++) {
					for (int t = 0; t < W; t++) {
						text.append("#");
					}
					text.append("\n");
				}
				text.append("\n");
			} for (int i = 0; i < H; i++) {
					for (int t = 0; t < W; t++) {
						text.append("#");
					}
					text.append("\n");
				} int i = 0; int i = 0; i 0 i < H i H i++ i++ i {
					for (int t = 0; t < W; t++) {
						text.append("#");
					}
					text.append("\n");
				} {
					for (int t = 0; t < W; t++) {
						text.append("#");
					}
					text.append("\n");
				} for (int t = 0; t < W; t++) {
						text.append("#");
					} int t = 0; int t = 0; t 0 t < W t W t++ t++ t {
						text.append("#");
					} {
						text.append("#");
					} text.append("#") text.append text "#" text.append("\n") text.append text "\n" text.append("\n") text.append text "\n" String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuilder text = new StringBuilder();

		while (true) {
			int H = sc.nextInt();
			int W = sc.nextInt();

			if (H == 0 && W == 0) {
				sc.close();
				text.deleteCharAt(text.lastIndexOf("\n"));
				System.out.println(text.toString());
				break;
			} else {
				for (int i = 0; i < H; i++) {
					for (int t = 0; t < W; t++) {
						text.append("#");
					}
					text.append("\n");
				}
				text.append("\n");
			}

		}
	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuilder text = new StringBuilder();

		while (true) {
			int H = sc.nextInt();
			int W = sc.nextInt();

			if (H == 0 && W == 0) {
				sc.close();
				text.deleteCharAt(text.lastIndexOf("\n"));
				System.out.println(text.toString());
				break;
			} else {
				for (int i = 0; i < H; i++) {
					for (int t = 0; t < W; t++) {
						text.append("#");
					}
					text.append("\n");
				}
				text.append("\n");
			}

		}
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		StringBuilder text = new StringBuilder();

		while (true) {
			int H = sc.nextInt();
			int W = sc.nextInt();

			if (H == 0 && W == 0) {
				sc.close();
				text.deleteCharAt(text.lastIndexOf("\n"));
				System.out.println(text.toString());
				break;
			} else {
				for (int i = 0; i < H; i++) {
					for (int t = 0; t < W; t++) {
						text.append("#");
					}
					text.append("\n");
				}
				text.append("\n");
			}

		}
	}

}

