

import java.util.*;

public class Main {
	public static void main(String args[]) {
		Scanner scan = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		sb.append("");//??????????????\???????????????
		int h, w;
		
		// h??¨w?????¨??????0????????£?????¨??????????????????????????????
		while (true) {
			h = scan.nextInt();// ????????????
			w = scan.nextInt();// ?¨??????????
			
			if((h == 0) & (w == 0)){break;}

			// for?????§????????????h??§????????????
			for (int count = 0; count < h; count++) {
				// for?????§?¨???????????????§????????????
				for (int count2 = 0; count2 < w; count2++) {
					// #???StringBuilder?????\????????????
					sb.append("#");
				}
				sb.append("\n");
			}
			System.out.println(new String(sb));
			//StringBuilder????????????????????????
			sb.delete(0, sb.length());
		}
		

	}
} import java.util.*; util.* java public class Main {
	public static void main(String args[]) {
		Scanner scan = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		sb.append("");//??????????????\???????????????
		int h, w;
		
		// h??¨w?????¨??????0????????£?????¨??????????????????????????????
		while (true) {
			h = scan.nextInt();// ????????????
			w = scan.nextInt();// ?¨??????????
			
			if((h == 0) & (w == 0)){break;}

			// for?????§????????????h??§????????????
			for (int count = 0; count < h; count++) {
				// for?????§?¨???????????????§????????????
				for (int count2 = 0; count2 < w; count2++) {
					// #???StringBuilder?????\????????????
					sb.append("#");
				}
				sb.append("\n");
			}
			System.out.println(new String(sb));
			//StringBuilder????????????????????????
			sb.delete(0, sb.length());
		}
		

	}
} Main public static void main(String args[]) {
		Scanner scan = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		sb.append("");//??????????????\???????????????
		int h, w;
		
		// h??¨w?????¨??????0????????£?????¨??????????????????????????????
		while (true) {
			h = scan.nextInt();// ????????????
			w = scan.nextInt();// ?¨??????????
			
			if((h == 0) & (w == 0)){break;}

			// for?????§????????????h??§????????????
			for (int count = 0; count < h; count++) {
				// for?????§?¨???????????????§????????????
				for (int count2 = 0; count2 < w; count2++) {
					// #???StringBuilder?????\????????????
					sb.append("#");
				}
				sb.append("\n");
			}
			System.out.println(new String(sb));
			//StringBuilder????????????????????????
			sb.delete(0, sb.length());
		}
		

	} main {
		Scanner scan = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		sb.append("");//??????????????\???????????????
		int h, w;
		
		// h??¨w?????¨??????0????????£?????¨??????????????????????????????
		while (true) {
			h = scan.nextInt();// ????????????
			w = scan.nextInt();// ?¨??????????
			
			if((h == 0) & (w == 0)){break;}

			// for?????§????????????h??§????????????
			for (int count = 0; count < h; count++) {
				// for?????§?¨???????????????§????????????
				for (int count2 = 0; count2 < w; count2++) {
					// #???StringBuilder?????\????????????
					sb.append("#");
				}
				sb.append("\n");
			}
			System.out.println(new String(sb));
			//StringBuilder????????????????????????
			sb.delete(0, sb.length());
		}
		

	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) StringBuilder sb = new StringBuilder(); sb new StringBuilder() sb.append("") sb.append sb "" int h h w; w while (true) {
			h = scan.nextInt();// ????????????
			w = scan.nextInt();// ?¨??????????
			
			if((h == 0) & (w == 0)){break;}

			// for?????§????????????h??§????????????
			for (int count = 0; count < h; count++) {
				// for?????§?¨???????????????§????????????
				for (int count2 = 0; count2 < w; count2++) {
					// #???StringBuilder?????\????????????
					sb.append("#");
				}
				sb.append("\n");
			}
			System.out.println(new String(sb));
			//StringBuilder????????????????????????
			sb.delete(0, sb.length());
		} true {
			h = scan.nextInt();// ????????????
			w = scan.nextInt();// ?¨??????????
			
			if((h == 0) & (w == 0)){break;}

			// for?????§????????????h??§????????????
			for (int count = 0; count < h; count++) {
				// for?????§?¨???????????????§????????????
				for (int count2 = 0; count2 < w; count2++) {
					// #???StringBuilder?????\????????????
					sb.append("#");
				}
				sb.append("\n");
			}
			System.out.println(new String(sb));
			//StringBuilder????????????????????????
			sb.delete(0, sb.length());
		} h = scan.nextInt() h scan.nextInt() scan.nextInt scan 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;} break; for (int count = 0; count < h; count++) {
				// for?????§?¨???????????????§????????????
				for (int count2 = 0; count2 < w; count2++) {
					// #???StringBuilder?????\????????????
					sb.append("#");
				}
				sb.append("\n");
			} int count = 0; int count = 0; count 0 count < h count h count++ count++ count {
				// for?????§?¨???????????????§????????????
				for (int count2 = 0; count2 < w; count2++) {
					// #???StringBuilder?????\????????????
					sb.append("#");
				}
				sb.append("\n");
			} {
				// for?????§?¨???????????????§????????????
				for (int count2 = 0; count2 < w; count2++) {
					// #???StringBuilder?????\????????????
					sb.append("#");
				}
				sb.append("\n");
			} for (int count2 = 0; count2 < w; count2++) {
					// #???StringBuilder?????\????????????
					sb.append("#");
				} int count2 = 0; int count2 = 0; count2 0 count2 < w count2 w count2++ count2++ count2 {
					// #???StringBuilder?????\????????????
					sb.append("#");
				} {
					// #???StringBuilder?????\????????????
					sb.append("#");
				} sb.append("#") sb.append sb "#" sb.append("\n") sb.append sb "\n" System.out.println(new String(sb)) System.out.println System.out System System.out new String(sb) sb.delete(0, sb.length()) sb.delete sb 0 sb.length() sb.length sb String args[] args public class Main {
	public static void main(String args[]) {
		Scanner scan = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		sb.append("");//??????????????\???????????????
		int h, w;
		
		// h??¨w?????¨??????0????????£?????¨??????????????????????????????
		while (true) {
			h = scan.nextInt();// ????????????
			w = scan.nextInt();// ?¨??????????
			
			if((h == 0) & (w == 0)){break;}

			// for?????§????????????h??§????????????
			for (int count = 0; count < h; count++) {
				// for?????§?¨???????????????§????????????
				for (int count2 = 0; count2 < w; count2++) {
					// #???StringBuilder?????\????????????
					sb.append("#");
				}
				sb.append("\n");
			}
			System.out.println(new String(sb));
			//StringBuilder????????????????????????
			sb.delete(0, sb.length());
		}
		

	}
} public class Main {
	public static void main(String args[]) {
		Scanner scan = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		sb.append("");//??????????????\???????????????
		int h, w;
		
		// h??¨w?????¨??????0????????£?????¨??????????????????????????????
		while (true) {
			h = scan.nextInt();// ????????????
			w = scan.nextInt();// ?¨??????????
			
			if((h == 0) & (w == 0)){break;}

			// for?????§????????????h??§????????????
			for (int count = 0; count < h; count++) {
				// for?????§?¨???????????????§????????????
				for (int count2 = 0; count2 < w; count2++) {
					// #???StringBuilder?????\????????????
					sb.append("#");
				}
				sb.append("\n");
			}
			System.out.println(new String(sb));
			//StringBuilder????????????????????????
			sb.delete(0, sb.length());
		}
		

	}
} Main


import java.util.*;

public class Main {
	public static void main(String args[]) {
		Scanner scan = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		sb.append("");//??????????????\???????????????
		int h, w;
		
		// h??¨w?????¨??????0????????£?????¨??????????????????????????????
		while (true) {
			h = scan.nextInt();// ????????????
			w = scan.nextInt();// ?¨??????????
			
			if((h == 0) & (w == 0)){break;}

			// for?????§????????????h??§????????????
			for (int count = 0; count < h; count++) {
				// for?????§?¨???????????????§????????????
				for (int count2 = 0; count2 < w; count2++) {
					// #???StringBuilder?????\????????????
					sb.append("#");
				}
				sb.append("\n");
			}
			System.out.println(new String(sb));
			//StringBuilder????????????????????????
			sb.delete(0, sb.length());
		}
		

	}
}