import java.io.IOException;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		StringBuilder output = new StringBuilder();
		StringBuilder all = new StringBuilder();

		while (true) {
			int H = sc.nextInt();
			int W = sc.nextInt();

			if (H + W == 0)
				break;

			for (int i = 0; i < H; i++) {
				for (int j = 0; j < W; j++) {
					output = output.append("#");
				}
				output = output.append("\n");
			}
			all = all.append(output + "\n");
			output.delete(0,output.length());
		}
		System.out.print(all);
		sc.close();
	}

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

	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		StringBuilder output = new StringBuilder();
		StringBuilder all = new StringBuilder();

		while (true) {
			int H = sc.nextInt();
			int W = sc.nextInt();

			if (H + W == 0)
				break;

			for (int i = 0; i < H; i++) {
				for (int j = 0; j < W; j++) {
					output = output.append("#");
				}
				output = output.append("\n");
			}
			all = all.append(output + "\n");
			output.delete(0,output.length());
		}
		System.out.print(all);
		sc.close();
	}

} Main public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		StringBuilder output = new StringBuilder();
		StringBuilder all = new StringBuilder();

		while (true) {
			int H = sc.nextInt();
			int W = sc.nextInt();

			if (H + W == 0)
				break;

			for (int i = 0; i < H; i++) {
				for (int j = 0; j < W; j++) {
					output = output.append("#");
				}
				output = output.append("\n");
			}
			all = all.append(output + "\n");
			output.delete(0,output.length());
		}
		System.out.print(all);
		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);
		StringBuilder output = new StringBuilder();
		StringBuilder all = new StringBuilder();

		while (true) {
			int H = sc.nextInt();
			int W = sc.nextInt();

			if (H + W == 0)
				break;

			for (int i = 0; i < H; i++) {
				for (int j = 0; j < W; j++) {
					output = output.append("#");
				}
				output = output.append("\n");
			}
			all = all.append(output + "\n");
			output.delete(0,output.length());
		}
		System.out.print(all);
		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) StringBuilder output = new StringBuilder(); output new StringBuilder() StringBuilder all = new StringBuilder(); all new StringBuilder() while (true) {
			int H = sc.nextInt();
			int W = sc.nextInt();

			if (H + W == 0)
				break;

			for (int i = 0; i < H; i++) {
				for (int j = 0; j < W; j++) {
					output = output.append("#");
				}
				output = output.append("\n");
			}
			all = all.append(output + "\n");
			output.delete(0,output.length());
		} true {
			int H = sc.nextInt();
			int W = sc.nextInt();

			if (H + W == 0)
				break;

			for (int i = 0; i < H; i++) {
				for (int j = 0; j < W; j++) {
					output = output.append("#");
				}
				output = output.append("\n");
			}
			all = all.append(output + "\n");
			output.delete(0,output.length());
		} int H = sc.nextInt(); H sc.nextInt() sc.nextInt sc int W = sc.nextInt(); W sc.nextInt() sc.nextInt sc if (H + W == 0)
				break; H + W == 0 H + W H W 0 break; for (int i = 0; i < H; i++) {
				for (int j = 0; j < W; j++) {
					output = output.append("#");
				}
				output = output.append("\n");
			} int i = 0; int i = 0; i 0 i < H i H i++ i++ i {
				for (int j = 0; j < W; j++) {
					output = output.append("#");
				}
				output = output.append("\n");
			} {
				for (int j = 0; j < W; j++) {
					output = output.append("#");
				}
				output = output.append("\n");
			} for (int j = 0; j < W; j++) {
					output = output.append("#");
				} int j = 0; int j = 0; j 0 j < W j W j++ j++ j {
					output = output.append("#");
				} {
					output = output.append("#");
				} output = output.append("#") output output.append("#") output.append output "#" output = output.append("\n") output output.append("\n") output.append output "\n" all = all.append(output + "\n") all all.append(output + "\n") all.append all output + "\n" output "\n" output.delete(0,output.length()) output.delete output 0 output.length() output.length output System.out.print(all) System.out.print System.out System System.out all sc.close() sc.close sc String[] args args public class Main {

	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		StringBuilder output = new StringBuilder();
		StringBuilder all = new StringBuilder();

		while (true) {
			int H = sc.nextInt();
			int W = sc.nextInt();

			if (H + W == 0)
				break;

			for (int i = 0; i < H; i++) {
				for (int j = 0; j < W; j++) {
					output = output.append("#");
				}
				output = output.append("\n");
			}
			all = all.append(output + "\n");
			output.delete(0,output.length());
		}
		System.out.print(all);
		sc.close();
	}

} public class Main {

	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		StringBuilder output = new StringBuilder();
		StringBuilder all = new StringBuilder();

		while (true) {
			int H = sc.nextInt();
			int W = sc.nextInt();

			if (H + W == 0)
				break;

			for (int i = 0; i < H; i++) {
				for (int j = 0; j < W; j++) {
					output = output.append("#");
				}
				output = output.append("\n");
			}
			all = all.append(output + "\n");
			output.delete(0,output.length());
		}
		System.out.print(all);
		sc.close();
	}

} Main
import java.io.IOException;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		StringBuilder output = new StringBuilder();
		StringBuilder all = new StringBuilder();

		while (true) {
			int H = sc.nextInt();
			int W = sc.nextInt();

			if (H + W == 0)
				break;

			for (int i = 0; i < H; i++) {
				for (int j = 0; j < W; j++) {
					output = output.append("#");
				}
				output = output.append("\n");
			}
			all = all.append(output + "\n");
			output.delete(0,output.length());
		}
		System.out.print(all);
		sc.close();
	}

}