		import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
StringBuilder sb=new StringBuilder("");
		int H=sc.nextInt(),W=sc.nextInt();
		while (H!=0 || W!=0){
			for (int m=1;m<=W;m++){
			sb.append("#");}
		for (int n=1;n<=H;n++){System.out.println(sb);}
			System.out.println();
			sb.delete(0,W);
			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);
StringBuilder sb=new StringBuilder("");
		int H=sc.nextInt(),W=sc.nextInt();
		while (H!=0 || W!=0){
			for (int m=1;m<=W;m++){
			sb.append("#");}
		for (int n=1;n<=H;n++){System.out.println(sb);}
			System.out.println();
			sb.delete(0,W);
			H=sc.nextInt();W=sc.nextInt();
				}}} Main public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
StringBuilder sb=new StringBuilder("");
		int H=sc.nextInt(),W=sc.nextInt();
		while (H!=0 || W!=0){
			for (int m=1;m<=W;m++){
			sb.append("#");}
		for (int n=1;n<=H;n++){System.out.println(sb);}
			System.out.println();
			sb.delete(0,W);
			H=sc.nextInt();W=sc.nextInt();
				}} main {
		Scanner sc=new Scanner(System.in);
StringBuilder sb=new StringBuilder("");
		int H=sc.nextInt(),W=sc.nextInt();
		while (H!=0 || W!=0){
			for (int m=1;m<=W;m++){
			sb.append("#");}
		for (int n=1;n<=H;n++){System.out.println(sb);}
			System.out.println();
			sb.delete(0,W);
			H=sc.nextInt();W=sc.nextInt();
				}} Scanner sc=new Scanner(System.in); sc new Scanner(System.in) StringBuilder sb=new StringBuilder(""); sb new StringBuilder("") int H=sc.nextInt() H sc.nextInt() sc.nextInt sc W=sc.nextInt(); W sc.nextInt() sc.nextInt sc while (H!=0 || W!=0){
			for (int m=1;m<=W;m++){
			sb.append("#");}
		for (int n=1;n<=H;n++){System.out.println(sb);}
			System.out.println();
			sb.delete(0,W);
			H=sc.nextInt();W=sc.nextInt();
				} H!=0 || W!=0 H!=0 H 0 W!=0 W 0 {
			for (int m=1;m<=W;m++){
			sb.append("#");}
		for (int n=1;n<=H;n++){System.out.println(sb);}
			System.out.println();
			sb.delete(0,W);
			H=sc.nextInt();W=sc.nextInt();
				} for (int m=1;m<=W;m++){
			sb.append("#");} int m=1; int m=1; m 1 m<=W m W m++ m++ m {
			sb.append("#");} {
			sb.append("#");} sb.append("#") sb.append sb "#" for (int n=1;n<=H;n++){System.out.println(sb);} int n=1; int n=1; n 1 n<=H n H n++ n++ n {System.out.println(sb);} {System.out.println(sb);} System.out.println(sb) System.out.println System.out System System.out sb System.out.println() System.out.println System.out System System.out sb.delete(0,W) sb.delete sb 0 W 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);
StringBuilder sb=new StringBuilder("");
		int H=sc.nextInt(),W=sc.nextInt();
		while (H!=0 || W!=0){
			for (int m=1;m<=W;m++){
			sb.append("#");}
		for (int n=1;n<=H;n++){System.out.println(sb);}
			System.out.println();
			sb.delete(0,W);
			H=sc.nextInt();W=sc.nextInt();
				}}} public class Main {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
StringBuilder sb=new StringBuilder("");
		int H=sc.nextInt(),W=sc.nextInt();
		while (H!=0 || W!=0){
			for (int m=1;m<=W;m++){
			sb.append("#");}
		for (int n=1;n<=H;n++){System.out.println(sb);}
			System.out.println();
			sb.delete(0,W);
			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);
StringBuilder sb=new StringBuilder("");
		int H=sc.nextInt(),W=sc.nextInt();
		while (H!=0 || W!=0){
			for (int m=1;m<=W;m++){
			sb.append("#");}
		for (int n=1;n<=H;n++){System.out.println(sb);}
			System.out.println();
			sb.delete(0,W);
			H=sc.nextInt();W=sc.nextInt();
				}}}