import java.util.Scanner;

public class Main {


    public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		
		int hei, wid;
		
		while(true){
			hei = scan.nextInt();//??????????????????
			wid = scan.nextInt();//?¨????????????????
			if(hei == 0 && wid == 0){//???????????????0???0????????\???????????????????????????
				break;
			}
			for(int cnt_hei = 0; cnt_hei < hei; cnt_hei++){//???#????????????
				for(int cnt_wid = 0; cnt_wid < wid; cnt_wid++){
					System.out.print("#");
				}
				System.out.println();
			}
			System.out.println();
		}
        scan.close();
    }

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


    public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		
		int hei, wid;
		
		while(true){
			hei = scan.nextInt();//??????????????????
			wid = scan.nextInt();//?¨????????????????
			if(hei == 0 && wid == 0){//???????????????0???0????????\???????????????????????????
				break;
			}
			for(int cnt_hei = 0; cnt_hei < hei; cnt_hei++){//???#????????????
				for(int cnt_wid = 0; cnt_wid < wid; cnt_wid++){
					System.out.print("#");
				}
				System.out.println();
			}
			System.out.println();
		}
        scan.close();
    }

} Main public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		
		int hei, wid;
		
		while(true){
			hei = scan.nextInt();//??????????????????
			wid = scan.nextInt();//?¨????????????????
			if(hei == 0 && wid == 0){//???????????????0???0????????\???????????????????????????
				break;
			}
			for(int cnt_hei = 0; cnt_hei < hei; cnt_hei++){//???#????????????
				for(int cnt_wid = 0; cnt_wid < wid; cnt_wid++){
					System.out.print("#");
				}
				System.out.println();
			}
			System.out.println();
		}
        scan.close();
    } main {
		Scanner scan = new Scanner(System.in);
		
		int hei, wid;
		
		while(true){
			hei = scan.nextInt();//??????????????????
			wid = scan.nextInt();//?¨????????????????
			if(hei == 0 && wid == 0){//???????????????0???0????????\???????????????????????????
				break;
			}
			for(int cnt_hei = 0; cnt_hei < hei; cnt_hei++){//???#????????????
				for(int cnt_wid = 0; cnt_wid < wid; cnt_wid++){
					System.out.print("#");
				}
				System.out.println();
			}
			System.out.println();
		}
        scan.close();
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int hei hei wid; wid while(true){
			hei = scan.nextInt();//??????????????????
			wid = scan.nextInt();//?¨????????????????
			if(hei == 0 && wid == 0){//???????????????0???0????????\???????????????????????????
				break;
			}
			for(int cnt_hei = 0; cnt_hei < hei; cnt_hei++){//???#????????????
				for(int cnt_wid = 0; cnt_wid < wid; cnt_wid++){
					System.out.print("#");
				}
				System.out.println();
			}
			System.out.println();
		} true {
			hei = scan.nextInt();//??????????????????
			wid = scan.nextInt();//?¨????????????????
			if(hei == 0 && wid == 0){//???????????????0???0????????\???????????????????????????
				break;
			}
			for(int cnt_hei = 0; cnt_hei < hei; cnt_hei++){//???#????????????
				for(int cnt_wid = 0; cnt_wid < wid; cnt_wid++){
					System.out.print("#");
				}
				System.out.println();
			}
			System.out.println();
		} hei = scan.nextInt() hei scan.nextInt() scan.nextInt scan wid = scan.nextInt() wid scan.nextInt() scan.nextInt scan if(hei == 0 && wid == 0){//???????????????0???0????????\???????????????????????????
				break;
			} hei == 0 && wid == 0 hei == 0 hei 0 wid == 0 wid 0 {//???????????????0???0????????\???????????????????????????
				break;
			} break; for(int cnt_hei = 0; cnt_hei < hei; cnt_hei++){//???#????????????
				for(int cnt_wid = 0; cnt_wid < wid; cnt_wid++){
					System.out.print("#");
				}
				System.out.println();
			} int cnt_hei = 0; int cnt_hei = 0; cnt_hei 0 cnt_hei < hei cnt_hei hei cnt_hei++ cnt_hei++ cnt_hei {//???#????????????
				for(int cnt_wid = 0; cnt_wid < wid; cnt_wid++){
					System.out.print("#");
				}
				System.out.println();
			} {//???#????????????
				for(int cnt_wid = 0; cnt_wid < wid; cnt_wid++){
					System.out.print("#");
				}
				System.out.println();
			} for(int cnt_wid = 0; cnt_wid < wid; cnt_wid++){
					System.out.print("#");
				} int cnt_wid = 0; int cnt_wid = 0; cnt_wid 0 cnt_wid < wid cnt_wid wid cnt_wid++ cnt_wid++ cnt_wid {
					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 scan.close() scan.close scan String[] args args public class Main {


    public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		
		int hei, wid;
		
		while(true){
			hei = scan.nextInt();//??????????????????
			wid = scan.nextInt();//?¨????????????????
			if(hei == 0 && wid == 0){//???????????????0???0????????\???????????????????????????
				break;
			}
			for(int cnt_hei = 0; cnt_hei < hei; cnt_hei++){//???#????????????
				for(int cnt_wid = 0; cnt_wid < wid; cnt_wid++){
					System.out.print("#");
				}
				System.out.println();
			}
			System.out.println();
		}
        scan.close();
    }

} public class Main {


    public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		
		int hei, wid;
		
		while(true){
			hei = scan.nextInt();//??????????????????
			wid = scan.nextInt();//?¨????????????????
			if(hei == 0 && wid == 0){//???????????????0???0????????\???????????????????????????
				break;
			}
			for(int cnt_hei = 0; cnt_hei < hei; cnt_hei++){//???#????????????
				for(int cnt_wid = 0; cnt_wid < wid; cnt_wid++){
					System.out.print("#");
				}
				System.out.println();
			}
			System.out.println();
		}
        scan.close();
    }

} Main
import java.util.Scanner;

public class Main {


    public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		
		int hei, wid;
		
		while(true){
			hei = scan.nextInt();//??????????????????
			wid = scan.nextInt();//?¨????????????????
			if(hei == 0 && wid == 0){//???????????????0???0????????\???????????????????????????
				break;
			}
			for(int cnt_hei = 0; cnt_hei < hei; cnt_hei++){//???#????????????
				for(int cnt_wid = 0; cnt_wid < wid; cnt_wid++){
					System.out.print("#");
				}
				System.out.println();
			}
			System.out.println();
		}
        scan.close();
    }

}