import java.io.*;

class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] array = br.readLine().split(" ");
        int H = Integer.parseInt(array[0]);
        int W = Integer.parseInt(array[1]);
		while(H!=0&&W!=0){
			for(int i=0;i<H;i++){
				for(int j=0;j<W;j++){
					System.out.print("#");
				}
				System.out.println("");
			}
			System.out.println("");
			array = br.readLine().split(" ");
	        H = Integer.parseInt(array[0]);
	        W = Integer.parseInt(array[1]);
		}
	}
} import java.io.*; io.* java class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] array = br.readLine().split(" ");
        int H = Integer.parseInt(array[0]);
        int W = Integer.parseInt(array[1]);
		while(H!=0&&W!=0){
			for(int i=0;i<H;i++){
				for(int j=0;j<W;j++){
					System.out.print("#");
				}
				System.out.println("");
			}
			System.out.println("");
			array = br.readLine().split(" ");
	        H = Integer.parseInt(array[0]);
	        W = Integer.parseInt(array[1]);
		}
	}
} Main public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] array = br.readLine().split(" ");
        int H = Integer.parseInt(array[0]);
        int W = Integer.parseInt(array[1]);
		while(H!=0&&W!=0){
			for(int i=0;i<H;i++){
				for(int j=0;j<W;j++){
					System.out.print("#");
				}
				System.out.println("");
			}
			System.out.println("");
			array = br.readLine().split(" ");
	        H = Integer.parseInt(array[0]);
	        W = Integer.parseInt(array[1]);
		}
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] array = br.readLine().split(" ");
        int H = Integer.parseInt(array[0]);
        int W = Integer.parseInt(array[1]);
		while(H!=0&&W!=0){
			for(int i=0;i<H;i++){
				for(int j=0;j<W;j++){
					System.out.print("#");
				}
				System.out.println("");
			}
			System.out.println("");
			array = br.readLine().split(" ");
	        H = Integer.parseInt(array[0]);
	        W = Integer.parseInt(array[1]);
		}
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String[] array = br.readLine().split(" "); array br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int H = Integer.parseInt(array[0]); H Integer.parseInt(array[0]) Integer.parseInt Integer array[0] array 0 int W = Integer.parseInt(array[1]); W Integer.parseInt(array[1]) Integer.parseInt Integer array[1] array 1 while(H!=0&&W!=0){
			for(int i=0;i<H;i++){
				for(int j=0;j<W;j++){
					System.out.print("#");
				}
				System.out.println("");
			}
			System.out.println("");
			array = br.readLine().split(" ");
	        H = Integer.parseInt(array[0]);
	        W = Integer.parseInt(array[1]);
		} H!=0&&W!=0 H!=0 H 0 W!=0 W 0 {
			for(int i=0;i<H;i++){
				for(int j=0;j<W;j++){
					System.out.print("#");
				}
				System.out.println("");
			}
			System.out.println("");
			array = br.readLine().split(" ");
	        H = Integer.parseInt(array[0]);
	        W = Integer.parseInt(array[1]);
		} for(int i=0;i<H;i++){
				for(int j=0;j<W;j++){
					System.out.print("#");
				}
				System.out.println("");
			} int i=0; int i=0; i 0 i<H i H i++ i++ i {
				for(int j=0;j<W;j++){
					System.out.print("#");
				}
				System.out.println("");
			} {
				for(int j=0;j<W;j++){
					System.out.print("#");
				}
				System.out.println("");
			} for(int j=0;j<W;j++){
					System.out.print("#");
				} int j=0; int j=0; j 0 j<W j W j++ j++ j {
					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 "" System.out.println("") System.out.println System.out System System.out "" array = br.readLine().split(" ") array br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " H = Integer.parseInt(array[0]) H Integer.parseInt(array[0]) Integer.parseInt Integer array[0] array 0 W = Integer.parseInt(array[1]) W Integer.parseInt(array[1]) Integer.parseInt Integer array[1] array 1 String[] args args
import java.io.*;

class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] array = br.readLine().split(" ");
        int H = Integer.parseInt(array[0]);
        int W = Integer.parseInt(array[1]);
		while(H!=0&&W!=0){
			for(int i=0;i<H;i++){
				for(int j=0;j<W;j++){
					System.out.print("#");
				}
				System.out.println("");
			}
			System.out.println("");
			array = br.readLine().split(" ");
	        H = Integer.parseInt(array[0]);
	        W = Integer.parseInt(array[1]);
		}
	}
}