import java.util.Scanner;
class Main{
	public void Germany() {
		Scanner sc = new Scanner(System.in);
		int H,W;
		H = sc.nextInt();
		W = sc.nextInt();
		while(H != 0 && W != 0){
			for(int i = 1;i <= H;i++) {
				for(int x = 1;x <= W;x++) {
					System.out.print("#");
				}
				System.out.print("\n");
			}
			System.out.println( );
			H = sc.nextInt();
			W = sc.nextInt();
		}
	}
	public static void main(String[] args) {
			new Main().Germany();
	}
} import java.util.Scanner; Scanner java.util class Main{
	public void Germany() {
		Scanner sc = new Scanner(System.in);
		int H,W;
		H = sc.nextInt();
		W = sc.nextInt();
		while(H != 0 && W != 0){
			for(int i = 1;i <= H;i++) {
				for(int x = 1;x <= W;x++) {
					System.out.print("#");
				}
				System.out.print("\n");
			}
			System.out.println( );
			H = sc.nextInt();
			W = sc.nextInt();
		}
	}
	public static void main(String[] args) {
			new Main().Germany();
	}
} Main public void Germany() {
		Scanner sc = new Scanner(System.in);
		int H,W;
		H = sc.nextInt();
		W = sc.nextInt();
		while(H != 0 && W != 0){
			for(int i = 1;i <= H;i++) {
				for(int x = 1;x <= W;x++) {
					System.out.print("#");
				}
				System.out.print("\n");
			}
			System.out.println( );
			H = sc.nextInt();
			W = sc.nextInt();
		}
	} Germany {
		Scanner sc = new Scanner(System.in);
		int H,W;
		H = sc.nextInt();
		W = sc.nextInt();
		while(H != 0 && W != 0){
			for(int i = 1;i <= H;i++) {
				for(int x = 1;x <= W;x++) {
					System.out.print("#");
				}
				System.out.print("\n");
			}
			System.out.println( );
			H = sc.nextInt();
			W = sc.nextInt();
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int H H W; W H = sc.nextInt() H sc.nextInt() sc.nextInt sc W = sc.nextInt() W sc.nextInt() sc.nextInt sc while(H != 0 && W != 0){
			for(int i = 1;i <= H;i++) {
				for(int x = 1;x <= W;x++) {
					System.out.print("#");
				}
				System.out.print("\n");
			}
			System.out.println( );
			H = sc.nextInt();
			W = sc.nextInt();
		} H != 0 && W != 0 H != 0 H 0 W != 0 W 0 {
			for(int i = 1;i <= H;i++) {
				for(int x = 1;x <= W;x++) {
					System.out.print("#");
				}
				System.out.print("\n");
			}
			System.out.println( );
			H = sc.nextInt();
			W = sc.nextInt();
		} for(int i = 1;i <= H;i++) {
				for(int x = 1;x <= W;x++) {
					System.out.print("#");
				}
				System.out.print("\n");
			} int i = 1; int i = 1; i 1 i <= H i H i++ i++ i {
				for(int x = 1;x <= W;x++) {
					System.out.print("#");
				}
				System.out.print("\n");
			} {
				for(int x = 1;x <= W;x++) {
					System.out.print("#");
				}
				System.out.print("\n");
			} for(int x = 1;x <= W;x++) {
					System.out.print("#");
				} int x = 1; int x = 1; x 1 x <= W x W x++ x++ x {
					System.out.print("#");
				} {
					System.out.print("#");
				} System.out.print("#") System.out.print System.out System System.out "#" System.out.print("\n") System.out.print System.out System System.out "\n" System.out.println( ) System.out.println System.out System System.out H = sc.nextInt() H sc.nextInt() sc.nextInt sc W = sc.nextInt() W sc.nextInt() sc.nextInt sc public static void main(String[] args) {
			new Main().Germany();
	} main {
			new Main().Germany();
	} new Main().Germany() new Main().Germany new Main() String[] args args
import java.util.Scanner;
class Main{
	public void Germany() {
		Scanner sc = new Scanner(System.in);
		int H,W;
		H = sc.nextInt();
		W = sc.nextInt();
		while(H != 0 && W != 0){
			for(int i = 1;i <= H;i++) {
				for(int x = 1;x <= W;x++) {
					System.out.print("#");
				}
				System.out.print("\n");
			}
			System.out.println( );
			H = sc.nextInt();
			W = sc.nextInt();
		}
	}
	public static void main(String[] args) {
			new Main().Germany();
	}
}