import java.util.Scanner;
public class Main{
	public static void main(String[] args){
		int a,b,W,H;
		Scanner br=new Scanner(System.in);
		while(true){
			H=br.nextInt();
			W=br.nextInt();
			if(H==0 && W==0){
				break;
				}else{
					for(a=1;a<=H;a++){
						for(b=1;b<=W;b++){
							System.out.print("#");
							}
						System.out.println();
						}
					System.out.println();
					}
			}
		}
	} import java.util.Scanner; Scanner java.util public class Main{
	public static void main(String[] args){
		int a,b,W,H;
		Scanner br=new Scanner(System.in);
		while(true){
			H=br.nextInt();
			W=br.nextInt();
			if(H==0 && W==0){
				break;
				}else{
					for(a=1;a<=H;a++){
						for(b=1;b<=W;b++){
							System.out.print("#");
							}
						System.out.println();
						}
					System.out.println();
					}
			}
		}
	} Main public static void main(String[] args){
		int a,b,W,H;
		Scanner br=new Scanner(System.in);
		while(true){
			H=br.nextInt();
			W=br.nextInt();
			if(H==0 && W==0){
				break;
				}else{
					for(a=1;a<=H;a++){
						for(b=1;b<=W;b++){
							System.out.print("#");
							}
						System.out.println();
						}
					System.out.println();
					}
			}
		} main {
		int a,b,W,H;
		Scanner br=new Scanner(System.in);
		while(true){
			H=br.nextInt();
			W=br.nextInt();
			if(H==0 && W==0){
				break;
				}else{
					for(a=1;a<=H;a++){
						for(b=1;b<=W;b++){
							System.out.print("#");
							}
						System.out.println();
						}
					System.out.println();
					}
			}
		} int a a b b W W H; H Scanner br=new Scanner(System.in); br new Scanner(System.in) while(true){
			H=br.nextInt();
			W=br.nextInt();
			if(H==0 && W==0){
				break;
				}else{
					for(a=1;a<=H;a++){
						for(b=1;b<=W;b++){
							System.out.print("#");
							}
						System.out.println();
						}
					System.out.println();
					}
			} true {
			H=br.nextInt();
			W=br.nextInt();
			if(H==0 && W==0){
				break;
				}else{
					for(a=1;a<=H;a++){
						for(b=1;b<=W;b++){
							System.out.print("#");
							}
						System.out.println();
						}
					System.out.println();
					}
			} H=br.nextInt() H br.nextInt() br.nextInt br W=br.nextInt() W br.nextInt() br.nextInt br if(H==0 && W==0){
				break;
				}else{
					for(a=1;a<=H;a++){
						for(b=1;b<=W;b++){
							System.out.print("#");
							}
						System.out.println();
						}
					System.out.println();
					} H==0 && W==0 H==0 H 0 W==0 W 0 {
				break;
				} break; {
					for(a=1;a<=H;a++){
						for(b=1;b<=W;b++){
							System.out.print("#");
							}
						System.out.println();
						}
					System.out.println();
					} for(a=1;a<=H;a++){
						for(b=1;b<=W;b++){
							System.out.print("#");
							}
						System.out.println();
						} a=1; a=1 a 1 a<=H a H a++ a++ a {
						for(b=1;b<=W;b++){
							System.out.print("#");
							}
						System.out.println();
						} {
						for(b=1;b<=W;b++){
							System.out.print("#");
							}
						System.out.println();
						} for(b=1;b<=W;b++){
							System.out.print("#");
							} b=1; b=1 b 1 b<=W b W b++ b++ b {
							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 public class Main{
	public static void main(String[] args){
		int a,b,W,H;
		Scanner br=new Scanner(System.in);
		while(true){
			H=br.nextInt();
			W=br.nextInt();
			if(H==0 && W==0){
				break;
				}else{
					for(a=1;a<=H;a++){
						for(b=1;b<=W;b++){
							System.out.print("#");
							}
						System.out.println();
						}
					System.out.println();
					}
			}
		}
	} public class Main{
	public static void main(String[] args){
		int a,b,W,H;
		Scanner br=new Scanner(System.in);
		while(true){
			H=br.nextInt();
			W=br.nextInt();
			if(H==0 && W==0){
				break;
				}else{
					for(a=1;a<=H;a++){
						for(b=1;b<=W;b++){
							System.out.print("#");
							}
						System.out.println();
						}
					System.out.println();
					}
			}
		}
	} Main
import java.util.Scanner;
public class Main{
	public static void main(String[] args){
		int a,b,W,H;
		Scanner br=new Scanner(System.in);
		while(true){
			H=br.nextInt();
			W=br.nextInt();
			if(H==0 && W==0){
				break;
				}else{
					for(a=1;a<=H;a++){
						for(b=1;b<=W;b++){
							System.out.print("#");
							}
						System.out.println();
						}
					System.out.println();
					}
			}
		}
	}