import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;


public class Main {

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		List <Integer> H = new ArrayList <Integer> ();
		List <Integer> W = new ArrayList <Integer> ();
		
		int lastH = 0;
		int lastW = 0;
		do {
			lastH = stdIn.nextInt();
			lastW = stdIn.nextInt();
			
			H.add(lastH);
			W.add(lastW);
		} while (lastH != 0 || lastW != 0);
		
		for(int i = 0; i < H.size()-1; i++) {
			for(int j = 0; j < H.get(i); j++) {
				for(int k = 0; k < W.get(i); k++) {
					System.out.print("#");
				}
				System.out.println();
			}
			System.out.println();
		}
	}

} import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		List <Integer> H = new ArrayList <Integer> ();
		List <Integer> W = new ArrayList <Integer> ();
		
		int lastH = 0;
		int lastW = 0;
		do {
			lastH = stdIn.nextInt();
			lastW = stdIn.nextInt();
			
			H.add(lastH);
			W.add(lastW);
		} while (lastH != 0 || lastW != 0);
		
		for(int i = 0; i < H.size()-1; i++) {
			for(int j = 0; j < H.get(i); j++) {
				for(int k = 0; k < W.get(i); k++) {
					System.out.print("#");
				}
				System.out.println();
			}
			System.out.println();
		}
	}

} Main public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		List <Integer> H = new ArrayList <Integer> ();
		List <Integer> W = new ArrayList <Integer> ();
		
		int lastH = 0;
		int lastW = 0;
		do {
			lastH = stdIn.nextInt();
			lastW = stdIn.nextInt();
			
			H.add(lastH);
			W.add(lastW);
		} while (lastH != 0 || lastW != 0);
		
		for(int i = 0; i < H.size()-1; i++) {
			for(int j = 0; j < H.get(i); j++) {
				for(int k = 0; k < W.get(i); k++) {
					System.out.print("#");
				}
				System.out.println();
			}
			System.out.println();
		}
	} main {
		Scanner stdIn = new Scanner(System.in);
		List <Integer> H = new ArrayList <Integer> ();
		List <Integer> W = new ArrayList <Integer> ();
		
		int lastH = 0;
		int lastW = 0;
		do {
			lastH = stdIn.nextInt();
			lastW = stdIn.nextInt();
			
			H.add(lastH);
			W.add(lastW);
		} while (lastH != 0 || lastW != 0);
		
		for(int i = 0; i < H.size()-1; i++) {
			for(int j = 0; j < H.get(i); j++) {
				for(int k = 0; k < W.get(i); k++) {
					System.out.print("#");
				}
				System.out.println();
			}
			System.out.println();
		}
	} Scanner stdIn = new Scanner(System.in); stdIn new Scanner(System.in) List <Integer> H = new ArrayList <Integer> (); H new ArrayList <Integer> () List <Integer> W = new ArrayList <Integer> (); W new ArrayList <Integer> () int lastH = 0; lastH 0 int lastW = 0; lastW 0 do {
			lastH = stdIn.nextInt();
			lastW = stdIn.nextInt();
			
			H.add(lastH);
			W.add(lastW);
		} while (lastH != 0 || lastW != 0); lastH != 0 || lastW != 0 lastH != 0 lastH 0 lastW != 0 lastW 0 {
			lastH = stdIn.nextInt();
			lastW = stdIn.nextInt();
			
			H.add(lastH);
			W.add(lastW);
		} lastH = stdIn.nextInt() lastH stdIn.nextInt() stdIn.nextInt stdIn lastW = stdIn.nextInt() lastW stdIn.nextInt() stdIn.nextInt stdIn H.add(lastH) H.add H lastH W.add(lastW) W.add W lastW for(int i = 0; i < H.size()-1; i++) {
			for(int j = 0; j < H.get(i); j++) {
				for(int k = 0; k < W.get(i); k++) {
					System.out.print("#");
				}
				System.out.println();
			}
			System.out.println();
		} int i = 0; int i = 0; i 0 i < H.size()-1 i H.size()-1 H.size() H.size H 1 i++ i++ i {
			for(int j = 0; j < H.get(i); j++) {
				for(int k = 0; k < W.get(i); k++) {
					System.out.print("#");
				}
				System.out.println();
			}
			System.out.println();
		} {
			for(int j = 0; j < H.get(i); j++) {
				for(int k = 0; k < W.get(i); k++) {
					System.out.print("#");
				}
				System.out.println();
			}
			System.out.println();
		} for(int j = 0; j < H.get(i); j++) {
				for(int k = 0; k < W.get(i); k++) {
					System.out.print("#");
				}
				System.out.println();
			} int j = 0; int j = 0; j 0 j < H.get(i) j H.get(i) H.get H i j++ j++ j {
				for(int k = 0; k < W.get(i); k++) {
					System.out.print("#");
				}
				System.out.println();
			} {
				for(int k = 0; k < W.get(i); k++) {
					System.out.print("#");
				}
				System.out.println();
			} for(int k = 0; k < W.get(i); k++) {
					System.out.print("#");
				} int k = 0; int k = 0; k 0 k < W.get(i) k W.get(i) W.get W i k++ k++ k {
					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 String[] args args public class Main {

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		List <Integer> H = new ArrayList <Integer> ();
		List <Integer> W = new ArrayList <Integer> ();
		
		int lastH = 0;
		int lastW = 0;
		do {
			lastH = stdIn.nextInt();
			lastW = stdIn.nextInt();
			
			H.add(lastH);
			W.add(lastW);
		} while (lastH != 0 || lastW != 0);
		
		for(int i = 0; i < H.size()-1; i++) {
			for(int j = 0; j < H.get(i); j++) {
				for(int k = 0; k < W.get(i); k++) {
					System.out.print("#");
				}
				System.out.println();
			}
			System.out.println();
		}
	}

} public class Main {

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		List <Integer> H = new ArrayList <Integer> ();
		List <Integer> W = new ArrayList <Integer> ();
		
		int lastH = 0;
		int lastW = 0;
		do {
			lastH = stdIn.nextInt();
			lastW = stdIn.nextInt();
			
			H.add(lastH);
			W.add(lastW);
		} while (lastH != 0 || lastW != 0);
		
		for(int i = 0; i < H.size()-1; i++) {
			for(int j = 0; j < H.get(i); j++) {
				for(int k = 0; k < W.get(i); k++) {
					System.out.print("#");
				}
				System.out.println();
			}
			System.out.println();
		}
	}

} Main
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;


public class Main {

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		List <Integer> H = new ArrayList <Integer> ();
		List <Integer> W = new ArrayList <Integer> ();
		
		int lastH = 0;
		int lastW = 0;
		do {
			lastH = stdIn.nextInt();
			lastW = stdIn.nextInt();
			
			H.add(lastH);
			W.add(lastW);
		} while (lastH != 0 || lastW != 0);
		
		for(int i = 0; i < H.size()-1; i++) {
			for(int j = 0; j < H.get(i); j++) {
				for(int k = 0; k < W.get(i); k++) {
					System.out.print("#");
				}
				System.out.println();
			}
			System.out.println();
		}
	}

}