import java.io.*;

public class Main{
    public static void main(String[]args)throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        while(true){
            String[] str = br.readLine().split(" ");
            int h = Integer.parseInt(str[0]);
            int w = Integer.parseInt(str[1]);
            StringBuilder sb = new StringBuilder();

            if( h == 0 && w == 0)break;
            for(int i=0; i<h; i++){
                for(int j=0; j<w; j++){
                    sb.append("#");
                }
                sb.append("\n");
            }
            System.out.println(sb);
        }

    }
} import java.io.*; io.* java public class Main{
    public static void main(String[]args)throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        while(true){
            String[] str = br.readLine().split(" ");
            int h = Integer.parseInt(str[0]);
            int w = Integer.parseInt(str[1]);
            StringBuilder sb = new StringBuilder();

            if( h == 0 && w == 0)break;
            for(int i=0; i<h; i++){
                for(int j=0; j<w; j++){
                    sb.append("#");
                }
                sb.append("\n");
            }
            System.out.println(sb);
        }

    }
} Main public static void main(String[]args)throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        while(true){
            String[] str = br.readLine().split(" ");
            int h = Integer.parseInt(str[0]);
            int w = Integer.parseInt(str[1]);
            StringBuilder sb = new StringBuilder();

            if( h == 0 && w == 0)break;
            for(int i=0; i<h; i++){
                for(int j=0; j<w; j++){
                    sb.append("#");
                }
                sb.append("\n");
            }
            System.out.println(sb);
        }

    } main {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        while(true){
            String[] str = br.readLine().split(" ");
            int h = Integer.parseInt(str[0]);
            int w = Integer.parseInt(str[1]);
            StringBuilder sb = new StringBuilder();

            if( h == 0 && w == 0)break;
            for(int i=0; i<h; i++){
                for(int j=0; j<w; j++){
                    sb.append("#");
                }
                sb.append("\n");
            }
            System.out.println(sb);
        }

    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) while(true){
            String[] str = br.readLine().split(" ");
            int h = Integer.parseInt(str[0]);
            int w = Integer.parseInt(str[1]);
            StringBuilder sb = new StringBuilder();

            if( h == 0 && w == 0)break;
            for(int i=0; i<h; i++){
                for(int j=0; j<w; j++){
                    sb.append("#");
                }
                sb.append("\n");
            }
            System.out.println(sb);
        } true {
            String[] str = br.readLine().split(" ");
            int h = Integer.parseInt(str[0]);
            int w = Integer.parseInt(str[1]);
            StringBuilder sb = new StringBuilder();

            if( h == 0 && w == 0)break;
            for(int i=0; i<h; i++){
                for(int j=0; j<w; j++){
                    sb.append("#");
                }
                sb.append("\n");
            }
            System.out.println(sb);
        } String[] str = br.readLine().split(" "); str br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int h = Integer.parseInt(str[0]); h Integer.parseInt(str[0]) Integer.parseInt Integer str[0] str 0 int w = Integer.parseInt(str[1]); w Integer.parseInt(str[1]) Integer.parseInt Integer str[1] str 1 StringBuilder sb = new StringBuilder(); sb new StringBuilder() if( h == 0 && w == 0)break; h == 0 && w == 0 h == 0 h 0 w == 0 w 0 break; for(int i=0; i<h; i++){
                for(int j=0; j<w; j++){
                    sb.append("#");
                }
                sb.append("\n");
            } int i=0; int i=0; i 0 i<h i h i++ i++ i {
                for(int j=0; j<w; j++){
                    sb.append("#");
                }
                sb.append("\n");
            } {
                for(int j=0; j<w; j++){
                    sb.append("#");
                }
                sb.append("\n");
            } for(int j=0; j<w; j++){
                    sb.append("#");
                } int j=0; int j=0; j 0 j<w j w j++ j++ j {
                    sb.append("#");
                } {
                    sb.append("#");
                } sb.append("#") sb.append sb "#" sb.append("\n") sb.append sb "\n" System.out.println(sb) System.out.println System.out System System.out sb String[]args args public class Main{
    public static void main(String[]args)throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        while(true){
            String[] str = br.readLine().split(" ");
            int h = Integer.parseInt(str[0]);
            int w = Integer.parseInt(str[1]);
            StringBuilder sb = new StringBuilder();

            if( h == 0 && w == 0)break;
            for(int i=0; i<h; i++){
                for(int j=0; j<w; j++){
                    sb.append("#");
                }
                sb.append("\n");
            }
            System.out.println(sb);
        }

    }
} public class Main{
    public static void main(String[]args)throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        while(true){
            String[] str = br.readLine().split(" ");
            int h = Integer.parseInt(str[0]);
            int w = Integer.parseInt(str[1]);
            StringBuilder sb = new StringBuilder();

            if( h == 0 && w == 0)break;
            for(int i=0; i<h; i++){
                for(int j=0; j<w; j++){
                    sb.append("#");
                }
                sb.append("\n");
            }
            System.out.println(sb);
        }

    }
} Main
import java.io.*;

public class Main{
    public static void main(String[]args)throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        while(true){
            String[] str = br.readLine().split(" ");
            int h = Integer.parseInt(str[0]);
            int w = Integer.parseInt(str[1]);
            StringBuilder sb = new StringBuilder();

            if( h == 0 && w == 0)break;
            for(int i=0; i<h; i++){
                for(int j=0; j<w; j++){
                    sb.append("#");
                }
                sb.append("\n");
            }
            System.out.println(sb);
        }

    }
}