import java.util.Scanner;

public class Main {
    
    public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);            
        
        for(int i = 0; i < 3000; i ++) {
            int H = sc.nextInt();
            int W = sc.nextInt();
            
            if(printJudge(H,W)) {
                for(int height = 0; height < H ; height++) {
                    printRect(W);
                }                
            }else {
                break;
            }
            System.out.print("\n");
        }
    }    

    public static void printRect(int W) {        
	for(int i = 0; i < W; i++) {
		System.out.print("#");                
	}
        System.out.print("\n");    
    }
    
    public static boolean printJudge(int H, int W) {
        if((H == 0 && W == 0) || H < 0 || H > 300 || W < 0 || W > 300) {
            return false;
        }else {
            return true;
        }
    }
    
} import java.util.Scanner; Scanner java.util public class Main {
    
    public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);            
        
        for(int i = 0; i < 3000; i ++) {
            int H = sc.nextInt();
            int W = sc.nextInt();
            
            if(printJudge(H,W)) {
                for(int height = 0; height < H ; height++) {
                    printRect(W);
                }                
            }else {
                break;
            }
            System.out.print("\n");
        }
    }    

    public static void printRect(int W) {        
	for(int i = 0; i < W; i++) {
		System.out.print("#");                
	}
        System.out.print("\n");    
    }
    
    public static boolean printJudge(int H, int W) {
        if((H == 0 && W == 0) || H < 0 || H > 300 || W < 0 || W > 300) {
            return false;
        }else {
            return true;
        }
    }
    
} Main public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);            
        
        for(int i = 0; i < 3000; i ++) {
            int H = sc.nextInt();
            int W = sc.nextInt();
            
            if(printJudge(H,W)) {
                for(int height = 0; height < H ; height++) {
                    printRect(W);
                }                
            }else {
                break;
            }
            System.out.print("\n");
        }
    } main {
        
        Scanner sc = new Scanner(System.in);            
        
        for(int i = 0; i < 3000; i ++) {
            int H = sc.nextInt();
            int W = sc.nextInt();
            
            if(printJudge(H,W)) {
                for(int height = 0; height < H ; height++) {
                    printRect(W);
                }                
            }else {
                break;
            }
            System.out.print("\n");
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) for(int i = 0; i < 3000; i ++) {
            int H = sc.nextInt();
            int W = sc.nextInt();
            
            if(printJudge(H,W)) {
                for(int height = 0; height < H ; height++) {
                    printRect(W);
                }                
            }else {
                break;
            }
            System.out.print("\n");
        } int i = 0; int i = 0; i 0 i < 3000 i 3000 i ++ i ++ i {
            int H = sc.nextInt();
            int W = sc.nextInt();
            
            if(printJudge(H,W)) {
                for(int height = 0; height < H ; height++) {
                    printRect(W);
                }                
            }else {
                break;
            }
            System.out.print("\n");
        } {
            int H = sc.nextInt();
            int W = sc.nextInt();
            
            if(printJudge(H,W)) {
                for(int height = 0; height < H ; height++) {
                    printRect(W);
                }                
            }else {
                break;
            }
            System.out.print("\n");
        } int H = sc.nextInt(); H sc.nextInt() sc.nextInt sc int W = sc.nextInt(); W sc.nextInt() sc.nextInt sc if(printJudge(H,W)) {
                for(int height = 0; height < H ; height++) {
                    printRect(W);
                }                
            }else {
                break;
            } printJudge(H,W) printJudge H W {
                for(int height = 0; height < H ; height++) {
                    printRect(W);
                }                
            } for(int height = 0; height < H ; height++) {
                    printRect(W);
                } int height = 0; int height = 0; height 0 height < H height H height++ height++ height {
                    printRect(W);
                } {
                    printRect(W);
                } printRect(W) printRect W {
                break;
            } break; System.out.print("\n") System.out.print System.out System System.out "\n" String[] args args public static void printRect(int W) {        
	for(int i = 0; i < W; i++) {
		System.out.print("#");                
	}
        System.out.print("\n");    
    } printRect {        
	for(int i = 0; i < W; i++) {
		System.out.print("#");                
	}
        System.out.print("\n");    
    } for(int i = 0; i < W; i++) {
		System.out.print("#");                
	} int i = 0; int i = 0; i 0 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.print("\n") System.out.print System.out System System.out "\n" int W W public static boolean printJudge(int H, int W) {
        if((H == 0 && W == 0) || H < 0 || H > 300 || W < 0 || W > 300) {
            return false;
        }else {
            return true;
        }
    } printJudge {
        if((H == 0 && W == 0) || H < 0 || H > 300 || W < 0 || W > 300) {
            return false;
        }else {
            return true;
        }
    } if((H == 0 && W == 0) || H < 0 || H > 300 || W < 0 || W > 300) {
            return false;
        }else {
            return true;
        } (H == 0 && W == 0) || H < 0 || H > 300 || W < 0 || W > 300 W < 0 H > 300 (H == 0 && W == 0) || H < 0 || H > 300 || W < 0 || W > 300 (H == 0 && W == 0) H == 0 H 0 W == 0 W 0 H < 0 H 0 H > 300 H 300 W < 0 W 0 W > 300 W 300 {
            return false;
        } return false; false {
            return true;
        } return true; true int H H int W W public class Main {
    
    public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);            
        
        for(int i = 0; i < 3000; i ++) {
            int H = sc.nextInt();
            int W = sc.nextInt();
            
            if(printJudge(H,W)) {
                for(int height = 0; height < H ; height++) {
                    printRect(W);
                }                
            }else {
                break;
            }
            System.out.print("\n");
        }
    }    

    public static void printRect(int W) {        
	for(int i = 0; i < W; i++) {
		System.out.print("#");                
	}
        System.out.print("\n");    
    }
    
    public static boolean printJudge(int H, int W) {
        if((H == 0 && W == 0) || H < 0 || H > 300 || W < 0 || W > 300) {
            return false;
        }else {
            return true;
        }
    }
    
} public class Main {
    
    public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);            
        
        for(int i = 0; i < 3000; i ++) {
            int H = sc.nextInt();
            int W = sc.nextInt();
            
            if(printJudge(H,W)) {
                for(int height = 0; height < H ; height++) {
                    printRect(W);
                }                
            }else {
                break;
            }
            System.out.print("\n");
        }
    }    

    public static void printRect(int W) {        
	for(int i = 0; i < W; i++) {
		System.out.print("#");                
	}
        System.out.print("\n");    
    }
    
    public static boolean printJudge(int H, int W) {
        if((H == 0 && W == 0) || H < 0 || H > 300 || W < 0 || W > 300) {
            return false;
        }else {
            return true;
        }
    }
    
} Main
import java.util.Scanner;

public class Main {
    
    public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);            
        
        for(int i = 0; i < 3000; i ++) {
            int H = sc.nextInt();
            int W = sc.nextInt();
            
            if(printJudge(H,W)) {
                for(int height = 0; height < H ; height++) {
                    printRect(W);
                }                
            }else {
                break;
            }
            System.out.print("\n");
        }
    }    

    public static void printRect(int W) {        
	for(int i = 0; i < W; i++) {
		System.out.print("#");                
	}
        System.out.print("\n");    
    }
    
    public static boolean printJudge(int H, int W) {
        if((H == 0 && W == 0) || H < 0 || H > 300 || W < 0 || W > 300) {
            return false;
        }else {
            return true;
        }
    }
    
}