import java.util.ArrayList;
import java.util.Scanner;

public class Main{

	public static void main(String[] args) {
		ArrayList<Integer> rows = new ArrayList<>();
		ArrayList<Integer> columns = new ArrayList<>();
		Scanner sc = new Scanner(System.in);
		boolean flag = true;
		while (true) {
			int H = sc.nextInt();
			int W = sc.nextInt();
			if (H == 0 && W == 0) {
				break;
			}
			if (H >= 1 && H <= 300 && W >= 1 && W <= 300) {
				rows.add(H);
				columns.add(W);
			} else {
				flag = false;
				break;
			}
		}
		if (flag == true) {
			for (int i = 0; i < rows.size(); i++) {
				for (int j = 0; j < rows.get(i); j++) {
					for (int k = 0; k < columns.get(i); k++) {

						System.out.print("#");
					}

					System.out.println();
				}

				System.out.println();
			}
		}

	}

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

	public static void main(String[] args) {
		ArrayList<Integer> rows = new ArrayList<>();
		ArrayList<Integer> columns = new ArrayList<>();
		Scanner sc = new Scanner(System.in);
		boolean flag = true;
		while (true) {
			int H = sc.nextInt();
			int W = sc.nextInt();
			if (H == 0 && W == 0) {
				break;
			}
			if (H >= 1 && H <= 300 && W >= 1 && W <= 300) {
				rows.add(H);
				columns.add(W);
			} else {
				flag = false;
				break;
			}
		}
		if (flag == true) {
			for (int i = 0; i < rows.size(); i++) {
				for (int j = 0; j < rows.get(i); j++) {
					for (int k = 0; k < columns.get(i); k++) {

						System.out.print("#");
					}

					System.out.println();
				}

				System.out.println();
			}
		}

	}

} Main public static void main(String[] args) {
		ArrayList<Integer> rows = new ArrayList<>();
		ArrayList<Integer> columns = new ArrayList<>();
		Scanner sc = new Scanner(System.in);
		boolean flag = true;
		while (true) {
			int H = sc.nextInt();
			int W = sc.nextInt();
			if (H == 0 && W == 0) {
				break;
			}
			if (H >= 1 && H <= 300 && W >= 1 && W <= 300) {
				rows.add(H);
				columns.add(W);
			} else {
				flag = false;
				break;
			}
		}
		if (flag == true) {
			for (int i = 0; i < rows.size(); i++) {
				for (int j = 0; j < rows.get(i); j++) {
					for (int k = 0; k < columns.get(i); k++) {

						System.out.print("#");
					}

					System.out.println();
				}

				System.out.println();
			}
		}

	} main {
		ArrayList<Integer> rows = new ArrayList<>();
		ArrayList<Integer> columns = new ArrayList<>();
		Scanner sc = new Scanner(System.in);
		boolean flag = true;
		while (true) {
			int H = sc.nextInt();
			int W = sc.nextInt();
			if (H == 0 && W == 0) {
				break;
			}
			if (H >= 1 && H <= 300 && W >= 1 && W <= 300) {
				rows.add(H);
				columns.add(W);
			} else {
				flag = false;
				break;
			}
		}
		if (flag == true) {
			for (int i = 0; i < rows.size(); i++) {
				for (int j = 0; j < rows.get(i); j++) {
					for (int k = 0; k < columns.get(i); k++) {

						System.out.print("#");
					}

					System.out.println();
				}

				System.out.println();
			}
		}

	} ArrayList<Integer> rows = new ArrayList<>(); rows new ArrayList<>() ArrayList<Integer> columns = new ArrayList<>(); columns new ArrayList<>() Scanner sc = new Scanner(System.in); sc new Scanner(System.in) boolean flag = true; flag true while (true) {
			int H = sc.nextInt();
			int W = sc.nextInt();
			if (H == 0 && W == 0) {
				break;
			}
			if (H >= 1 && H <= 300 && W >= 1 && W <= 300) {
				rows.add(H);
				columns.add(W);
			} else {
				flag = false;
				break;
			}
		} true {
			int H = sc.nextInt();
			int W = sc.nextInt();
			if (H == 0 && W == 0) {
				break;
			}
			if (H >= 1 && H <= 300 && W >= 1 && W <= 300) {
				rows.add(H);
				columns.add(W);
			} else {
				flag = false;
				break;
			}
		} 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) {
				break;
			} H == 0 && W == 0 H == 0 H 0 W == 0 W 0 {
				break;
			} break; if (H >= 1 && H <= 300 && W >= 1 && W <= 300) {
				rows.add(H);
				columns.add(W);
			} else {
				flag = false;
				break;
			} H >= 1 && H <= 300 && W >= 1 && W <= 300 W >= 1 H >= 1 && H <= 300 && W >= 1 && W <= 300 H >= 1 H 1 H <= 300 H 300 W >= 1 W 1 W <= 300 W 300 {
				rows.add(H);
				columns.add(W);
			} rows.add(H) rows.add rows H columns.add(W) columns.add columns W {
				flag = false;
				break;
			} flag = false flag false break; if (flag == true) {
			for (int i = 0; i < rows.size(); i++) {
				for (int j = 0; j < rows.get(i); j++) {
					for (int k = 0; k < columns.get(i); k++) {

						System.out.print("#");
					}

					System.out.println();
				}

				System.out.println();
			}
		} flag == true flag true {
			for (int i = 0; i < rows.size(); i++) {
				for (int j = 0; j < rows.get(i); j++) {
					for (int k = 0; k < columns.get(i); k++) {

						System.out.print("#");
					}

					System.out.println();
				}

				System.out.println();
			}
		} for (int i = 0; i < rows.size(); i++) {
				for (int j = 0; j < rows.get(i); j++) {
					for (int k = 0; k < columns.get(i); k++) {

						System.out.print("#");
					}

					System.out.println();
				}

				System.out.println();
			} int i = 0; int i = 0; i 0 i < rows.size() i rows.size() rows.size rows i++ i++ i {
				for (int j = 0; j < rows.get(i); j++) {
					for (int k = 0; k < columns.get(i); k++) {

						System.out.print("#");
					}

					System.out.println();
				}

				System.out.println();
			} {
				for (int j = 0; j < rows.get(i); j++) {
					for (int k = 0; k < columns.get(i); k++) {

						System.out.print("#");
					}

					System.out.println();
				}

				System.out.println();
			} for (int j = 0; j < rows.get(i); j++) {
					for (int k = 0; k < columns.get(i); k++) {

						System.out.print("#");
					}

					System.out.println();
				} int j = 0; int j = 0; j 0 j < rows.get(i) j rows.get(i) rows.get rows i j++ j++ j {
					for (int k = 0; k < columns.get(i); k++) {

						System.out.print("#");
					}

					System.out.println();
				} {
					for (int k = 0; k < columns.get(i); k++) {

						System.out.print("#");
					}

					System.out.println();
				} for (int k = 0; k < columns.get(i); k++) {

						System.out.print("#");
					} int k = 0; int k = 0; k 0 k < columns.get(i) k columns.get(i) columns.get columns i k++ k++ k {

						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 String[] args args public class Main{

	public static void main(String[] args) {
		ArrayList<Integer> rows = new ArrayList<>();
		ArrayList<Integer> columns = new ArrayList<>();
		Scanner sc = new Scanner(System.in);
		boolean flag = true;
		while (true) {
			int H = sc.nextInt();
			int W = sc.nextInt();
			if (H == 0 && W == 0) {
				break;
			}
			if (H >= 1 && H <= 300 && W >= 1 && W <= 300) {
				rows.add(H);
				columns.add(W);
			} else {
				flag = false;
				break;
			}
		}
		if (flag == true) {
			for (int i = 0; i < rows.size(); i++) {
				for (int j = 0; j < rows.get(i); j++) {
					for (int k = 0; k < columns.get(i); k++) {

						System.out.print("#");
					}

					System.out.println();
				}

				System.out.println();
			}
		}

	}

} public class Main{

	public static void main(String[] args) {
		ArrayList<Integer> rows = new ArrayList<>();
		ArrayList<Integer> columns = new ArrayList<>();
		Scanner sc = new Scanner(System.in);
		boolean flag = true;
		while (true) {
			int H = sc.nextInt();
			int W = sc.nextInt();
			if (H == 0 && W == 0) {
				break;
			}
			if (H >= 1 && H <= 300 && W >= 1 && W <= 300) {
				rows.add(H);
				columns.add(W);
			} else {
				flag = false;
				break;
			}
		}
		if (flag == true) {
			for (int i = 0; i < rows.size(); i++) {
				for (int j = 0; j < rows.get(i); j++) {
					for (int k = 0; k < columns.get(i); k++) {

						System.out.print("#");
					}

					System.out.println();
				}

				System.out.println();
			}
		}

	}

} Main
import java.util.ArrayList;
import java.util.Scanner;

public class Main{

	public static void main(String[] args) {
		ArrayList<Integer> rows = new ArrayList<>();
		ArrayList<Integer> columns = new ArrayList<>();
		Scanner sc = new Scanner(System.in);
		boolean flag = true;
		while (true) {
			int H = sc.nextInt();
			int W = sc.nextInt();
			if (H == 0 && W == 0) {
				break;
			}
			if (H >= 1 && H <= 300 && W >= 1 && W <= 300) {
				rows.add(H);
				columns.add(W);
			} else {
				flag = false;
				break;
			}
		}
		if (flag == true) {
			for (int i = 0; i < rows.size(); i++) {
				for (int j = 0; j < rows.get(i); j++) {
					for (int k = 0; k < columns.get(i); k++) {

						System.out.print("#");
					}

					System.out.println();
				}

				System.out.println();
			}
		}

	}

}