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

public class Main {
	public static void main(String[] arges) {
		Scanner sc = new Scanner(System.in);
		List<String> klist = new ArrayList<String>();
		int i = 0;
		for (int j = 0; i < 1; j++) {
			String line = sc.nextLine();
			klist.add(line);
			if (klist.get(j).equals("0 0")) {
				break;
			}
		}
		for (String string : klist) {
			if (string.equals("0 0")) {
				break;
			}
			String[] k = string.split(" ");
			int v = Integer.parseInt(k[0]);
			int v2 = Integer.parseInt(k[1]);
			i = 0;

			for (int j = 0; j < v; j++) {
				i = 0;
				while (i < v2) {
					System.out.print("#");
					i++;
				}
				System.out.println("");
			}
			System.out.println("");
		}
	}
} import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] arges) {
		Scanner sc = new Scanner(System.in);
		List<String> klist = new ArrayList<String>();
		int i = 0;
		for (int j = 0; i < 1; j++) {
			String line = sc.nextLine();
			klist.add(line);
			if (klist.get(j).equals("0 0")) {
				break;
			}
		}
		for (String string : klist) {
			if (string.equals("0 0")) {
				break;
			}
			String[] k = string.split(" ");
			int v = Integer.parseInt(k[0]);
			int v2 = Integer.parseInt(k[1]);
			i = 0;

			for (int j = 0; j < v; j++) {
				i = 0;
				while (i < v2) {
					System.out.print("#");
					i++;
				}
				System.out.println("");
			}
			System.out.println("");
		}
	}
} Main public static void main(String[] arges) {
		Scanner sc = new Scanner(System.in);
		List<String> klist = new ArrayList<String>();
		int i = 0;
		for (int j = 0; i < 1; j++) {
			String line = sc.nextLine();
			klist.add(line);
			if (klist.get(j).equals("0 0")) {
				break;
			}
		}
		for (String string : klist) {
			if (string.equals("0 0")) {
				break;
			}
			String[] k = string.split(" ");
			int v = Integer.parseInt(k[0]);
			int v2 = Integer.parseInt(k[1]);
			i = 0;

			for (int j = 0; j < v; j++) {
				i = 0;
				while (i < v2) {
					System.out.print("#");
					i++;
				}
				System.out.println("");
			}
			System.out.println("");
		}
	} main {
		Scanner sc = new Scanner(System.in);
		List<String> klist = new ArrayList<String>();
		int i = 0;
		for (int j = 0; i < 1; j++) {
			String line = sc.nextLine();
			klist.add(line);
			if (klist.get(j).equals("0 0")) {
				break;
			}
		}
		for (String string : klist) {
			if (string.equals("0 0")) {
				break;
			}
			String[] k = string.split(" ");
			int v = Integer.parseInt(k[0]);
			int v2 = Integer.parseInt(k[1]);
			i = 0;

			for (int j = 0; j < v; j++) {
				i = 0;
				while (i < v2) {
					System.out.print("#");
					i++;
				}
				System.out.println("");
			}
			System.out.println("");
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) List<String> klist = new ArrayList<String>(); klist new ArrayList<String>() int i = 0; i 0 for (int j = 0; i < 1; j++) {
			String line = sc.nextLine();
			klist.add(line);
			if (klist.get(j).equals("0 0")) {
				break;
			}
		} int j = 0; int j = 0; j 0 i < 1 i 1 j++ j++ j {
			String line = sc.nextLine();
			klist.add(line);
			if (klist.get(j).equals("0 0")) {
				break;
			}
		} {
			String line = sc.nextLine();
			klist.add(line);
			if (klist.get(j).equals("0 0")) {
				break;
			}
		} String line = sc.nextLine(); line sc.nextLine() sc.nextLine sc klist.add(line) klist.add klist line if (klist.get(j).equals("0 0")) {
				break;
			} klist.get(j).equals("0 0") klist.get(j).equals klist.get(j) klist.get klist j "0 0" {
				break;
			} break; for (String string : klist) {
			if (string.equals("0 0")) {
				break;
			}
			String[] k = string.split(" ");
			int v = Integer.parseInt(k[0]);
			int v2 = Integer.parseInt(k[1]);
			i = 0;

			for (int j = 0; j < v; j++) {
				i = 0;
				while (i < v2) {
					System.out.print("#");
					i++;
				}
				System.out.println("");
			}
			System.out.println("");
		} String string klist {
			if (string.equals("0 0")) {
				break;
			}
			String[] k = string.split(" ");
			int v = Integer.parseInt(k[0]);
			int v2 = Integer.parseInt(k[1]);
			i = 0;

			for (int j = 0; j < v; j++) {
				i = 0;
				while (i < v2) {
					System.out.print("#");
					i++;
				}
				System.out.println("");
			}
			System.out.println("");
		} {
			if (string.equals("0 0")) {
				break;
			}
			String[] k = string.split(" ");
			int v = Integer.parseInt(k[0]);
			int v2 = Integer.parseInt(k[1]);
			i = 0;

			for (int j = 0; j < v; j++) {
				i = 0;
				while (i < v2) {
					System.out.print("#");
					i++;
				}
				System.out.println("");
			}
			System.out.println("");
		} if (string.equals("0 0")) {
				break;
			} string.equals("0 0") string.equals string "0 0" {
				break;
			} break; String[] k = string.split(" "); k string.split(" ") string.split string " " int v = Integer.parseInt(k[0]); v Integer.parseInt(k[0]) Integer.parseInt Integer k[0] k 0 int v2 = Integer.parseInt(k[1]); v2 Integer.parseInt(k[1]) Integer.parseInt Integer k[1] k 1 i = 0 i 0 for (int j = 0; j < v; j++) {
				i = 0;
				while (i < v2) {
					System.out.print("#");
					i++;
				}
				System.out.println("");
			} int j = 0; int j = 0; j 0 j < v j v j++ j++ j {
				i = 0;
				while (i < v2) {
					System.out.print("#");
					i++;
				}
				System.out.println("");
			} {
				i = 0;
				while (i < v2) {
					System.out.print("#");
					i++;
				}
				System.out.println("");
			} i = 0 i 0 while (i < v2) {
					System.out.print("#");
					i++;
				} i < v2 i v2 {
					System.out.print("#");
					i++;
				} System.out.print("#") System.out.print System.out System System.out "#" i++ i System.out.println("") System.out.println System.out System System.out "" System.out.println("") System.out.println System.out System System.out "" String[] arges arges public class Main {
	public static void main(String[] arges) {
		Scanner sc = new Scanner(System.in);
		List<String> klist = new ArrayList<String>();
		int i = 0;
		for (int j = 0; i < 1; j++) {
			String line = sc.nextLine();
			klist.add(line);
			if (klist.get(j).equals("0 0")) {
				break;
			}
		}
		for (String string : klist) {
			if (string.equals("0 0")) {
				break;
			}
			String[] k = string.split(" ");
			int v = Integer.parseInt(k[0]);
			int v2 = Integer.parseInt(k[1]);
			i = 0;

			for (int j = 0; j < v; j++) {
				i = 0;
				while (i < v2) {
					System.out.print("#");
					i++;
				}
				System.out.println("");
			}
			System.out.println("");
		}
	}
} public class Main {
	public static void main(String[] arges) {
		Scanner sc = new Scanner(System.in);
		List<String> klist = new ArrayList<String>();
		int i = 0;
		for (int j = 0; i < 1; j++) {
			String line = sc.nextLine();
			klist.add(line);
			if (klist.get(j).equals("0 0")) {
				break;
			}
		}
		for (String string : klist) {
			if (string.equals("0 0")) {
				break;
			}
			String[] k = string.split(" ");
			int v = Integer.parseInt(k[0]);
			int v2 = Integer.parseInt(k[1]);
			i = 0;

			for (int j = 0; j < v; j++) {
				i = 0;
				while (i < v2) {
					System.out.print("#");
					i++;
				}
				System.out.println("");
			}
			System.out.println("");
		}
	}
} Main
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
	public static void main(String[] arges) {
		Scanner sc = new Scanner(System.in);
		List<String> klist = new ArrayList<String>();
		int i = 0;
		for (int j = 0; i < 1; j++) {
			String line = sc.nextLine();
			klist.add(line);
			if (klist.get(j).equals("0 0")) {
				break;
			}
		}
		for (String string : klist) {
			if (string.equals("0 0")) {
				break;
			}
			String[] k = string.split(" ");
			int v = Integer.parseInt(k[0]);
			int v2 = Integer.parseInt(k[1]);
			i = 0;

			for (int j = 0; j < v; j++) {
				i = 0;
				while (i < v2) {
					System.out.print("#");
					i++;
				}
				System.out.println("");
			}
			System.out.println("");
		}
	}
}