import java.util.Scanner;
class Main{
public void yatary(){
    Scanner sc = new Scanner(System.in);
    int x,y,a,b;
    x = sc.nextInt();
    y = sc.nextInt();
    while(x!=0 || y!=0){
        for(a = 1; a <= x; a++){
            for(b = 1; b <= y; b++){
            System.out.print("#");
                if(b == y){
                    System.out.println();
                }
            }
        }
    System.out.println();
    x = sc.nextInt();
    y = sc.nextInt();
    }
}
public static void main(String[]args){
   new Main().yatary();
  }
} import java.util.Scanner; Scanner java.util class Main{
public void yatary(){
    Scanner sc = new Scanner(System.in);
    int x,y,a,b;
    x = sc.nextInt();
    y = sc.nextInt();
    while(x!=0 || y!=0){
        for(a = 1; a <= x; a++){
            for(b = 1; b <= y; b++){
            System.out.print("#");
                if(b == y){
                    System.out.println();
                }
            }
        }
    System.out.println();
    x = sc.nextInt();
    y = sc.nextInt();
    }
}
public static void main(String[]args){
   new Main().yatary();
  }
} Main public void yatary(){
    Scanner sc = new Scanner(System.in);
    int x,y,a,b;
    x = sc.nextInt();
    y = sc.nextInt();
    while(x!=0 || y!=0){
        for(a = 1; a <= x; a++){
            for(b = 1; b <= y; b++){
            System.out.print("#");
                if(b == y){
                    System.out.println();
                }
            }
        }
    System.out.println();
    x = sc.nextInt();
    y = sc.nextInt();
    }
} yatary {
    Scanner sc = new Scanner(System.in);
    int x,y,a,b;
    x = sc.nextInt();
    y = sc.nextInt();
    while(x!=0 || y!=0){
        for(a = 1; a <= x; a++){
            for(b = 1; b <= y; b++){
            System.out.print("#");
                if(b == y){
                    System.out.println();
                }
            }
        }
    System.out.println();
    x = sc.nextInt();
    y = sc.nextInt();
    }
} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int x x y y a a b; b x = sc.nextInt() x sc.nextInt() sc.nextInt sc y = sc.nextInt() y sc.nextInt() sc.nextInt sc while(x!=0 || y!=0){
        for(a = 1; a <= x; a++){
            for(b = 1; b <= y; b++){
            System.out.print("#");
                if(b == y){
                    System.out.println();
                }
            }
        }
    System.out.println();
    x = sc.nextInt();
    y = sc.nextInt();
    } x!=0 || y!=0 x!=0 x 0 y!=0 y 0 {
        for(a = 1; a <= x; a++){
            for(b = 1; b <= y; b++){
            System.out.print("#");
                if(b == y){
                    System.out.println();
                }
            }
        }
    System.out.println();
    x = sc.nextInt();
    y = sc.nextInt();
    } for(a = 1; a <= x; a++){
            for(b = 1; b <= y; b++){
            System.out.print("#");
                if(b == y){
                    System.out.println();
                }
            }
        } a = 1; a = 1 a 1 a <= x a x a++ a++ a {
            for(b = 1; b <= y; b++){
            System.out.print("#");
                if(b == y){
                    System.out.println();
                }
            }
        } {
            for(b = 1; b <= y; b++){
            System.out.print("#");
                if(b == y){
                    System.out.println();
                }
            }
        } for(b = 1; b <= y; b++){
            System.out.print("#");
                if(b == y){
                    System.out.println();
                }
            } b = 1; b = 1 b 1 b <= y b y b++ b++ b {
            System.out.print("#");
                if(b == y){
                    System.out.println();
                }
            } {
            System.out.print("#");
                if(b == y){
                    System.out.println();
                }
            } System.out.print("#") System.out.print System.out System System.out "#" if(b == y){
                    System.out.println();
                } b == y b y {
                    System.out.println();
                } System.out.println() System.out.println System.out System System.out System.out.println() System.out.println System.out System System.out x = sc.nextInt() x sc.nextInt() sc.nextInt sc y = sc.nextInt() y sc.nextInt() sc.nextInt sc public static void main(String[]args){
   new Main().yatary();
  } main {
   new Main().yatary();
  } new Main().yatary() new Main().yatary new Main() String[]args args
import java.util.Scanner;
class Main{
public void yatary(){
    Scanner sc = new Scanner(System.in);
    int x,y,a,b;
    x = sc.nextInt();
    y = sc.nextInt();
    while(x!=0 || y!=0){
        for(a = 1; a <= x; a++){
            for(b = 1; b <= y; b++){
            System.out.print("#");
                if(b == y){
                    System.out.println();
                }
            }
        }
    System.out.println();
    x = sc.nextInt();
    y = sc.nextInt();
    }
}
public static void main(String[]args){
   new Main().yatary();
  }
}