import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int h=sc.nextInt();
		int w=sc.nextInt();
		while (h!=0||w!=0){
			StringBuilder sb1=new StringBuilder("");
			for(int n=0;n<h;n++){
				for(int m=0;m<w;m++){sb1.append("#");}
				sb1.append("\n");
			}
			System.out.println(sb1);
			h=sc.nextInt();
			w=sc.nextInt();
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int h=sc.nextInt();
		int w=sc.nextInt();
		while (h!=0||w!=0){
			StringBuilder sb1=new StringBuilder("");
			for(int n=0;n<h;n++){
				for(int m=0;m<w;m++){sb1.append("#");}
				sb1.append("\n");
			}
			System.out.println(sb1);
			h=sc.nextInt();
			w=sc.nextInt();
		}
	}
} Main public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int h=sc.nextInt();
		int w=sc.nextInt();
		while (h!=0||w!=0){
			StringBuilder sb1=new StringBuilder("");
			for(int n=0;n<h;n++){
				for(int m=0;m<w;m++){sb1.append("#");}
				sb1.append("\n");
			}
			System.out.println(sb1);
			h=sc.nextInt();
			w=sc.nextInt();
		}
	} main {
		Scanner sc=new Scanner(System.in);
		int h=sc.nextInt();
		int w=sc.nextInt();
		while (h!=0||w!=0){
			StringBuilder sb1=new StringBuilder("");
			for(int n=0;n<h;n++){
				for(int m=0;m<w;m++){sb1.append("#");}
				sb1.append("\n");
			}
			System.out.println(sb1);
			h=sc.nextInt();
			w=sc.nextInt();
		}
	} Scanner sc=new Scanner(System.in); sc new Scanner(System.in) int h=sc.nextInt(); h sc.nextInt() sc.nextInt sc int w=sc.nextInt(); w sc.nextInt() sc.nextInt sc while (h!=0||w!=0){
			StringBuilder sb1=new StringBuilder("");
			for(int n=0;n<h;n++){
				for(int m=0;m<w;m++){sb1.append("#");}
				sb1.append("\n");
			}
			System.out.println(sb1);
			h=sc.nextInt();
			w=sc.nextInt();
		} h!=0||w!=0 h!=0 h 0 w!=0 w 0 {
			StringBuilder sb1=new StringBuilder("");
			for(int n=0;n<h;n++){
				for(int m=0;m<w;m++){sb1.append("#");}
				sb1.append("\n");
			}
			System.out.println(sb1);
			h=sc.nextInt();
			w=sc.nextInt();
		} StringBuilder sb1=new StringBuilder(""); sb1 new StringBuilder("") for(int n=0;n<h;n++){
				for(int m=0;m<w;m++){sb1.append("#");}
				sb1.append("\n");
			} int n=0; int n=0; n 0 n<h n h n++ n++ n {
				for(int m=0;m<w;m++){sb1.append("#");}
				sb1.append("\n");
			} {
				for(int m=0;m<w;m++){sb1.append("#");}
				sb1.append("\n");
			} for(int m=0;m<w;m++){sb1.append("#");} int m=0; int m=0; m 0 m<w m w m++ m++ m {sb1.append("#");} {sb1.append("#");} sb1.append("#") sb1.append sb1 "#" sb1.append("\n") sb1.append sb1 "\n" System.out.println(sb1) System.out.println System.out System System.out sb1 h=sc.nextInt() h sc.nextInt() sc.nextInt sc w=sc.nextInt() w sc.nextInt() sc.nextInt sc String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int h=sc.nextInt();
		int w=sc.nextInt();
		while (h!=0||w!=0){
			StringBuilder sb1=new StringBuilder("");
			for(int n=0;n<h;n++){
				for(int m=0;m<w;m++){sb1.append("#");}
				sb1.append("\n");
			}
			System.out.println(sb1);
			h=sc.nextInt();
			w=sc.nextInt();
		}
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int h=sc.nextInt();
		int w=sc.nextInt();
		while (h!=0||w!=0){
			StringBuilder sb1=new StringBuilder("");
			for(int n=0;n<h;n++){
				for(int m=0;m<w;m++){sb1.append("#");}
				sb1.append("\n");
			}
			System.out.println(sb1);
			h=sc.nextInt();
			w=sc.nextInt();
		}
	}
} Main
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int h=sc.nextInt();
		int w=sc.nextInt();
		while (h!=0||w!=0){
			StringBuilder sb1=new StringBuilder("");
			for(int n=0;n<h;n++){
				for(int m=0;m<w;m++){sb1.append("#");}
				sb1.append("\n");
			}
			System.out.println(sb1);
			h=sc.nextInt();
			w=sc.nextInt();
		}
	}
}