import java.util.Scanner;

class Main {
	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		StringBuilder str = new StringBuilder();

		while (true) {
			int h = scan.nextInt();
			int w = scan.nextInt();

			if (h == 0 && w == 0)
				break;

			for (int i = 0; i < h; i++) {
				for (int j = 0; j < w; j++) {
					str.append("#");
				}
				str.append("\n");
			}
			str.append("\n");
		}
		System.out.print(str);

	}
} import java.util.Scanner; Scanner java.util class Main {
	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		StringBuilder str = new StringBuilder();

		while (true) {
			int h = scan.nextInt();
			int w = scan.nextInt();

			if (h == 0 && w == 0)
				break;

			for (int i = 0; i < h; i++) {
				for (int j = 0; j < w; j++) {
					str.append("#");
				}
				str.append("\n");
			}
			str.append("\n");
		}
		System.out.print(str);

	}
} Main public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		StringBuilder str = new StringBuilder();

		while (true) {
			int h = scan.nextInt();
			int w = scan.nextInt();

			if (h == 0 && w == 0)
				break;

			for (int i = 0; i < h; i++) {
				for (int j = 0; j < w; j++) {
					str.append("#");
				}
				str.append("\n");
			}
			str.append("\n");
		}
		System.out.print(str);

	} main {

		Scanner scan = new Scanner(System.in);
		StringBuilder str = new StringBuilder();

		while (true) {
			int h = scan.nextInt();
			int w = scan.nextInt();

			if (h == 0 && w == 0)
				break;

			for (int i = 0; i < h; i++) {
				for (int j = 0; j < w; j++) {
					str.append("#");
				}
				str.append("\n");
			}
			str.append("\n");
		}
		System.out.print(str);

	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) StringBuilder str = new StringBuilder(); str new StringBuilder() while (true) {
			int h = scan.nextInt();
			int w = scan.nextInt();

			if (h == 0 && w == 0)
				break;

			for (int i = 0; i < h; i++) {
				for (int j = 0; j < w; j++) {
					str.append("#");
				}
				str.append("\n");
			}
			str.append("\n");
		} true {
			int h = scan.nextInt();
			int w = scan.nextInt();

			if (h == 0 && w == 0)
				break;

			for (int i = 0; i < h; i++) {
				for (int j = 0; j < w; j++) {
					str.append("#");
				}
				str.append("\n");
			}
			str.append("\n");
		} int h = scan.nextInt(); h scan.nextInt() scan.nextInt scan int w = scan.nextInt(); w scan.nextInt() scan.nextInt scan if (h == 0 && w == 0)
				break; h == 0 && w == 0 h == 0 h 0 w == 0 w 0 break; for (int i = 0; i < h; i++) {
				for (int j = 0; j < w; j++) {
					str.append("#");
				}
				str.append("\n");
			} int i = 0; int i = 0; i 0 i < h i h i++ i++ i {
				for (int j = 0; j < w; j++) {
					str.append("#");
				}
				str.append("\n");
			} {
				for (int j = 0; j < w; j++) {
					str.append("#");
				}
				str.append("\n");
			} for (int j = 0; j < w; j++) {
					str.append("#");
				} int j = 0; int j = 0; j 0 j < w j w j++ j++ j {
					str.append("#");
				} {
					str.append("#");
				} str.append("#") str.append str "#" str.append("\n") str.append str "\n" str.append("\n") str.append str "\n" System.out.print(str) System.out.print System.out System System.out str String[] args args
import java.util.Scanner;

class Main {
	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		StringBuilder str = new StringBuilder();

		while (true) {
			int h = scan.nextInt();
			int w = scan.nextInt();

			if (h == 0 && w == 0)
				break;

			for (int i = 0; i < h; i++) {
				for (int j = 0; j < w; j++) {
					str.append("#");
				}
				str.append("\n");
			}
			str.append("\n");
		}
		System.out.print(str);

	}
}