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

class Main{
    public static void main(String[] args)throws IOException{
        int h, w;

        InputStreamReader isr =new InputStreamReader(System.in);
   		BufferedReader br =new BufferedReader(isr);
    	String buf = br.readLine();
        StringTokenizer st = new StringTokenizer(buf," ");
        h = Integer.parseInt(st.nextToken());
        w = Integer.parseInt(st.nextToken());
        
        while(true) {
        	if (h == 0 && w == 0) break;
        	int i, j;
            for (i = 0;i < h;i++) {
                for (j = 0;j < w;j++) {
                    System.out.printf("#");
                }
                System.out.printf("\n");
    	    }
            System.out.printf("\n");
            buf = br.readLine();
            st = new StringTokenizer(buf," ");
            h = Integer.parseInt(st.nextToken());
            w = Integer.parseInt(st.nextToken());
        }
    }
} import java.io.*; io.* java import java.util.*; util.* java class Main{
    public static void main(String[] args)throws IOException{
        int h, w;

        InputStreamReader isr =new InputStreamReader(System.in);
   		BufferedReader br =new BufferedReader(isr);
    	String buf = br.readLine();
        StringTokenizer st = new StringTokenizer(buf," ");
        h = Integer.parseInt(st.nextToken());
        w = Integer.parseInt(st.nextToken());
        
        while(true) {
        	if (h == 0 && w == 0) break;
        	int i, j;
            for (i = 0;i < h;i++) {
                for (j = 0;j < w;j++) {
                    System.out.printf("#");
                }
                System.out.printf("\n");
    	    }
            System.out.printf("\n");
            buf = br.readLine();
            st = new StringTokenizer(buf," ");
            h = Integer.parseInt(st.nextToken());
            w = Integer.parseInt(st.nextToken());
        }
    }
} Main public static void main(String[] args)throws IOException{
        int h, w;

        InputStreamReader isr =new InputStreamReader(System.in);
   		BufferedReader br =new BufferedReader(isr);
    	String buf = br.readLine();
        StringTokenizer st = new StringTokenizer(buf," ");
        h = Integer.parseInt(st.nextToken());
        w = Integer.parseInt(st.nextToken());
        
        while(true) {
        	if (h == 0 && w == 0) break;
        	int i, j;
            for (i = 0;i < h;i++) {
                for (j = 0;j < w;j++) {
                    System.out.printf("#");
                }
                System.out.printf("\n");
    	    }
            System.out.printf("\n");
            buf = br.readLine();
            st = new StringTokenizer(buf," ");
            h = Integer.parseInt(st.nextToken());
            w = Integer.parseInt(st.nextToken());
        }
    } main {
        int h, w;

        InputStreamReader isr =new InputStreamReader(System.in);
   		BufferedReader br =new BufferedReader(isr);
    	String buf = br.readLine();
        StringTokenizer st = new StringTokenizer(buf," ");
        h = Integer.parseInt(st.nextToken());
        w = Integer.parseInt(st.nextToken());
        
        while(true) {
        	if (h == 0 && w == 0) break;
        	int i, j;
            for (i = 0;i < h;i++) {
                for (j = 0;j < w;j++) {
                    System.out.printf("#");
                }
                System.out.printf("\n");
    	    }
            System.out.printf("\n");
            buf = br.readLine();
            st = new StringTokenizer(buf," ");
            h = Integer.parseInt(st.nextToken());
            w = Integer.parseInt(st.nextToken());
        }
    } int h h w; w InputStreamReader isr =new InputStreamReader(System.in); isr new InputStreamReader(System.in) BufferedReader br =new BufferedReader(isr); br new BufferedReader(isr) String buf = br.readLine(); buf br.readLine() br.readLine br StringTokenizer st = new StringTokenizer(buf," "); st new StringTokenizer(buf," ") h = Integer.parseInt(st.nextToken()) h Integer.parseInt(st.nextToken()) Integer.parseInt Integer st.nextToken() st.nextToken st w = Integer.parseInt(st.nextToken()) w Integer.parseInt(st.nextToken()) Integer.parseInt Integer st.nextToken() st.nextToken st while(true) {
        	if (h == 0 && w == 0) break;
        	int i, j;
            for (i = 0;i < h;i++) {
                for (j = 0;j < w;j++) {
                    System.out.printf("#");
                }
                System.out.printf("\n");
    	    }
            System.out.printf("\n");
            buf = br.readLine();
            st = new StringTokenizer(buf," ");
            h = Integer.parseInt(st.nextToken());
            w = Integer.parseInt(st.nextToken());
        } true {
        	if (h == 0 && w == 0) break;
        	int i, j;
            for (i = 0;i < h;i++) {
                for (j = 0;j < w;j++) {
                    System.out.printf("#");
                }
                System.out.printf("\n");
    	    }
            System.out.printf("\n");
            buf = br.readLine();
            st = new StringTokenizer(buf," ");
            h = Integer.parseInt(st.nextToken());
            w = Integer.parseInt(st.nextToken());
        } if (h == 0 && w == 0) break; h == 0 && w == 0 h == 0 h 0 w == 0 w 0 break; int i i j; j for (i = 0;i < h;i++) {
                for (j = 0;j < w;j++) {
                    System.out.printf("#");
                }
                System.out.printf("\n");
    	    } i = 0; i = 0 i 0 i < h i h i++ i++ i {
                for (j = 0;j < w;j++) {
                    System.out.printf("#");
                }
                System.out.printf("\n");
    	    } {
                for (j = 0;j < w;j++) {
                    System.out.printf("#");
                }
                System.out.printf("\n");
    	    } for (j = 0;j < w;j++) {
                    System.out.printf("#");
                } j = 0; j = 0 j 0 j < w j w j++ j++ j {
                    System.out.printf("#");
                } {
                    System.out.printf("#");
                } System.out.printf("#") System.out.printf System.out System System.out "#" System.out.printf("\n") System.out.printf System.out System System.out "\n" System.out.printf("\n") System.out.printf System.out System System.out "\n" buf = br.readLine() buf br.readLine() br.readLine br st = new StringTokenizer(buf," ") st new StringTokenizer(buf," ") h = Integer.parseInt(st.nextToken()) h Integer.parseInt(st.nextToken()) Integer.parseInt Integer st.nextToken() st.nextToken st w = Integer.parseInt(st.nextToken()) w Integer.parseInt(st.nextToken()) Integer.parseInt Integer st.nextToken() st.nextToken st String[] args args
import java.io.*;
import java.util.*;

class Main{
    public static void main(String[] args)throws IOException{
        int h, w;

        InputStreamReader isr =new InputStreamReader(System.in);
   		BufferedReader br =new BufferedReader(isr);
    	String buf = br.readLine();
        StringTokenizer st = new StringTokenizer(buf," ");
        h = Integer.parseInt(st.nextToken());
        w = Integer.parseInt(st.nextToken());
        
        while(true) {
        	if (h == 0 && w == 0) break;
        	int i, j;
            for (i = 0;i < h;i++) {
                for (j = 0;j < w;j++) {
                    System.out.printf("#");
                }
                System.out.printf("\n");
    	    }
            System.out.printf("\n");
            buf = br.readLine();
            st = new StringTokenizer(buf," ");
            h = Integer.parseInt(st.nextToken());
            w = Integer.parseInt(st.nextToken());
        }
    }
}