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

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

		while (true) {
			String str = br.readLine();

			String[] num = getElement(str);

			int h = Integer.parseInt(num[0]);
			int w = Integer.parseInt(num[1]);

			if (h == 0 && w == 0) {
				break;
			}
			for (int i = 0; i < h; i++) {
				for (int j = 0; j < w; j++) {
					System.out.print("#");
//					if (j == w - 1) {
//						System.out.print(" ");
//					}
				}
				System.out.print("\r\n");
			}
			System.out.print("\r\n");
		}

	}

	//??????????????????????????????????????????
	public static String[] getElement(String element) {
		return (element.split(" "));
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
	public static void main(String[] args) throws Exception {
		InputStreamReader is = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(is);

		while (true) {
			String str = br.readLine();

			String[] num = getElement(str);

			int h = Integer.parseInt(num[0]);
			int w = Integer.parseInt(num[1]);

			if (h == 0 && w == 0) {
				break;
			}
			for (int i = 0; i < h; i++) {
				for (int j = 0; j < w; j++) {
					System.out.print("#");
//					if (j == w - 1) {
//						System.out.print(" ");
//					}
				}
				System.out.print("\r\n");
			}
			System.out.print("\r\n");
		}

	}

	//??????????????????????????????????????????
	public static String[] getElement(String element) {
		return (element.split(" "));
	}
} Main public static void main(String[] args) throws Exception {
		InputStreamReader is = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(is);

		while (true) {
			String str = br.readLine();

			String[] num = getElement(str);

			int h = Integer.parseInt(num[0]);
			int w = Integer.parseInt(num[1]);

			if (h == 0 && w == 0) {
				break;
			}
			for (int i = 0; i < h; i++) {
				for (int j = 0; j < w; j++) {
					System.out.print("#");
//					if (j == w - 1) {
//						System.out.print(" ");
//					}
				}
				System.out.print("\r\n");
			}
			System.out.print("\r\n");
		}

	} main {
		InputStreamReader is = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(is);

		while (true) {
			String str = br.readLine();

			String[] num = getElement(str);

			int h = Integer.parseInt(num[0]);
			int w = Integer.parseInt(num[1]);

			if (h == 0 && w == 0) {
				break;
			}
			for (int i = 0; i < h; i++) {
				for (int j = 0; j < w; j++) {
					System.out.print("#");
//					if (j == w - 1) {
//						System.out.print(" ");
//					}
				}
				System.out.print("\r\n");
			}
			System.out.print("\r\n");
		}

	} InputStreamReader is = new InputStreamReader(System.in); is new InputStreamReader(System.in) BufferedReader br = new BufferedReader(is); br new BufferedReader(is) while (true) {
			String str = br.readLine();

			String[] num = getElement(str);

			int h = Integer.parseInt(num[0]);
			int w = Integer.parseInt(num[1]);

			if (h == 0 && w == 0) {
				break;
			}
			for (int i = 0; i < h; i++) {
				for (int j = 0; j < w; j++) {
					System.out.print("#");
//					if (j == w - 1) {
//						System.out.print(" ");
//					}
				}
				System.out.print("\r\n");
			}
			System.out.print("\r\n");
		} true {
			String str = br.readLine();

			String[] num = getElement(str);

			int h = Integer.parseInt(num[0]);
			int w = Integer.parseInt(num[1]);

			if (h == 0 && w == 0) {
				break;
			}
			for (int i = 0; i < h; i++) {
				for (int j = 0; j < w; j++) {
					System.out.print("#");
//					if (j == w - 1) {
//						System.out.print(" ");
//					}
				}
				System.out.print("\r\n");
			}
			System.out.print("\r\n");
		} String str = br.readLine(); str br.readLine() br.readLine br String[] num = getElement(str); num getElement(str) getElement str int h = Integer.parseInt(num[0]); h Integer.parseInt(num[0]) Integer.parseInt Integer num[0] num 0 int w = Integer.parseInt(num[1]); w Integer.parseInt(num[1]) Integer.parseInt Integer num[1] num 1 if (h == 0 && w == 0) {
				break;
			} h == 0 && w == 0 h == 0 h 0 w == 0 w 0 {
				break;
			} break; for (int i = 0; i < h; i++) {
				for (int j = 0; j < w; j++) {
					System.out.print("#");
//					if (j == w - 1) {
//						System.out.print(" ");
//					}
				}
				System.out.print("\r\n");
			} 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("#");
//					if (j == w - 1) {
//						System.out.print(" ");
//					}
				}
				System.out.print("\r\n");
			} {
				for (int j = 0; j < w; j++) {
					System.out.print("#");
//					if (j == w - 1) {
//						System.out.print(" ");
//					}
				}
				System.out.print("\r\n");
			} for (int j = 0; j < w; j++) {
					System.out.print("#");
//					if (j == w - 1) {
//						System.out.print(" ");
//					}
				} int j = 0; int j = 0; j 0 j < w j w j++ j++ j {
					System.out.print("#");
//					if (j == w - 1) {
//						System.out.print(" ");
//					}
				} {
					System.out.print("#");
//					if (j == w - 1) {
//						System.out.print(" ");
//					}
				} System.out.print("#") System.out.print System.out System System.out "#" System.out.print("\r\n") System.out.print System.out System System.out "\r\n" System.out.print("\r\n") System.out.print System.out System System.out "\r\n" String[] args args //??????????????????????????????????????????
	public static String[] getElement(String element) {
		return (element.split(" "));
	} getElement {
		return (element.split(" "));
	} return (element.split(" ")); (element.split(" ")) element.split element " " String element element public class Main {
	public static void main(String[] args) throws Exception {
		InputStreamReader is = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(is);

		while (true) {
			String str = br.readLine();

			String[] num = getElement(str);

			int h = Integer.parseInt(num[0]);
			int w = Integer.parseInt(num[1]);

			if (h == 0 && w == 0) {
				break;
			}
			for (int i = 0; i < h; i++) {
				for (int j = 0; j < w; j++) {
					System.out.print("#");
//					if (j == w - 1) {
//						System.out.print(" ");
//					}
				}
				System.out.print("\r\n");
			}
			System.out.print("\r\n");
		}

	}

	//??????????????????????????????????????????
	public static String[] getElement(String element) {
		return (element.split(" "));
	}
} public class Main {
	public static void main(String[] args) throws Exception {
		InputStreamReader is = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(is);

		while (true) {
			String str = br.readLine();

			String[] num = getElement(str);

			int h = Integer.parseInt(num[0]);
			int w = Integer.parseInt(num[1]);

			if (h == 0 && w == 0) {
				break;
			}
			for (int i = 0; i < h; i++) {
				for (int j = 0; j < w; j++) {
					System.out.print("#");
//					if (j == w - 1) {
//						System.out.print(" ");
//					}
				}
				System.out.print("\r\n");
			}
			System.out.print("\r\n");
		}

	}

	//??????????????????????????????????????????
	public static String[] getElement(String element) {
		return (element.split(" "));
	}
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;

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

		while (true) {
			String str = br.readLine();

			String[] num = getElement(str);

			int h = Integer.parseInt(num[0]);
			int w = Integer.parseInt(num[1]);

			if (h == 0 && w == 0) {
				break;
			}
			for (int i = 0; i < h; i++) {
				for (int j = 0; j < w; j++) {
					System.out.print("#");
//					if (j == w - 1) {
//						System.out.print(" ");
//					}
				}
				System.out.print("\r\n");
			}
			System.out.print("\r\n");
		}

	}

	//??????????????????????????????????????????
	public static String[] getElement(String element) {
		return (element.split(" "));
	}
}