import java.util.Arrays;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while (true) {
			int h = sc.nextInt();
			int w = sc.nextInt();
			if (h == 0 || w == 0) {
				sc.close();
				break;
			}
			printRectangle(h, w);
			System.out.println();
		}
	}
	
	public static void printRectangle(int h, int w) {
		char[] row = new char[w];
		Arrays.fill(row, '#');
		for (int i = 0; i < h; i++) {
			System.out.println(row);
		}
	}
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while (true) {
			int h = sc.nextInt();
			int w = sc.nextInt();
			if (h == 0 || w == 0) {
				sc.close();
				break;
			}
			printRectangle(h, w);
			System.out.println();
		}
	}
	
	public static void printRectangle(int h, int w) {
		char[] row = new char[w];
		Arrays.fill(row, '#');
		for (int i = 0; i < h; i++) {
			System.out.println(row);
		}
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while (true) {
			int h = sc.nextInt();
			int w = sc.nextInt();
			if (h == 0 || w == 0) {
				sc.close();
				break;
			}
			printRectangle(h, w);
			System.out.println();
		}
	} main {
		Scanner sc = new Scanner(System.in);
		while (true) {
			int h = sc.nextInt();
			int w = sc.nextInt();
			if (h == 0 || w == 0) {
				sc.close();
				break;
			}
			printRectangle(h, w);
			System.out.println();
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) while (true) {
			int h = sc.nextInt();
			int w = sc.nextInt();
			if (h == 0 || w == 0) {
				sc.close();
				break;
			}
			printRectangle(h, w);
			System.out.println();
		} true {
			int h = sc.nextInt();
			int w = sc.nextInt();
			if (h == 0 || w == 0) {
				sc.close();
				break;
			}
			printRectangle(h, w);
			System.out.println();
		} 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) {
				sc.close();
				break;
			} h == 0 || w == 0 h == 0 h 0 w == 0 w 0 {
				sc.close();
				break;
			} sc.close() sc.close sc break; printRectangle(h, w) printRectangle h w System.out.println() System.out.println System.out System System.out String[] args args public static void printRectangle(int h, int w) {
		char[] row = new char[w];
		Arrays.fill(row, '#');
		for (int i = 0; i < h; i++) {
			System.out.println(row);
		}
	} printRectangle {
		char[] row = new char[w];
		Arrays.fill(row, '#');
		for (int i = 0; i < h; i++) {
			System.out.println(row);
		}
	} char[] row = new char[w]; row new char[w] w Arrays.fill(row, '#') Arrays.fill Arrays row '#' for (int i = 0; i < h; i++) {
			System.out.println(row);
		} int i = 0; int i = 0; i 0 i < h i h i++ i++ i {
			System.out.println(row);
		} {
			System.out.println(row);
		} System.out.println(row) System.out.println System.out System System.out row int h h int w w public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while (true) {
			int h = sc.nextInt();
			int w = sc.nextInt();
			if (h == 0 || w == 0) {
				sc.close();
				break;
			}
			printRectangle(h, w);
			System.out.println();
		}
	}
	
	public static void printRectangle(int h, int w) {
		char[] row = new char[w];
		Arrays.fill(row, '#');
		for (int i = 0; i < h; i++) {
			System.out.println(row);
		}
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while (true) {
			int h = sc.nextInt();
			int w = sc.nextInt();
			if (h == 0 || w == 0) {
				sc.close();
				break;
			}
			printRectangle(h, w);
			System.out.println();
		}
	}
	
	public static void printRectangle(int h, int w) {
		char[] row = new char[w];
		Arrays.fill(row, '#');
		for (int i = 0; i < h; i++) {
			System.out.println(row);
		}
	}
} Main
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while (true) {
			int h = sc.nextInt();
			int w = sc.nextInt();
			if (h == 0 || w == 0) {
				sc.close();
				break;
			}
			printRectangle(h, w);
			System.out.println();
		}
	}
	
	public static void printRectangle(int h, int w) {
		char[] row = new char[w];
		Arrays.fill(row, '#');
		for (int i = 0; i < h; i++) {
			System.out.println(row);
		}
	}
}