import java.text.DecimalFormat;
import java.util.*;

public class Main {
    public static void main(String[] args)  throws java.io.IOException{
        Scanner sc = new Scanner(System.in);
        while(true){
            int h = sc.nextInt();
            int w = sc.nextInt();
            if(h==0&&w==0){
                break;
            }
            String elem = "";
            for (int i=1;i<=w;i++){
                elem+="#";
            }
            for (int i = 1;i<=h;i++){
                System.out.println(elem);
            }
            System.out.println("");
        }
        sc.close();
    }
} import java.text.DecimalFormat; DecimalFormat java.text import java.util.*; util.* java public class Main {
    public static void main(String[] args)  throws java.io.IOException{
        Scanner sc = new Scanner(System.in);
        while(true){
            int h = sc.nextInt();
            int w = sc.nextInt();
            if(h==0&&w==0){
                break;
            }
            String elem = "";
            for (int i=1;i<=w;i++){
                elem+="#";
            }
            for (int i = 1;i<=h;i++){
                System.out.println(elem);
            }
            System.out.println("");
        }
        sc.close();
    }
} Main public static void main(String[] args)  throws java.io.IOException{
        Scanner sc = new Scanner(System.in);
        while(true){
            int h = sc.nextInt();
            int w = sc.nextInt();
            if(h==0&&w==0){
                break;
            }
            String elem = "";
            for (int i=1;i<=w;i++){
                elem+="#";
            }
            for (int i = 1;i<=h;i++){
                System.out.println(elem);
            }
            System.out.println("");
        }
        sc.close();
    } main {
        Scanner sc = new Scanner(System.in);
        while(true){
            int h = sc.nextInt();
            int w = sc.nextInt();
            if(h==0&&w==0){
                break;
            }
            String elem = "";
            for (int i=1;i<=w;i++){
                elem+="#";
            }
            for (int i = 1;i<=h;i++){
                System.out.println(elem);
            }
            System.out.println("");
        }
        sc.close();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) while(true){
            int h = sc.nextInt();
            int w = sc.nextInt();
            if(h==0&&w==0){
                break;
            }
            String elem = "";
            for (int i=1;i<=w;i++){
                elem+="#";
            }
            for (int i = 1;i<=h;i++){
                System.out.println(elem);
            }
            System.out.println("");
        } true {
            int h = sc.nextInt();
            int w = sc.nextInt();
            if(h==0&&w==0){
                break;
            }
            String elem = "";
            for (int i=1;i<=w;i++){
                elem+="#";
            }
            for (int i = 1;i<=h;i++){
                System.out.println(elem);
            }
            System.out.println("");
        } int h = sc.nextInt(); h sc.nextInt() sc.nextInt sc int w = sc.nextInt(); w sc.nextInt() sc.nextInt sc if(h==0&&w==0){
                break;
            } h==0&&w==0 h==0 h 0 w==0 w 0 {
                break;
            } break; String elem = ""; elem "" for (int i=1;i<=w;i++){
                elem+="#";
            } int i=1; int i=1; i 1 i<=w i w i++ i++ i {
                elem+="#";
            } {
                elem+="#";
            } elem+="#" elem "#" for (int i = 1;i<=h;i++){
                System.out.println(elem);
            } int i = 1; int i = 1; i 1 i<=h i h i++ i++ i {
                System.out.println(elem);
            } {
                System.out.println(elem);
            } System.out.println(elem) System.out.println System.out System System.out elem System.out.println("") System.out.println System.out System System.out "" sc.close() sc.close sc String[] args args public class Main {
    public static void main(String[] args)  throws java.io.IOException{
        Scanner sc = new Scanner(System.in);
        while(true){
            int h = sc.nextInt();
            int w = sc.nextInt();
            if(h==0&&w==0){
                break;
            }
            String elem = "";
            for (int i=1;i<=w;i++){
                elem+="#";
            }
            for (int i = 1;i<=h;i++){
                System.out.println(elem);
            }
            System.out.println("");
        }
        sc.close();
    }
} public class Main {
    public static void main(String[] args)  throws java.io.IOException{
        Scanner sc = new Scanner(System.in);
        while(true){
            int h = sc.nextInt();
            int w = sc.nextInt();
            if(h==0&&w==0){
                break;
            }
            String elem = "";
            for (int i=1;i<=w;i++){
                elem+="#";
            }
            for (int i = 1;i<=h;i++){
                System.out.println(elem);
            }
            System.out.println("");
        }
        sc.close();
    }
} Main
import java.text.DecimalFormat;
import java.util.*;

public class Main {
    public static void main(String[] args)  throws java.io.IOException{
        Scanner sc = new Scanner(System.in);
        while(true){
            int h = sc.nextInt();
            int w = sc.nextInt();
            if(h==0&&w==0){
                break;
            }
            String elem = "";
            for (int i=1;i<=w;i++){
                elem+="#";
            }
            for (int i = 1;i<=h;i++){
                System.out.println(elem);
            }
            System.out.println("");
        }
        sc.close();
    }
}