import java.util.Scanner;
class Main{
    int H,W,i,r;
    boolean x = true;
    public void solve(){
        Scanner sc = new Scanner(System.in);
        H = sc.nextInt();
        W = sc.nextInt();
        if(H == 0 && W == 0){
            x = false;
        }
        while(x == true){
            for(i = 0; i < H; i++){
                for(r = 0; r < W; r++){
                    System.out.print("#");
                }
                System.out.println();
            }
            System.out.println();
            H = sc.nextInt();
            W = sc.nextInt();
            if(H == 0 && W == 0){
                x = false;
            }
        }
    }
    public static void main(String[] args){
        new Main().solve();
    }
} import java.util.Scanner; Scanner java.util class Main{
    int H,W,i,r;
    boolean x = true;
    public void solve(){
        Scanner sc = new Scanner(System.in);
        H = sc.nextInt();
        W = sc.nextInt();
        if(H == 0 && W == 0){
            x = false;
        }
        while(x == true){
            for(i = 0; i < H; i++){
                for(r = 0; r < W; r++){
                    System.out.print("#");
                }
                System.out.println();
            }
            System.out.println();
            H = sc.nextInt();
            W = sc.nextInt();
            if(H == 0 && W == 0){
                x = false;
            }
        }
    }
    public static void main(String[] args){
        new Main().solve();
    }
} Main int H H W W i i r; r boolean x = true; x true public void solve(){
        Scanner sc = new Scanner(System.in);
        H = sc.nextInt();
        W = sc.nextInt();
        if(H == 0 && W == 0){
            x = false;
        }
        while(x == true){
            for(i = 0; i < H; i++){
                for(r = 0; r < W; r++){
                    System.out.print("#");
                }
                System.out.println();
            }
            System.out.println();
            H = sc.nextInt();
            W = sc.nextInt();
            if(H == 0 && W == 0){
                x = false;
            }
        }
    } solve {
        Scanner sc = new Scanner(System.in);
        H = sc.nextInt();
        W = sc.nextInt();
        if(H == 0 && W == 0){
            x = false;
        }
        while(x == true){
            for(i = 0; i < H; i++){
                for(r = 0; r < W; r++){
                    System.out.print("#");
                }
                System.out.println();
            }
            System.out.println();
            H = sc.nextInt();
            W = sc.nextInt();
            if(H == 0 && W == 0){
                x = false;
            }
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) H = sc.nextInt() H sc.nextInt() sc.nextInt sc W = sc.nextInt() W sc.nextInt() sc.nextInt sc if(H == 0 && W == 0){
            x = false;
        } H == 0 && W == 0 H == 0 H 0 W == 0 W 0 {
            x = false;
        } x = false x false while(x == true){
            for(i = 0; i < H; i++){
                for(r = 0; r < W; r++){
                    System.out.print("#");
                }
                System.out.println();
            }
            System.out.println();
            H = sc.nextInt();
            W = sc.nextInt();
            if(H == 0 && W == 0){
                x = false;
            }
        } x == true x true {
            for(i = 0; i < H; i++){
                for(r = 0; r < W; r++){
                    System.out.print("#");
                }
                System.out.println();
            }
            System.out.println();
            H = sc.nextInt();
            W = sc.nextInt();
            if(H == 0 && W == 0){
                x = false;
            }
        } for(i = 0; i < H; i++){
                for(r = 0; r < W; r++){
                    System.out.print("#");
                }
                System.out.println();
            } i = 0; i = 0 i 0 i < H i H i++ i++ i {
                for(r = 0; r < W; r++){
                    System.out.print("#");
                }
                System.out.println();
            } {
                for(r = 0; r < W; r++){
                    System.out.print("#");
                }
                System.out.println();
            } for(r = 0; r < W; r++){
                    System.out.print("#");
                } r = 0; r = 0 r 0 r < W r W r++ r++ r {
                    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 H = sc.nextInt() H sc.nextInt() sc.nextInt sc W = sc.nextInt() W sc.nextInt() sc.nextInt sc if(H == 0 && W == 0){
                x = false;
            } H == 0 && W == 0 H == 0 H 0 W == 0 W 0 {
                x = false;
            } x = false x false public static void main(String[] args){
        new Main().solve();
    } main {
        new Main().solve();
    } new Main().solve() new Main().solve new Main() String[] args args
import java.util.Scanner;
class Main{
    int H,W,i,r;
    boolean x = true;
    public void solve(){
        Scanner sc = new Scanner(System.in);
        H = sc.nextInt();
        W = sc.nextInt();
        if(H == 0 && W == 0){
            x = false;
        }
        while(x == true){
            for(i = 0; i < H; i++){
                for(r = 0; r < W; r++){
                    System.out.print("#");
                }
                System.out.println();
            }
            System.out.println();
            H = sc.nextInt();
            W = sc.nextInt();
            if(H == 0 && W == 0){
                x = false;
            }
        }
    }
    public static void main(String[] args){
        new Main().solve();
    }
}