import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		try (Scanner stdIn = new Scanner(System.in)) {
			Rectangle rectangle = new Rectangle();
			while (true) {
				int h = stdIn.nextInt();
				int w = stdIn.nextInt();
				if (h > 300 || w > 300) {
					throw new RuntimeException("Input Error:range 0 to 300");
				}
				if (h == 0 && w == 0) {
					break;
				}
				rectangle.setChar('#');
				rectangle.draw(h, w);
				System.out.println("");
			}
		} catch (Exception e) {
			System.out.println(e.getMessage());
		}
	}
}

final class Rectangle {
	private Character displayChar = '*';

	/**
	 * Set a character to draw shape
	 * @param displayChar a character
	 */
	protected void setChar(Character displayChar) {
		this.displayChar = displayChar;
	}

	/**
	 * Draw square
	 * @param height Height of square
	 * @param width Width of square
	 */
	protected void draw(int height, int width) {
		if (height < 0 || width < 0) {
			throw new RuntimeException("Input Error:Minus value input");
		}
		for (int i = 1; i <= height; i++) {
			for (int j = 1; j <= width; j++) {
				System.out.print(this.displayChar);
			}
			System.out.println("");
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		try (Scanner stdIn = new Scanner(System.in)) {
			Rectangle rectangle = new Rectangle();
			while (true) {
				int h = stdIn.nextInt();
				int w = stdIn.nextInt();
				if (h > 300 || w > 300) {
					throw new RuntimeException("Input Error:range 0 to 300");
				}
				if (h == 0 && w == 0) {
					break;
				}
				rectangle.setChar('#');
				rectangle.draw(h, w);
				System.out.println("");
			}
		} catch (Exception e) {
			System.out.println(e.getMessage());
		}
	}
} Main public static void main(String[] args) {
		try (Scanner stdIn = new Scanner(System.in)) {
			Rectangle rectangle = new Rectangle();
			while (true) {
				int h = stdIn.nextInt();
				int w = stdIn.nextInt();
				if (h > 300 || w > 300) {
					throw new RuntimeException("Input Error:range 0 to 300");
				}
				if (h == 0 && w == 0) {
					break;
				}
				rectangle.setChar('#');
				rectangle.draw(h, w);
				System.out.println("");
			}
		} catch (Exception e) {
			System.out.println(e.getMessage());
		}
	} main {
		try (Scanner stdIn = new Scanner(System.in)) {
			Rectangle rectangle = new Rectangle();
			while (true) {
				int h = stdIn.nextInt();
				int w = stdIn.nextInt();
				if (h > 300 || w > 300) {
					throw new RuntimeException("Input Error:range 0 to 300");
				}
				if (h == 0 && w == 0) {
					break;
				}
				rectangle.setChar('#');
				rectangle.draw(h, w);
				System.out.println("");
			}
		} catch (Exception e) {
			System.out.println(e.getMessage());
		}
	} try (Scanner stdIn = new Scanner(System.in)) {
			Rectangle rectangle = new Rectangle();
			while (true) {
				int h = stdIn.nextInt();
				int w = stdIn.nextInt();
				if (h > 300 || w > 300) {
					throw new RuntimeException("Input Error:range 0 to 300");
				}
				if (h == 0 && w == 0) {
					break;
				}
				rectangle.setChar('#');
				rectangle.draw(h, w);
				System.out.println("");
			}
		} catch (Exception e) {
			System.out.println(e.getMessage());
		} catch (Exception e) {
			System.out.println(e.getMessage());
		} Exception e {
			System.out.println(e.getMessage());
		} System.out.println(e.getMessage()) System.out.println System.out System System.out e.getMessage() e.getMessage e {
			Rectangle rectangle = new Rectangle();
			while (true) {
				int h = stdIn.nextInt();
				int w = stdIn.nextInt();
				if (h > 300 || w > 300) {
					throw new RuntimeException("Input Error:range 0 to 300");
				}
				if (h == 0 && w == 0) {
					break;
				}
				rectangle.setChar('#');
				rectangle.draw(h, w);
				System.out.println("");
			}
		} Scanner stdIn = new Scanner(System.in) Scanner stdIn = new Scanner(System.in) new Scanner(System.in) Rectangle rectangle = new Rectangle(); rectangle new Rectangle() while (true) {
				int h = stdIn.nextInt();
				int w = stdIn.nextInt();
				if (h > 300 || w > 300) {
					throw new RuntimeException("Input Error:range 0 to 300");
				}
				if (h == 0 && w == 0) {
					break;
				}
				rectangle.setChar('#');
				rectangle.draw(h, w);
				System.out.println("");
			} true {
				int h = stdIn.nextInt();
				int w = stdIn.nextInt();
				if (h > 300 || w > 300) {
					throw new RuntimeException("Input Error:range 0 to 300");
				}
				if (h == 0 && w == 0) {
					break;
				}
				rectangle.setChar('#');
				rectangle.draw(h, w);
				System.out.println("");
			} int h = stdIn.nextInt(); h stdIn.nextInt() stdIn.nextInt stdIn int w = stdIn.nextInt(); w stdIn.nextInt() stdIn.nextInt stdIn if (h > 300 || w > 300) {
					throw new RuntimeException("Input Error:range 0 to 300");
				} h > 300 || w > 300 h > 300 h 300 w > 300 w 300 {
					throw new RuntimeException("Input Error:range 0 to 300");
				} throw new RuntimeException("Input Error:range 0 to 300"); new RuntimeException("Input Error:range 0 to 300") if (h == 0 && w == 0) {
					break;
				} h == 0 && w == 0 h == 0 h 0 w == 0 w 0 {
					break;
				} break; rectangle.setChar('#') rectangle.setChar rectangle '#' rectangle.draw(h, w) rectangle.draw rectangle h w System.out.println("") System.out.println System.out System System.out "" String[] args args final class Rectangle {
	private Character displayChar = '*';

	/**
	 * Set a character to draw shape
	 * @param displayChar a character
	 */
	protected void setChar(Character displayChar) {
		this.displayChar = displayChar;
	}

	/**
	 * Draw square
	 * @param height Height of square
	 * @param width Width of square
	 */
	protected void draw(int height, int width) {
		if (height < 0 || width < 0) {
			throw new RuntimeException("Input Error:Minus value input");
		}
		for (int i = 1; i <= height; i++) {
			for (int j = 1; j <= width; j++) {
				System.out.print(this.displayChar);
			}
			System.out.println("");
		}
	}
} Rectangle private Character displayChar = '*'; displayChar '*' /**
	 * Set a character to draw shape
	 * @param displayChar a character
	 */
	protected void setChar(Character displayChar) {
		this.displayChar = displayChar;
	} setChar {
		this.displayChar = displayChar;
	} this.displayChar = displayChar this.displayChar this this.displayChar displayChar Character displayChar displayChar /**
	 * Draw square
	 * @param height Height of square
	 * @param width Width of square
	 */
	protected void draw(int height, int width) {
		if (height < 0 || width < 0) {
			throw new RuntimeException("Input Error:Minus value input");
		}
		for (int i = 1; i <= height; i++) {
			for (int j = 1; j <= width; j++) {
				System.out.print(this.displayChar);
			}
			System.out.println("");
		}
	} draw {
		if (height < 0 || width < 0) {
			throw new RuntimeException("Input Error:Minus value input");
		}
		for (int i = 1; i <= height; i++) {
			for (int j = 1; j <= width; j++) {
				System.out.print(this.displayChar);
			}
			System.out.println("");
		}
	} if (height < 0 || width < 0) {
			throw new RuntimeException("Input Error:Minus value input");
		} height < 0 || width < 0 height < 0 height 0 width < 0 width 0 {
			throw new RuntimeException("Input Error:Minus value input");
		} throw new RuntimeException("Input Error:Minus value input"); new RuntimeException("Input Error:Minus value input") for (int i = 1; i <= height; i++) {
			for (int j = 1; j <= width; j++) {
				System.out.print(this.displayChar);
			}
			System.out.println("");
		} int i = 1; int i = 1; i 1 i <= height i height i++ i++ i {
			for (int j = 1; j <= width; j++) {
				System.out.print(this.displayChar);
			}
			System.out.println("");
		} {
			for (int j = 1; j <= width; j++) {
				System.out.print(this.displayChar);
			}
			System.out.println("");
		} for (int j = 1; j <= width; j++) {
				System.out.print(this.displayChar);
			} int j = 1; int j = 1; j 1 j <= width j width j++ j++ j {
				System.out.print(this.displayChar);
			} {
				System.out.print(this.displayChar);
			} System.out.print(this.displayChar) System.out.print System.out System System.out this.displayChar this this.displayChar System.out.println("") System.out.println System.out System System.out "" int height height int width width public class Main {
	public static void main(String[] args) {
		try (Scanner stdIn = new Scanner(System.in)) {
			Rectangle rectangle = new Rectangle();
			while (true) {
				int h = stdIn.nextInt();
				int w = stdIn.nextInt();
				if (h > 300 || w > 300) {
					throw new RuntimeException("Input Error:range 0 to 300");
				}
				if (h == 0 && w == 0) {
					break;
				}
				rectangle.setChar('#');
				rectangle.draw(h, w);
				System.out.println("");
			}
		} catch (Exception e) {
			System.out.println(e.getMessage());
		}
	}
} public class Main {
	public static void main(String[] args) {
		try (Scanner stdIn = new Scanner(System.in)) {
			Rectangle rectangle = new Rectangle();
			while (true) {
				int h = stdIn.nextInt();
				int w = stdIn.nextInt();
				if (h > 300 || w > 300) {
					throw new RuntimeException("Input Error:range 0 to 300");
				}
				if (h == 0 && w == 0) {
					break;
				}
				rectangle.setChar('#');
				rectangle.draw(h, w);
				System.out.println("");
			}
		} catch (Exception e) {
			System.out.println(e.getMessage());
		}
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		try (Scanner stdIn = new Scanner(System.in)) {
			Rectangle rectangle = new Rectangle();
			while (true) {
				int h = stdIn.nextInt();
				int w = stdIn.nextInt();
				if (h > 300 || w > 300) {
					throw new RuntimeException("Input Error:range 0 to 300");
				}
				if (h == 0 && w == 0) {
					break;
				}
				rectangle.setChar('#');
				rectangle.draw(h, w);
				System.out.println("");
			}
		} catch (Exception e) {
			System.out.println(e.getMessage());
		}
	}
}

final class Rectangle {
	private Character displayChar = '*';

	/**
	 * Set a character to draw shape
	 * @param displayChar a character
	 */
	protected void setChar(Character displayChar) {
		this.displayChar = displayChar;
	}

	/**
	 * Draw square
	 * @param height Height of square
	 * @param width Width of square
	 */
	protected void draw(int height, int width) {
		if (height < 0 || width < 0) {
			throw new RuntimeException("Input Error:Minus value input");
		}
		for (int i = 1; i <= height; i++) {
			for (int j = 1; j <= width; j++) {
				System.out.print(this.displayChar);
			}
			System.out.println("");
		}
	}
}