import java.util.Scanner;
class Main {
	public void kami() {
		Scanner sc = new Scanner(System.in);
		
		int H = sc.nextInt();
		int W = sc.nextInt();
		
		while(H != 0 || W != 0){
			while(0 < H){
				for(int i = 1; i <= W; i++){
					System.out.print("#");
				}
				System.out.println();
				H--;
			}
			System.out.println();
			H = sc.nextInt();
			W = sc.nextInt();
		}
		
	}

	public static void main(String[] args) {
		new Main().kami();
	}

} import java.util.Scanner; Scanner java.util class Main {
	public void kami() {
		Scanner sc = new Scanner(System.in);
		
		int H = sc.nextInt();
		int W = sc.nextInt();
		
		while(H != 0 || W != 0){
			while(0 < H){
				for(int i = 1; i <= W; i++){
					System.out.print("#");
				}
				System.out.println();
				H--;
			}
			System.out.println();
			H = sc.nextInt();
			W = sc.nextInt();
		}
		
	}

	public static void main(String[] args) {
		new Main().kami();
	}

} Main public void kami() {
		Scanner sc = new Scanner(System.in);
		
		int H = sc.nextInt();
		int W = sc.nextInt();
		
		while(H != 0 || W != 0){
			while(0 < H){
				for(int i = 1; i <= W; i++){
					System.out.print("#");
				}
				System.out.println();
				H--;
			}
			System.out.println();
			H = sc.nextInt();
			W = sc.nextInt();
		}
		
	} kami {
		Scanner sc = new Scanner(System.in);
		
		int H = sc.nextInt();
		int W = sc.nextInt();
		
		while(H != 0 || W != 0){
			while(0 < H){
				for(int i = 1; i <= W; i++){
					System.out.print("#");
				}
				System.out.println();
				H--;
			}
			System.out.println();
			H = sc.nextInt();
			W = sc.nextInt();
		}
		
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int H = sc.nextInt(); H sc.nextInt() sc.nextInt sc int W = sc.nextInt(); W sc.nextInt() sc.nextInt sc while(H != 0 || W != 0){
			while(0 < H){
				for(int i = 1; i <= W; i++){
					System.out.print("#");
				}
				System.out.println();
				H--;
			}
			System.out.println();
			H = sc.nextInt();
			W = sc.nextInt();
		} H != 0 || W != 0 H != 0 H 0 W != 0 W 0 {
			while(0 < H){
				for(int i = 1; i <= W; i++){
					System.out.print("#");
				}
				System.out.println();
				H--;
			}
			System.out.println();
			H = sc.nextInt();
			W = sc.nextInt();
		} while(0 < H){
				for(int i = 1; i <= W; i++){
					System.out.print("#");
				}
				System.out.println();
				H--;
			} 0 < H 0 H {
				for(int i = 1; i <= W; i++){
					System.out.print("#");
				}
				System.out.println();
				H--;
			} for(int i = 1; i <= W; i++){
					System.out.print("#");
				} int i = 1; int i = 1; i 1 i <= W i W i++ i++ i {
					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-- H 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().kami();
	} main {
		new Main().kami();
	} new Main().kami() new Main().kami new Main() String[] args args
import java.util.Scanner;
class Main {
	public void kami() {
		Scanner sc = new Scanner(System.in);
		
		int H = sc.nextInt();
		int W = sc.nextInt();
		
		while(H != 0 || W != 0){
			while(0 < H){
				for(int i = 1; i <= W; i++){
					System.out.print("#");
				}
				System.out.println();
				H--;
			}
			System.out.println();
			H = sc.nextInt();
			W = sc.nextInt();
		}
		
	}

	public static void main(String[] args) {
		new Main().kami();
	}

}