import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);

		int k = 0;
		while (k == 0) {
			String line = sc.nextLine();
			String[] x = line.split(" ");
			int H = Integer.parseInt(x[0]);
			int W = Integer.parseInt(x[1]);
			if (H == 0 && W == 0) {
				break;
			}
			int i = 0;
			String str = "";
			while (i < W) {
				str += "#";
				i++;
			}
			int j = 0;
			while (j < H) {
				System.out.println(str);
				j++;
			}
			System.out.println("");
		}
	}

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

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);

		int k = 0;
		while (k == 0) {
			String line = sc.nextLine();
			String[] x = line.split(" ");
			int H = Integer.parseInt(x[0]);
			int W = Integer.parseInt(x[1]);
			if (H == 0 && W == 0) {
				break;
			}
			int i = 0;
			String str = "";
			while (i < W) {
				str += "#";
				i++;
			}
			int j = 0;
			while (j < H) {
				System.out.println(str);
				j++;
			}
			System.out.println("");
		}
	}

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

		int k = 0;
		while (k == 0) {
			String line = sc.nextLine();
			String[] x = line.split(" ");
			int H = Integer.parseInt(x[0]);
			int W = Integer.parseInt(x[1]);
			if (H == 0 && W == 0) {
				break;
			}
			int i = 0;
			String str = "";
			while (i < W) {
				str += "#";
				i++;
			}
			int j = 0;
			while (j < H) {
				System.out.println(str);
				j++;
			}
			System.out.println("");
		}
	} main {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);

		int k = 0;
		while (k == 0) {
			String line = sc.nextLine();
			String[] x = line.split(" ");
			int H = Integer.parseInt(x[0]);
			int W = Integer.parseInt(x[1]);
			if (H == 0 && W == 0) {
				break;
			}
			int i = 0;
			String str = "";
			while (i < W) {
				str += "#";
				i++;
			}
			int j = 0;
			while (j < H) {
				System.out.println(str);
				j++;
			}
			System.out.println("");
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int k = 0; k 0 while (k == 0) {
			String line = sc.nextLine();
			String[] x = line.split(" ");
			int H = Integer.parseInt(x[0]);
			int W = Integer.parseInt(x[1]);
			if (H == 0 && W == 0) {
				break;
			}
			int i = 0;
			String str = "";
			while (i < W) {
				str += "#";
				i++;
			}
			int j = 0;
			while (j < H) {
				System.out.println(str);
				j++;
			}
			System.out.println("");
		} k == 0 k 0 {
			String line = sc.nextLine();
			String[] x = line.split(" ");
			int H = Integer.parseInt(x[0]);
			int W = Integer.parseInt(x[1]);
			if (H == 0 && W == 0) {
				break;
			}
			int i = 0;
			String str = "";
			while (i < W) {
				str += "#";
				i++;
			}
			int j = 0;
			while (j < H) {
				System.out.println(str);
				j++;
			}
			System.out.println("");
		} String line = sc.nextLine(); line sc.nextLine() sc.nextLine sc String[] x = line.split(" "); x line.split(" ") line.split line " " int H = Integer.parseInt(x[0]); H Integer.parseInt(x[0]) Integer.parseInt Integer x[0] x 0 int W = Integer.parseInt(x[1]); W Integer.parseInt(x[1]) Integer.parseInt Integer x[1] x 1 if (H == 0 && W == 0) {
				break;
			} H == 0 && W == 0 H == 0 H 0 W == 0 W 0 {
				break;
			} break; int i = 0; i 0 String str = ""; str "" while (i < W) {
				str += "#";
				i++;
			} i < W i W {
				str += "#";
				i++;
			} str += "#" str "#" i++ i int j = 0; j 0 while (j < H) {
				System.out.println(str);
				j++;
			} j < H j H {
				System.out.println(str);
				j++;
			} System.out.println(str) System.out.println System.out System System.out str j++ j System.out.println("") System.out.println System.out System System.out "" String[] args args public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);

		int k = 0;
		while (k == 0) {
			String line = sc.nextLine();
			String[] x = line.split(" ");
			int H = Integer.parseInt(x[0]);
			int W = Integer.parseInt(x[1]);
			if (H == 0 && W == 0) {
				break;
			}
			int i = 0;
			String str = "";
			while (i < W) {
				str += "#";
				i++;
			}
			int j = 0;
			while (j < H) {
				System.out.println(str);
				j++;
			}
			System.out.println("");
		}
	}

} public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);

		int k = 0;
		while (k == 0) {
			String line = sc.nextLine();
			String[] x = line.split(" ");
			int H = Integer.parseInt(x[0]);
			int W = Integer.parseInt(x[1]);
			if (H == 0 && W == 0) {
				break;
			}
			int i = 0;
			String str = "";
			while (i < W) {
				str += "#";
				i++;
			}
			int j = 0;
			while (j < H) {
				System.out.println(str);
				j++;
			}
			System.out.println("");
		}
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);

		int k = 0;
		while (k == 0) {
			String line = sc.nextLine();
			String[] x = line.split(" ");
			int H = Integer.parseInt(x[0]);
			int W = Integer.parseInt(x[1]);
			if (H == 0 && W == 0) {
				break;
			}
			int i = 0;
			String str = "";
			while (i < W) {
				str += "#";
				i++;
			}
			int j = 0;
			while (j < H) {
				System.out.println(str);
				j++;
			}
			System.out.println("");
		}
	}

}