import java.util.*;

class Main{
	int a;
	int b;
	public Main(){
		Scanner scan = new Scanner(System.in);
		for(;;){
			a=scan.nextInt();
			b=scan.nextInt();
			if(a==0 || b==0)break;
			for(int j=0; j<a; j++){
				for(int i=0; i<b; i++){
					System.out.print("#");
				}
				System.out.println("");
			}
			System.out.println("");
		}
	}
	public static void main(String[]args){
		new Main();
	}
} import java.util.*; util.* java class Main{
	int a;
	int b;
	public Main(){
		Scanner scan = new Scanner(System.in);
		for(;;){
			a=scan.nextInt();
			b=scan.nextInt();
			if(a==0 || b==0)break;
			for(int j=0; j<a; j++){
				for(int i=0; i<b; i++){
					System.out.print("#");
				}
				System.out.println("");
			}
			System.out.println("");
		}
	}
	public static void main(String[]args){
		new Main();
	}
} Main int a; a int b; b public Main(){
		Scanner scan = new Scanner(System.in);
		for(;;){
			a=scan.nextInt();
			b=scan.nextInt();
			if(a==0 || b==0)break;
			for(int j=0; j<a; j++){
				for(int i=0; i<b; i++){
					System.out.print("#");
				}
				System.out.println("");
			}
			System.out.println("");
		}
	} Main {
		Scanner scan = new Scanner(System.in);
		for(;;){
			a=scan.nextInt();
			b=scan.nextInt();
			if(a==0 || b==0)break;
			for(int j=0; j<a; j++){
				for(int i=0; i<b; i++){
					System.out.print("#");
				}
				System.out.println("");
			}
			System.out.println("");
		}
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) for(;;){
			a=scan.nextInt();
			b=scan.nextInt();
			if(a==0 || b==0)break;
			for(int j=0; j<a; j++){
				for(int i=0; i<b; i++){
					System.out.print("#");
				}
				System.out.println("");
			}
			System.out.println("");
		} ; {
			a=scan.nextInt();
			b=scan.nextInt();
			if(a==0 || b==0)break;
			for(int j=0; j<a; j++){
				for(int i=0; i<b; i++){
					System.out.print("#");
				}
				System.out.println("");
			}
			System.out.println("");
		} {
			a=scan.nextInt();
			b=scan.nextInt();
			if(a==0 || b==0)break;
			for(int j=0; j<a; j++){
				for(int i=0; i<b; i++){
					System.out.print("#");
				}
				System.out.println("");
			}
			System.out.println("");
		} a=scan.nextInt() a scan.nextInt() scan.nextInt scan b=scan.nextInt() b scan.nextInt() scan.nextInt scan if(a==0 || b==0)break; a==0 || b==0 a==0 a 0 b==0 b 0 break; for(int j=0; j<a; j++){
				for(int i=0; i<b; i++){
					System.out.print("#");
				}
				System.out.println("");
			} int j=0; int j=0; j 0 j<a j a j++ j++ j {
				for(int i=0; i<b; i++){
					System.out.print("#");
				}
				System.out.println("");
			} {
				for(int i=0; i<b; i++){
					System.out.print("#");
				}
				System.out.println("");
			} for(int i=0; i<b; i++){
					System.out.print("#");
				} int i=0; int i=0; i 0 i<b i b i++ i++ i {
					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 "" public static void main(String[]args){
		new Main();
	} main {
		new Main();
	} new Main() String[]args args
import java.util.*;

class Main{
	int a;
	int b;
	public Main(){
		Scanner scan = new Scanner(System.in);
		for(;;){
			a=scan.nextInt();
			b=scan.nextInt();
			if(a==0 || b==0)break;
			for(int j=0; j<a; j++){
				for(int i=0; i<b; i++){
					System.out.print("#");
				}
				System.out.println("");
			}
			System.out.println("");
		}
	}
	public static void main(String[]args){
		new Main();
	}
}