import java.io.*;

class Main{
	public static void main(String args[]) throws IOException{
		BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));
		
		while(true){
			String[] str = buf.readLine().split(" ");
			int H = Integer.parseInt(str[0]);
			int W = Integer.parseInt(str[1]);
			if(H==0 && W==0)
				break;
			for(int i=1; i<=H; i++){
				for(int j=1; j<=W; j++){
					System.out.print("#");
				}
				System.out.println();
			}
                  System.out.println();
      
		}
	}	
} import java.io.*; io.* java class Main{
	public static void main(String args[]) throws IOException{
		BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));
		
		while(true){
			String[] str = buf.readLine().split(" ");
			int H = Integer.parseInt(str[0]);
			int W = Integer.parseInt(str[1]);
			if(H==0 && W==0)
				break;
			for(int i=1; i<=H; i++){
				for(int j=1; j<=W; j++){
					System.out.print("#");
				}
				System.out.println();
			}
                  System.out.println();
      
		}
	}	
} Main public static void main(String args[]) throws IOException{
		BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));
		
		while(true){
			String[] str = buf.readLine().split(" ");
			int H = Integer.parseInt(str[0]);
			int W = Integer.parseInt(str[1]);
			if(H==0 && W==0)
				break;
			for(int i=1; i<=H; i++){
				for(int j=1; j<=W; j++){
					System.out.print("#");
				}
				System.out.println();
			}
                  System.out.println();
      
		}
	} main {
		BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));
		
		while(true){
			String[] str = buf.readLine().split(" ");
			int H = Integer.parseInt(str[0]);
			int W = Integer.parseInt(str[1]);
			if(H==0 && W==0)
				break;
			for(int i=1; i<=H; i++){
				for(int j=1; j<=W; j++){
					System.out.print("#");
				}
				System.out.println();
			}
                  System.out.println();
      
		}
	} BufferedReader buf = new BufferedReader(new InputStreamReader(System.in)); buf new BufferedReader(new InputStreamReader(System.in)) while(true){
			String[] str = buf.readLine().split(" ");
			int H = Integer.parseInt(str[0]);
			int W = Integer.parseInt(str[1]);
			if(H==0 && W==0)
				break;
			for(int i=1; i<=H; i++){
				for(int j=1; j<=W; j++){
					System.out.print("#");
				}
				System.out.println();
			}
                  System.out.println();
      
		} true {
			String[] str = buf.readLine().split(" ");
			int H = Integer.parseInt(str[0]);
			int W = Integer.parseInt(str[1]);
			if(H==0 && W==0)
				break;
			for(int i=1; i<=H; i++){
				for(int j=1; j<=W; j++){
					System.out.print("#");
				}
				System.out.println();
			}
                  System.out.println();
      
		} String[] str = buf.readLine().split(" "); str buf.readLine().split(" ") buf.readLine().split buf.readLine() buf.readLine buf " " 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 if(H==0 && W==0)
				break; H==0 && W==0 H==0 H 0 W==0 W 0 break; for(int i=1; i<=H; i++){
				for(int j=1; j<=W; j++){
					System.out.print("#");
				}
				System.out.println();
			} int i=1; int i=1; i 1 i<=H i H i++ i++ i {
				for(int j=1; j<=W; j++){
					System.out.print("#");
				}
				System.out.println();
			} {
				for(int j=1; j<=W; j++){
					System.out.print("#");
				}
				System.out.println();
			} for(int j=1; j<=W; j++){
					System.out.print("#");
				} int j=1; int j=1; j 1 j<=W j W j++ j++ j {
					System.out.print("#");
				} {
					System.out.print("#");
				} System.out.print("#") System.out.print System.out System System.out "#" System.out.println() System.out.println System.out System System.out System.out.println() System.out.println System.out System System.out String args[] args
import java.io.*;

class Main{
	public static void main(String args[]) throws IOException{
		BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));
		
		while(true){
			String[] str = buf.readLine().split(" ");
			int H = Integer.parseInt(str[0]);
			int W = Integer.parseInt(str[1]);
			if(H==0 && W==0)
				break;
			for(int i=1; i<=H; i++){
				for(int j=1; j<=W; j++){
					System.out.print("#");
				}
				System.out.println();
			}
                  System.out.println();
      
		}
	}	
}