import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws IOException {
		// ???????????\???
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String input = br.readLine();
		String str[] = input.split(" ");

		int h = Integer.parseInt(str[0]); // ??????
		int w = Integer.parseInt(str[1]); // ??????

		while (true) {
			if (h == 0 && w == 0) {
				//??¨??????0
				break;
			} else {
				//????????\???
				for (int i = 0; i < h; i++) {
					for (int j = 0; j < w; j++) {
						// ??????(#?????????)
						System.out.print("#");
					}
					// ??????(??????)
					System.out.println();
				}
				System.out.println();
				// ?¬??????\??????????????????
				input = br.readLine();
				str[0] = null;
				str[1] = null;
				str = input.split(" ");
				h = Integer.parseInt(str[0]);
				w = Integer.parseInt(str[1]);
			}
		}

	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
	public static void main(String[] args) throws IOException {
		// ???????????\???
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String input = br.readLine();
		String str[] = input.split(" ");

		int h = Integer.parseInt(str[0]); // ??????
		int w = Integer.parseInt(str[1]); // ??????

		while (true) {
			if (h == 0 && w == 0) {
				//??¨??????0
				break;
			} else {
				//????????\???
				for (int i = 0; i < h; i++) {
					for (int j = 0; j < w; j++) {
						// ??????(#?????????)
						System.out.print("#");
					}
					// ??????(??????)
					System.out.println();
				}
				System.out.println();
				// ?¬??????\??????????????????
				input = br.readLine();
				str[0] = null;
				str[1] = null;
				str = input.split(" ");
				h = Integer.parseInt(str[0]);
				w = Integer.parseInt(str[1]);
			}
		}

	}
} Main public static void main(String[] args) throws IOException {
		// ???????????\???
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String input = br.readLine();
		String str[] = input.split(" ");

		int h = Integer.parseInt(str[0]); // ??????
		int w = Integer.parseInt(str[1]); // ??????

		while (true) {
			if (h == 0 && w == 0) {
				//??¨??????0
				break;
			} else {
				//????????\???
				for (int i = 0; i < h; i++) {
					for (int j = 0; j < w; j++) {
						// ??????(#?????????)
						System.out.print("#");
					}
					// ??????(??????)
					System.out.println();
				}
				System.out.println();
				// ?¬??????\??????????????????
				input = br.readLine();
				str[0] = null;
				str[1] = null;
				str = input.split(" ");
				h = Integer.parseInt(str[0]);
				w = Integer.parseInt(str[1]);
			}
		}

	} main {
		// ???????????\???
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String input = br.readLine();
		String str[] = input.split(" ");

		int h = Integer.parseInt(str[0]); // ??????
		int w = Integer.parseInt(str[1]); // ??????

		while (true) {
			if (h == 0 && w == 0) {
				//??¨??????0
				break;
			} else {
				//????????\???
				for (int i = 0; i < h; i++) {
					for (int j = 0; j < w; j++) {
						// ??????(#?????????)
						System.out.print("#");
					}
					// ??????(??????)
					System.out.println();
				}
				System.out.println();
				// ?¬??????\??????????????????
				input = br.readLine();
				str[0] = null;
				str[1] = null;
				str = input.split(" ");
				h = Integer.parseInt(str[0]);
				w = Integer.parseInt(str[1]);
			}
		}

	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String input = br.readLine(); input br.readLine() br.readLine br String str[] = input.split(" "); str input.split(" ") input.split input " " int h = Integer.parseInt(str[0]); h Integer.parseInt(str[0]) Integer.parseInt Integer str[0] str 0 int w = Integer.parseInt(str[1]); w Integer.parseInt(str[1]) Integer.parseInt Integer str[1] str 1 while (true) {
			if (h == 0 && w == 0) {
				//??¨??????0
				break;
			} else {
				//????????\???
				for (int i = 0; i < h; i++) {
					for (int j = 0; j < w; j++) {
						// ??????(#?????????)
						System.out.print("#");
					}
					// ??????(??????)
					System.out.println();
				}
				System.out.println();
				// ?¬??????\??????????????????
				input = br.readLine();
				str[0] = null;
				str[1] = null;
				str = input.split(" ");
				h = Integer.parseInt(str[0]);
				w = Integer.parseInt(str[1]);
			}
		} true {
			if (h == 0 && w == 0) {
				//??¨??????0
				break;
			} else {
				//????????\???
				for (int i = 0; i < h; i++) {
					for (int j = 0; j < w; j++) {
						// ??????(#?????????)
						System.out.print("#");
					}
					// ??????(??????)
					System.out.println();
				}
				System.out.println();
				// ?¬??????\??????????????????
				input = br.readLine();
				str[0] = null;
				str[1] = null;
				str = input.split(" ");
				h = Integer.parseInt(str[0]);
				w = Integer.parseInt(str[1]);
			}
		} if (h == 0 && w == 0) {
				//??¨??????0
				break;
			} else {
				//????????\???
				for (int i = 0; i < h; i++) {
					for (int j = 0; j < w; j++) {
						// ??????(#?????????)
						System.out.print("#");
					}
					// ??????(??????)
					System.out.println();
				}
				System.out.println();
				// ?¬??????\??????????????????
				input = br.readLine();
				str[0] = null;
				str[1] = null;
				str = input.split(" ");
				h = Integer.parseInt(str[0]);
				w = Integer.parseInt(str[1]);
			} h == 0 && w == 0 h == 0 h 0 w == 0 w 0 {
				//??¨??????0
				break;
			} break; {
				//????????\???
				for (int i = 0; i < h; i++) {
					for (int j = 0; j < w; j++) {
						// ??????(#?????????)
						System.out.print("#");
					}
					// ??????(??????)
					System.out.println();
				}
				System.out.println();
				// ?¬??????\??????????????????
				input = br.readLine();
				str[0] = null;
				str[1] = null;
				str = input.split(" ");
				h = Integer.parseInt(str[0]);
				w = Integer.parseInt(str[1]);
			} for (int i = 0; i < h; i++) {
					for (int j = 0; j < w; j++) {
						// ??????(#?????????)
						System.out.print("#");
					}
					// ??????(??????)
					System.out.println();
				} int i = 0; int i = 0; i 0 i < h i h i++ i++ i {
					for (int j = 0; j < w; j++) {
						// ??????(#?????????)
						System.out.print("#");
					}
					// ??????(??????)
					System.out.println();
				} {
					for (int j = 0; j < w; j++) {
						// ??????(#?????????)
						System.out.print("#");
					}
					// ??????(??????)
					System.out.println();
				} for (int j = 0; j < w; j++) {
						// ??????(#?????????)
						System.out.print("#");
					} int j = 0; int j = 0; j 0 j < w j w j++ j++ j {
						// ??????(#?????????)
						System.out.print("#");
					} {
						// ??????(#?????????)
						System.out.print("#");
					} System.out.print("#") System.out.print 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 input = br.readLine() input br.readLine() br.readLine br str[0] = null str[0] str 0 null str[1] = null str[1] str 1 null str = input.split(" ") str input.split(" ") input.split input " " h = Integer.parseInt(str[0]) h Integer.parseInt(str[0]) Integer.parseInt Integer str[0] str 0 w = Integer.parseInt(str[1]) w Integer.parseInt(str[1]) Integer.parseInt Integer str[1] str 1 String[] args args public class Main {
	public static void main(String[] args) throws IOException {
		// ???????????\???
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String input = br.readLine();
		String str[] = input.split(" ");

		int h = Integer.parseInt(str[0]); // ??????
		int w = Integer.parseInt(str[1]); // ??????

		while (true) {
			if (h == 0 && w == 0) {
				//??¨??????0
				break;
			} else {
				//????????\???
				for (int i = 0; i < h; i++) {
					for (int j = 0; j < w; j++) {
						// ??????(#?????????)
						System.out.print("#");
					}
					// ??????(??????)
					System.out.println();
				}
				System.out.println();
				// ?¬??????\??????????????????
				input = br.readLine();
				str[0] = null;
				str[1] = null;
				str = input.split(" ");
				h = Integer.parseInt(str[0]);
				w = Integer.parseInt(str[1]);
			}
		}

	}
} public class Main {
	public static void main(String[] args) throws IOException {
		// ???????????\???
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String input = br.readLine();
		String str[] = input.split(" ");

		int h = Integer.parseInt(str[0]); // ??????
		int w = Integer.parseInt(str[1]); // ??????

		while (true) {
			if (h == 0 && w == 0) {
				//??¨??????0
				break;
			} else {
				//????????\???
				for (int i = 0; i < h; i++) {
					for (int j = 0; j < w; j++) {
						// ??????(#?????????)
						System.out.print("#");
					}
					// ??????(??????)
					System.out.println();
				}
				System.out.println();
				// ?¬??????\??????????????????
				input = br.readLine();
				str[0] = null;
				str[1] = null;
				str = input.split(" ");
				h = Integer.parseInt(str[0]);
				w = Integer.parseInt(str[1]);
			}
		}

	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws IOException {
		// ???????????\???
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String input = br.readLine();
		String str[] = input.split(" ");

		int h = Integer.parseInt(str[0]); // ??????
		int w = Integer.parseInt(str[1]); // ??????

		while (true) {
			if (h == 0 && w == 0) {
				//??¨??????0
				break;
			} else {
				//????????\???
				for (int i = 0; i < h; i++) {
					for (int j = 0; j < w; j++) {
						// ??????(#?????????)
						System.out.print("#");
					}
					// ??????(??????)
					System.out.println();
				}
				System.out.println();
				// ?¬??????\??????????????????
				input = br.readLine();
				str[0] = null;
				str[1] = null;
				str = input.split(" ");
				h = Integer.parseInt(str[0]);
				w = Integer.parseInt(str[1]);
			}
		}

	}
}