import java.io.*;
import java.util.*;

public class Main{
    public static void main(String[] argst)throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        
        String str = br.readLine();
        
        while(str != null){
            String[] line = str.split("\\s");
            int H = Integer.parseInt(line[0]);
            int W = Integer.parseInt(line[1]);
            //System.out.println(H);
            //System.out.println(W);

            if(H !=0 && W != 0){
            String yoko = Wwrite(W);
            Hwrite(H,yoko);
            System.out.println("");
            str = br.readLine();
            }else{
                break;
            }
        }
    }

    public static String Wwrite(int W){
        StringBuilder buff = new StringBuilder();
        for(int i=0;i<W;i++){
            buff.append("#");
        }
        return buff.toString();
    }

    public static void Hwrite(int H,String yoko){
        for(int i=0;i<H;i++){
            System.out.println(yoko);
        }
    }
} import java.io.*; io.* java import java.util.*; util.* java public class Main{
    public static void main(String[] argst)throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        
        String str = br.readLine();
        
        while(str != null){
            String[] line = str.split("\\s");
            int H = Integer.parseInt(line[0]);
            int W = Integer.parseInt(line[1]);
            //System.out.println(H);
            //System.out.println(W);

            if(H !=0 && W != 0){
            String yoko = Wwrite(W);
            Hwrite(H,yoko);
            System.out.println("");
            str = br.readLine();
            }else{
                break;
            }
        }
    }

    public static String Wwrite(int W){
        StringBuilder buff = new StringBuilder();
        for(int i=0;i<W;i++){
            buff.append("#");
        }
        return buff.toString();
    }

    public static void Hwrite(int H,String yoko){
        for(int i=0;i<H;i++){
            System.out.println(yoko);
        }
    }
} Main public static void main(String[] argst)throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        
        String str = br.readLine();
        
        while(str != null){
            String[] line = str.split("\\s");
            int H = Integer.parseInt(line[0]);
            int W = Integer.parseInt(line[1]);
            //System.out.println(H);
            //System.out.println(W);

            if(H !=0 && W != 0){
            String yoko = Wwrite(W);
            Hwrite(H,yoko);
            System.out.println("");
            str = br.readLine();
            }else{
                break;
            }
        }
    } main {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        
        String str = br.readLine();
        
        while(str != null){
            String[] line = str.split("\\s");
            int H = Integer.parseInt(line[0]);
            int W = Integer.parseInt(line[1]);
            //System.out.println(H);
            //System.out.println(W);

            if(H !=0 && W != 0){
            String yoko = Wwrite(W);
            Hwrite(H,yoko);
            System.out.println("");
            str = br.readLine();
            }else{
                break;
            }
        }
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String str = br.readLine(); str br.readLine() br.readLine br while(str != null){
            String[] line = str.split("\\s");
            int H = Integer.parseInt(line[0]);
            int W = Integer.parseInt(line[1]);
            //System.out.println(H);
            //System.out.println(W);

            if(H !=0 && W != 0){
            String yoko = Wwrite(W);
            Hwrite(H,yoko);
            System.out.println("");
            str = br.readLine();
            }else{
                break;
            }
        } str != null str null {
            String[] line = str.split("\\s");
            int H = Integer.parseInt(line[0]);
            int W = Integer.parseInt(line[1]);
            //System.out.println(H);
            //System.out.println(W);

            if(H !=0 && W != 0){
            String yoko = Wwrite(W);
            Hwrite(H,yoko);
            System.out.println("");
            str = br.readLine();
            }else{
                break;
            }
        } String[] line = str.split("\\s"); line str.split("\\s") str.split str "\\s" int H = Integer.parseInt(line[0]); H Integer.parseInt(line[0]) Integer.parseInt Integer line[0] line 0 int W = Integer.parseInt(line[1]); W Integer.parseInt(line[1]) Integer.parseInt Integer line[1] line 1 if(H !=0 && W != 0){
            String yoko = Wwrite(W);
            Hwrite(H,yoko);
            System.out.println("");
            str = br.readLine();
            }else{
                break;
            } H !=0 && W != 0 H !=0 H 0 W != 0 W 0 {
            String yoko = Wwrite(W);
            Hwrite(H,yoko);
            System.out.println("");
            str = br.readLine();
            } String yoko = Wwrite(W); yoko Wwrite(W) Wwrite W Hwrite(H,yoko) Hwrite H yoko System.out.println("") System.out.println System.out System System.out "" str = br.readLine() str br.readLine() br.readLine br {
                break;
            } break; String[] argst argst public static String Wwrite(int W){
        StringBuilder buff = new StringBuilder();
        for(int i=0;i<W;i++){
            buff.append("#");
        }
        return buff.toString();
    } Wwrite {
        StringBuilder buff = new StringBuilder();
        for(int i=0;i<W;i++){
            buff.append("#");
        }
        return buff.toString();
    } StringBuilder buff = new StringBuilder(); buff new StringBuilder() for(int i=0;i<W;i++){
            buff.append("#");
        } int i=0; int i=0; i 0 i<W i W i++ i++ i {
            buff.append("#");
        } {
            buff.append("#");
        } buff.append("#") buff.append buff "#" return buff.toString(); buff.toString() buff.toString buff int W W public static void Hwrite(int H,String yoko){
        for(int i=0;i<H;i++){
            System.out.println(yoko);
        }
    } Hwrite {
        for(int i=0;i<H;i++){
            System.out.println(yoko);
        }
    } for(int i=0;i<H;i++){
            System.out.println(yoko);
        } int i=0; int i=0; i 0 i<H i H i++ i++ i {
            System.out.println(yoko);
        } {
            System.out.println(yoko);
        } System.out.println(yoko) System.out.println System.out System System.out yoko int H H String yoko yoko public class Main{
    public static void main(String[] argst)throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        
        String str = br.readLine();
        
        while(str != null){
            String[] line = str.split("\\s");
            int H = Integer.parseInt(line[0]);
            int W = Integer.parseInt(line[1]);
            //System.out.println(H);
            //System.out.println(W);

            if(H !=0 && W != 0){
            String yoko = Wwrite(W);
            Hwrite(H,yoko);
            System.out.println("");
            str = br.readLine();
            }else{
                break;
            }
        }
    }

    public static String Wwrite(int W){
        StringBuilder buff = new StringBuilder();
        for(int i=0;i<W;i++){
            buff.append("#");
        }
        return buff.toString();
    }

    public static void Hwrite(int H,String yoko){
        for(int i=0;i<H;i++){
            System.out.println(yoko);
        }
    }
} public class Main{
    public static void main(String[] argst)throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        
        String str = br.readLine();
        
        while(str != null){
            String[] line = str.split("\\s");
            int H = Integer.parseInt(line[0]);
            int W = Integer.parseInt(line[1]);
            //System.out.println(H);
            //System.out.println(W);

            if(H !=0 && W != 0){
            String yoko = Wwrite(W);
            Hwrite(H,yoko);
            System.out.println("");
            str = br.readLine();
            }else{
                break;
            }
        }
    }

    public static String Wwrite(int W){
        StringBuilder buff = new StringBuilder();
        for(int i=0;i<W;i++){
            buff.append("#");
        }
        return buff.toString();
    }

    public static void Hwrite(int H,String yoko){
        for(int i=0;i<H;i++){
            System.out.println(yoko);
        }
    }
} Main
import java.io.*;
import java.util.*;

public class Main{
    public static void main(String[] argst)throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        
        String str = br.readLine();
        
        while(str != null){
            String[] line = str.split("\\s");
            int H = Integer.parseInt(line[0]);
            int W = Integer.parseInt(line[1]);
            //System.out.println(H);
            //System.out.println(W);

            if(H !=0 && W != 0){
            String yoko = Wwrite(W);
            Hwrite(H,yoko);
            System.out.println("");
            str = br.readLine();
            }else{
                break;
            }
        }
    }

    public static String Wwrite(int W){
        StringBuilder buff = new StringBuilder();
        for(int i=0;i<W;i++){
            buff.append("#");
        }
        return buff.toString();
    }

    public static void Hwrite(int H,String yoko){
        for(int i=0;i<H;i++){
            System.out.println(yoko);
        }
    }
}