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



public class Main {
    public static void main(String[] args)throws Exception{
        Scanner scan = new Scanner(System.in);
        int H = 0;
        int W = 0;
        String w = "";
        int judge = 0;
        while(judge == 0){
            H = scan.nextInt();
            W = scan.nextInt();
            //wは繰り返し使うので、その都度初期化する
            if(judge == 0){
                w = "";
            }
            if(H == 0 && W == 0){
                judge = 1;
            }else{
                for(int i = 0;i <= W - 1;i++){    
                   w = w + "#";
                }
                for(int I = 0;I <= H - 1;I++){
                   if(I != H - 1){
                    System.out.println(w);
                   }else if(I == H - 1){
                    System.out.println(w + "\r\n");
                   }
                }
            }
        }
        
    }
} import java.io.*; io.* java import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args)throws Exception{
        Scanner scan = new Scanner(System.in);
        int H = 0;
        int W = 0;
        String w = "";
        int judge = 0;
        while(judge == 0){
            H = scan.nextInt();
            W = scan.nextInt();
            //wは繰り返し使うので、その都度初期化する
            if(judge == 0){
                w = "";
            }
            if(H == 0 && W == 0){
                judge = 1;
            }else{
                for(int i = 0;i <= W - 1;i++){    
                   w = w + "#";
                }
                for(int I = 0;I <= H - 1;I++){
                   if(I != H - 1){
                    System.out.println(w);
                   }else if(I == H - 1){
                    System.out.println(w + "\r\n");
                   }
                }
            }
        }
        
    }
} Main public static void main(String[] args)throws Exception{
        Scanner scan = new Scanner(System.in);
        int H = 0;
        int W = 0;
        String w = "";
        int judge = 0;
        while(judge == 0){
            H = scan.nextInt();
            W = scan.nextInt();
            //wは繰り返し使うので、その都度初期化する
            if(judge == 0){
                w = "";
            }
            if(H == 0 && W == 0){
                judge = 1;
            }else{
                for(int i = 0;i <= W - 1;i++){    
                   w = w + "#";
                }
                for(int I = 0;I <= H - 1;I++){
                   if(I != H - 1){
                    System.out.println(w);
                   }else if(I == H - 1){
                    System.out.println(w + "\r\n");
                   }
                }
            }
        }
        
    } main {
        Scanner scan = new Scanner(System.in);
        int H = 0;
        int W = 0;
        String w = "";
        int judge = 0;
        while(judge == 0){
            H = scan.nextInt();
            W = scan.nextInt();
            //wは繰り返し使うので、その都度初期化する
            if(judge == 0){
                w = "";
            }
            if(H == 0 && W == 0){
                judge = 1;
            }else{
                for(int i = 0;i <= W - 1;i++){    
                   w = w + "#";
                }
                for(int I = 0;I <= H - 1;I++){
                   if(I != H - 1){
                    System.out.println(w);
                   }else if(I == H - 1){
                    System.out.println(w + "\r\n");
                   }
                }
            }
        }
        
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int H = 0; H 0 int W = 0; W 0 String w = ""; w "" int judge = 0; judge 0 while(judge == 0){
            H = scan.nextInt();
            W = scan.nextInt();
            //wは繰り返し使うので、その都度初期化する
            if(judge == 0){
                w = "";
            }
            if(H == 0 && W == 0){
                judge = 1;
            }else{
                for(int i = 0;i <= W - 1;i++){    
                   w = w + "#";
                }
                for(int I = 0;I <= H - 1;I++){
                   if(I != H - 1){
                    System.out.println(w);
                   }else if(I == H - 1){
                    System.out.println(w + "\r\n");
                   }
                }
            }
        } judge == 0 judge 0 {
            H = scan.nextInt();
            W = scan.nextInt();
            //wは繰り返し使うので、その都度初期化する
            if(judge == 0){
                w = "";
            }
            if(H == 0 && W == 0){
                judge = 1;
            }else{
                for(int i = 0;i <= W - 1;i++){    
                   w = w + "#";
                }
                for(int I = 0;I <= H - 1;I++){
                   if(I != H - 1){
                    System.out.println(w);
                   }else if(I == H - 1){
                    System.out.println(w + "\r\n");
                   }
                }
            }
        } H = scan.nextInt() H scan.nextInt() scan.nextInt scan W = scan.nextInt() W scan.nextInt() scan.nextInt scan if(judge == 0){
                w = "";
            } judge == 0 judge 0 {
                w = "";
            } w = "" w "" if(H == 0 && W == 0){
                judge = 1;
            }else{
                for(int i = 0;i <= W - 1;i++){    
                   w = w + "#";
                }
                for(int I = 0;I <= H - 1;I++){
                   if(I != H - 1){
                    System.out.println(w);
                   }else if(I == H - 1){
                    System.out.println(w + "\r\n");
                   }
                }
            } H == 0 && W == 0 H == 0 H 0 W == 0 W 0 {
                judge = 1;
            } judge = 1 judge 1 {
                for(int i = 0;i <= W - 1;i++){    
                   w = w + "#";
                }
                for(int I = 0;I <= H - 1;I++){
                   if(I != H - 1){
                    System.out.println(w);
                   }else if(I == H - 1){
                    System.out.println(w + "\r\n");
                   }
                }
            } for(int i = 0;i <= W - 1;i++){    
                   w = w + "#";
                } int i = 0; int i = 0; i 0 i <= W - 1 i W - 1 W 1 i++ i++ i {    
                   w = w + "#";
                } {    
                   w = w + "#";
                } w = w + "#" w w + "#" w "#" for(int I = 0;I <= H - 1;I++){
                   if(I != H - 1){
                    System.out.println(w);
                   }else if(I == H - 1){
                    System.out.println(w + "\r\n");
                   }
                } int I = 0; int I = 0; I 0 I <= H - 1 I H - 1 H 1 I++ I++ I {
                   if(I != H - 1){
                    System.out.println(w);
                   }else if(I == H - 1){
                    System.out.println(w + "\r\n");
                   }
                } {
                   if(I != H - 1){
                    System.out.println(w);
                   }else if(I == H - 1){
                    System.out.println(w + "\r\n");
                   }
                } if(I != H - 1){
                    System.out.println(w);
                   }else if(I == H - 1){
                    System.out.println(w + "\r\n");
                   } I != H - 1 I H - 1 H 1 {
                    System.out.println(w);
                   } System.out.println(w) System.out.println System.out System System.out w if(I == H - 1){
                    System.out.println(w + "\r\n");
                   } I == H - 1 I H - 1 H 1 {
                    System.out.println(w + "\r\n");
                   } System.out.println(w + "\r\n") System.out.println System.out System System.out w + "\r\n" w "\r\n" String[] args args public class Main {
    public static void main(String[] args)throws Exception{
        Scanner scan = new Scanner(System.in);
        int H = 0;
        int W = 0;
        String w = "";
        int judge = 0;
        while(judge == 0){
            H = scan.nextInt();
            W = scan.nextInt();
            //wは繰り返し使うので、その都度初期化する
            if(judge == 0){
                w = "";
            }
            if(H == 0 && W == 0){
                judge = 1;
            }else{
                for(int i = 0;i <= W - 1;i++){    
                   w = w + "#";
                }
                for(int I = 0;I <= H - 1;I++){
                   if(I != H - 1){
                    System.out.println(w);
                   }else if(I == H - 1){
                    System.out.println(w + "\r\n");
                   }
                }
            }
        }
        
    }
} public class Main {
    public static void main(String[] args)throws Exception{
        Scanner scan = new Scanner(System.in);
        int H = 0;
        int W = 0;
        String w = "";
        int judge = 0;
        while(judge == 0){
            H = scan.nextInt();
            W = scan.nextInt();
            //wは繰り返し使うので、その都度初期化する
            if(judge == 0){
                w = "";
            }
            if(H == 0 && W == 0){
                judge = 1;
            }else{
                for(int i = 0;i <= W - 1;i++){    
                   w = w + "#";
                }
                for(int I = 0;I <= H - 1;I++){
                   if(I != H - 1){
                    System.out.println(w);
                   }else if(I == H - 1){
                    System.out.println(w + "\r\n");
                   }
                }
            }
        }
        
    }
} Main
import java.io.*;
import java.util.Scanner;



public class Main {
    public static void main(String[] args)throws Exception{
        Scanner scan = new Scanner(System.in);
        int H = 0;
        int W = 0;
        String w = "";
        int judge = 0;
        while(judge == 0){
            H = scan.nextInt();
            W = scan.nextInt();
            //wは繰り返し使うので、その都度初期化する
            if(judge == 0){
                w = "";
            }
            if(H == 0 && W == 0){
                judge = 1;
            }else{
                for(int i = 0;i <= W - 1;i++){    
                   w = w + "#";
                }
                for(int I = 0;I <= H - 1;I++){
                   if(I != H - 1){
                    System.out.println(w);
                   }else if(I == H - 1){
                    System.out.println(w + "\r\n");
                   }
                }
            }
        }
        
    }
}
