import java.util.Scanner;

public class Main {
	void run(){
		Scanner s = new Scanner(System.in);
		int H = s.nextInt();
		int W = s.nextInt();
		for(;;){
			if(H == 0 && W == 0) break;
			for(int i = 0; i < H; i++){
				for(int n = 0; n < W; n++){
					System.out.print("#");
				}
				System.out.println();
			}
			H = s.nextInt();
			W = s.nextInt();
			System.out.println();
		}
		
	}
	public static void main(String[] args) {
		
		new Main().run();
		
	}
} import java.util.Scanner; Scanner java.util public class Main {
	void run(){
		Scanner s = new Scanner(System.in);
		int H = s.nextInt();
		int W = s.nextInt();
		for(;;){
			if(H == 0 && W == 0) break;
			for(int i = 0; i < H; i++){
				for(int n = 0; n < W; n++){
					System.out.print("#");
				}
				System.out.println();
			}
			H = s.nextInt();
			W = s.nextInt();
			System.out.println();
		}
		
	}
	public static void main(String[] args) {
		
		new Main().run();
		
	}
} Main void run(){
		Scanner s = new Scanner(System.in);
		int H = s.nextInt();
		int W = s.nextInt();
		for(;;){
			if(H == 0 && W == 0) break;
			for(int i = 0; i < H; i++){
				for(int n = 0; n < W; n++){
					System.out.print("#");
				}
				System.out.println();
			}
			H = s.nextInt();
			W = s.nextInt();
			System.out.println();
		}
		
	} run {
		Scanner s = new Scanner(System.in);
		int H = s.nextInt();
		int W = s.nextInt();
		for(;;){
			if(H == 0 && W == 0) break;
			for(int i = 0; i < H; i++){
				for(int n = 0; n < W; n++){
					System.out.print("#");
				}
				System.out.println();
			}
			H = s.nextInt();
			W = s.nextInt();
			System.out.println();
		}
		
	} Scanner s = new Scanner(System.in); s new Scanner(System.in) int H = s.nextInt(); H s.nextInt() s.nextInt s int W = s.nextInt(); W s.nextInt() s.nextInt s for(;;){
			if(H == 0 && W == 0) break;
			for(int i = 0; i < H; i++){
				for(int n = 0; n < W; n++){
					System.out.print("#");
				}
				System.out.println();
			}
			H = s.nextInt();
			W = s.nextInt();
			System.out.println();
		} ; {
			if(H == 0 && W == 0) break;
			for(int i = 0; i < H; i++){
				for(int n = 0; n < W; n++){
					System.out.print("#");
				}
				System.out.println();
			}
			H = s.nextInt();
			W = s.nextInt();
			System.out.println();
		} {
			if(H == 0 && W == 0) break;
			for(int i = 0; i < H; i++){
				for(int n = 0; n < W; n++){
					System.out.print("#");
				}
				System.out.println();
			}
			H = s.nextInt();
			W = s.nextInt();
			System.out.println();
		} 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 n = 0; n < W; n++){
					System.out.print("#");
				}
				System.out.println();
			} int i = 0; int i = 0; i 0 i < H i H i++ i++ i {
				for(int n = 0; n < W; n++){
					System.out.print("#");
				}
				System.out.println();
			} {
				for(int n = 0; n < W; n++){
					System.out.print("#");
				}
				System.out.println();
			} for(int n = 0; n < W; n++){
					System.out.print("#");
				} int n = 0; int n = 0; n 0 n < W n W n++ n++ n {
					System.out.print("#");
				} {
					System.out.print("#");
				} System.out.print("#") System.out.print System.out System System.out "#" System.out.println() System.out.println System.out System System.out H = s.nextInt() H s.nextInt() s.nextInt s W = s.nextInt() W s.nextInt() s.nextInt s System.out.println() System.out.println System.out System System.out public static void main(String[] args) {
		
		new Main().run();
		
	} main {
		
		new Main().run();
		
	} new Main().run() new Main().run new Main() String[] args args public class Main {
	void run(){
		Scanner s = new Scanner(System.in);
		int H = s.nextInt();
		int W = s.nextInt();
		for(;;){
			if(H == 0 && W == 0) break;
			for(int i = 0; i < H; i++){
				for(int n = 0; n < W; n++){
					System.out.print("#");
				}
				System.out.println();
			}
			H = s.nextInt();
			W = s.nextInt();
			System.out.println();
		}
		
	}
	public static void main(String[] args) {
		
		new Main().run();
		
	}
} public class Main {
	void run(){
		Scanner s = new Scanner(System.in);
		int H = s.nextInt();
		int W = s.nextInt();
		for(;;){
			if(H == 0 && W == 0) break;
			for(int i = 0; i < H; i++){
				for(int n = 0; n < W; n++){
					System.out.print("#");
				}
				System.out.println();
			}
			H = s.nextInt();
			W = s.nextInt();
			System.out.println();
		}
		
	}
	public static void main(String[] args) {
		
		new Main().run();
		
	}
} Main
import java.util.Scanner;

public class Main {
	void run(){
		Scanner s = new Scanner(System.in);
		int H = s.nextInt();
		int W = s.nextInt();
		for(;;){
			if(H == 0 && W == 0) break;
			for(int i = 0; i < H; i++){
				for(int n = 0; n < W; n++){
					System.out.print("#");
				}
				System.out.println();
			}
			H = s.nextInt();
			W = s.nextInt();
			System.out.println();
		}
		
	}
	public static void main(String[] args) {
		
		new Main().run();
		
	}
}