import java.io.BufferedReader;
import java.io.InputStreamReader;


public class Main {

	public static void main(String[] args) throws Exception {
		// TODO ?????????????????????????????????????????????
		BufferedReader breader = getReader();

		int[] ary = getAry(breader);
		while( ary[0] != 0 || ary[1] !=0 ) {
			for( int i = 0 ;  i < ary[0] ; i++ ) {
				for( int j = 0 ; j < ary[1] ; j++ ) {
					System.out.print("#");
				}
				System.out.println("");
			}
			System.out.println("");
			ary = getAry(breader);
		}
	}
	public static BufferedReader getReader() {
		return( new BufferedReader(new InputStreamReader(System.in)));
	}
	public static int[] getAry(BufferedReader br)throws Exception {
		String line = br.readLine();
		String[] nstr = line.split(" ");
		int[] n = new int[nstr.length];
		for( int i=0 ; i < nstr.length ; i++ ) {
			n[i] = Integer.valueOf(nstr[i]);
		}
		return n;
	}

} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {

	public static void main(String[] args) throws Exception {
		// TODO ?????????????????????????????????????????????
		BufferedReader breader = getReader();

		int[] ary = getAry(breader);
		while( ary[0] != 0 || ary[1] !=0 ) {
			for( int i = 0 ;  i < ary[0] ; i++ ) {
				for( int j = 0 ; j < ary[1] ; j++ ) {
					System.out.print("#");
				}
				System.out.println("");
			}
			System.out.println("");
			ary = getAry(breader);
		}
	}
	public static BufferedReader getReader() {
		return( new BufferedReader(new InputStreamReader(System.in)));
	}
	public static int[] getAry(BufferedReader br)throws Exception {
		String line = br.readLine();
		String[] nstr = line.split(" ");
		int[] n = new int[nstr.length];
		for( int i=0 ; i < nstr.length ; i++ ) {
			n[i] = Integer.valueOf(nstr[i]);
		}
		return n;
	}

} Main public static void main(String[] args) throws Exception {
		// TODO ?????????????????????????????????????????????
		BufferedReader breader = getReader();

		int[] ary = getAry(breader);
		while( ary[0] != 0 || ary[1] !=0 ) {
			for( int i = 0 ;  i < ary[0] ; i++ ) {
				for( int j = 0 ; j < ary[1] ; j++ ) {
					System.out.print("#");
				}
				System.out.println("");
			}
			System.out.println("");
			ary = getAry(breader);
		}
	} main {
		// TODO ?????????????????????????????????????????????
		BufferedReader breader = getReader();

		int[] ary = getAry(breader);
		while( ary[0] != 0 || ary[1] !=0 ) {
			for( int i = 0 ;  i < ary[0] ; i++ ) {
				for( int j = 0 ; j < ary[1] ; j++ ) {
					System.out.print("#");
				}
				System.out.println("");
			}
			System.out.println("");
			ary = getAry(breader);
		}
	} BufferedReader breader = getReader(); breader getReader() getReader int[] ary = getAry(breader); ary getAry(breader) getAry breader while( ary[0] != 0 || ary[1] !=0 ) {
			for( int i = 0 ;  i < ary[0] ; i++ ) {
				for( int j = 0 ; j < ary[1] ; j++ ) {
					System.out.print("#");
				}
				System.out.println("");
			}
			System.out.println("");
			ary = getAry(breader);
		} ary[0] != 0 || ary[1] !=0 ary[0] != 0 ary[0] ary 0 0 ary[1] !=0 ary[1] ary 1 0 {
			for( int i = 0 ;  i < ary[0] ; i++ ) {
				for( int j = 0 ; j < ary[1] ; j++ ) {
					System.out.print("#");
				}
				System.out.println("");
			}
			System.out.println("");
			ary = getAry(breader);
		} for( int i = 0 ;  i < ary[0] ; i++ ) {
				for( int j = 0 ; j < ary[1] ; j++ ) {
					System.out.print("#");
				}
				System.out.println("");
			} int i = 0 ; int i = 0 ; i 0 i < ary[0] i ary[0] ary 0 i++ i++ i {
				for( int j = 0 ; j < ary[1] ; j++ ) {
					System.out.print("#");
				}
				System.out.println("");
			} {
				for( int j = 0 ; j < ary[1] ; j++ ) {
					System.out.print("#");
				}
				System.out.println("");
			} for( int j = 0 ; j < ary[1] ; j++ ) {
					System.out.print("#");
				} int j = 0 ; int j = 0 ; j 0 j < ary[1] j ary[1] ary 1 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 "" ary = getAry(breader) ary getAry(breader) getAry breader String[] args args public static BufferedReader getReader() {
		return( new BufferedReader(new InputStreamReader(System.in)));
	} getReader {
		return( new BufferedReader(new InputStreamReader(System.in)));
	} return( new BufferedReader(new InputStreamReader(System.in))); ( new BufferedReader(new InputStreamReader(System.in))) public static int[] getAry(BufferedReader br)throws Exception {
		String line = br.readLine();
		String[] nstr = line.split(" ");
		int[] n = new int[nstr.length];
		for( int i=0 ; i < nstr.length ; i++ ) {
			n[i] = Integer.valueOf(nstr[i]);
		}
		return n;
	} getAry {
		String line = br.readLine();
		String[] nstr = line.split(" ");
		int[] n = new int[nstr.length];
		for( int i=0 ; i < nstr.length ; i++ ) {
			n[i] = Integer.valueOf(nstr[i]);
		}
		return n;
	} String line = br.readLine(); line br.readLine() br.readLine br String[] nstr = line.split(" "); nstr line.split(" ") line.split line " " int[] n = new int[nstr.length]; n new int[nstr.length] nstr.length nstr nstr.length for( int i=0 ; i < nstr.length ; i++ ) {
			n[i] = Integer.valueOf(nstr[i]);
		} int i=0 ; int i=0 ; i 0 i < nstr.length i nstr.length nstr nstr.length i++ i++ i {
			n[i] = Integer.valueOf(nstr[i]);
		} {
			n[i] = Integer.valueOf(nstr[i]);
		} n[i] = Integer.valueOf(nstr[i]) n[i] n i Integer.valueOf(nstr[i]) Integer.valueOf Integer nstr[i] nstr i return n; n BufferedReader br br public class Main {

	public static void main(String[] args) throws Exception {
		// TODO ?????????????????????????????????????????????
		BufferedReader breader = getReader();

		int[] ary = getAry(breader);
		while( ary[0] != 0 || ary[1] !=0 ) {
			for( int i = 0 ;  i < ary[0] ; i++ ) {
				for( int j = 0 ; j < ary[1] ; j++ ) {
					System.out.print("#");
				}
				System.out.println("");
			}
			System.out.println("");
			ary = getAry(breader);
		}
	}
	public static BufferedReader getReader() {
		return( new BufferedReader(new InputStreamReader(System.in)));
	}
	public static int[] getAry(BufferedReader br)throws Exception {
		String line = br.readLine();
		String[] nstr = line.split(" ");
		int[] n = new int[nstr.length];
		for( int i=0 ; i < nstr.length ; i++ ) {
			n[i] = Integer.valueOf(nstr[i]);
		}
		return n;
	}

} public class Main {

	public static void main(String[] args) throws Exception {
		// TODO ?????????????????????????????????????????????
		BufferedReader breader = getReader();

		int[] ary = getAry(breader);
		while( ary[0] != 0 || ary[1] !=0 ) {
			for( int i = 0 ;  i < ary[0] ; i++ ) {
				for( int j = 0 ; j < ary[1] ; j++ ) {
					System.out.print("#");
				}
				System.out.println("");
			}
			System.out.println("");
			ary = getAry(breader);
		}
	}
	public static BufferedReader getReader() {
		return( new BufferedReader(new InputStreamReader(System.in)));
	}
	public static int[] getAry(BufferedReader br)throws Exception {
		String line = br.readLine();
		String[] nstr = line.split(" ");
		int[] n = new int[nstr.length];
		for( int i=0 ; i < nstr.length ; i++ ) {
			n[i] = Integer.valueOf(nstr[i]);
		}
		return n;
	}

} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;


public class Main {

	public static void main(String[] args) throws Exception {
		// TODO ?????????????????????????????????????????????
		BufferedReader breader = getReader();

		int[] ary = getAry(breader);
		while( ary[0] != 0 || ary[1] !=0 ) {
			for( int i = 0 ;  i < ary[0] ; i++ ) {
				for( int j = 0 ; j < ary[1] ; j++ ) {
					System.out.print("#");
				}
				System.out.println("");
			}
			System.out.println("");
			ary = getAry(breader);
		}
	}
	public static BufferedReader getReader() {
		return( new BufferedReader(new InputStreamReader(System.in)));
	}
	public static int[] getAry(BufferedReader br)throws Exception {
		String line = br.readLine();
		String[] nstr = line.split(" ");
		int[] n = new int[nstr.length];
		for( int i=0 ; i < nstr.length ; i++ ) {
			n[i] = Integer.valueOf(nstr[i]);
		}
		return n;
	}

}