public class Main {
	public static void main(String[] args) {
		java.util.Scanner sc = new java.util.Scanner(System.in);
		StringBuilder sb = new StringBuilder();

		int l =0;
		int [][] ar = new int[0][2];
		int [][] arc = new int[0][2];
		while (true) {
			int h = sc.nextInt();
			int w = sc.nextInt();
			if (h == 0 && w == 0) {
				break;
			}
			l++;
			ar = new int[l][2];
			for (int i = 0; i < l - 1; i++) {
				ar[i] = arc[i];
			}
			ar[l - 1] = new int[] { h, w };
			arc = new int[l][2];
			for (int i = 0; i < l; i++) {
				arc[i] = ar[i];
			}
		}

		for (int i = 0; i < ar.length; i++) {
			int h = ar[i][0];
			int w = ar[i][1];

			String sYoko = "";
			for (int j = 0; j < w; j++) {
				sYoko = sYoko + "#";
			}
			//String sHako = "";
			for (int j = 0; j < h; j++) {
				//sHako = sHako + sYoko + "\n";
				System.out.println(sYoko);
			}
			System.out.println();
		}
	}
} public class Main {
	public static void main(String[] args) {
		java.util.Scanner sc = new java.util.Scanner(System.in);
		StringBuilder sb = new StringBuilder();

		int l =0;
		int [][] ar = new int[0][2];
		int [][] arc = new int[0][2];
		while (true) {
			int h = sc.nextInt();
			int w = sc.nextInt();
			if (h == 0 && w == 0) {
				break;
			}
			l++;
			ar = new int[l][2];
			for (int i = 0; i < l - 1; i++) {
				ar[i] = arc[i];
			}
			ar[l - 1] = new int[] { h, w };
			arc = new int[l][2];
			for (int i = 0; i < l; i++) {
				arc[i] = ar[i];
			}
		}

		for (int i = 0; i < ar.length; i++) {
			int h = ar[i][0];
			int w = ar[i][1];

			String sYoko = "";
			for (int j = 0; j < w; j++) {
				sYoko = sYoko + "#";
			}
			//String sHako = "";
			for (int j = 0; j < h; j++) {
				//sHako = sHako + sYoko + "\n";
				System.out.println(sYoko);
			}
			System.out.println();
		}
	}
} Main public static void main(String[] args) {
		java.util.Scanner sc = new java.util.Scanner(System.in);
		StringBuilder sb = new StringBuilder();

		int l =0;
		int [][] ar = new int[0][2];
		int [][] arc = new int[0][2];
		while (true) {
			int h = sc.nextInt();
			int w = sc.nextInt();
			if (h == 0 && w == 0) {
				break;
			}
			l++;
			ar = new int[l][2];
			for (int i = 0; i < l - 1; i++) {
				ar[i] = arc[i];
			}
			ar[l - 1] = new int[] { h, w };
			arc = new int[l][2];
			for (int i = 0; i < l; i++) {
				arc[i] = ar[i];
			}
		}

		for (int i = 0; i < ar.length; i++) {
			int h = ar[i][0];
			int w = ar[i][1];

			String sYoko = "";
			for (int j = 0; j < w; j++) {
				sYoko = sYoko + "#";
			}
			//String sHako = "";
			for (int j = 0; j < h; j++) {
				//sHako = sHako + sYoko + "\n";
				System.out.println(sYoko);
			}
			System.out.println();
		}
	} main {
		java.util.Scanner sc = new java.util.Scanner(System.in);
		StringBuilder sb = new StringBuilder();

		int l =0;
		int [][] ar = new int[0][2];
		int [][] arc = new int[0][2];
		while (true) {
			int h = sc.nextInt();
			int w = sc.nextInt();
			if (h == 0 && w == 0) {
				break;
			}
			l++;
			ar = new int[l][2];
			for (int i = 0; i < l - 1; i++) {
				ar[i] = arc[i];
			}
			ar[l - 1] = new int[] { h, w };
			arc = new int[l][2];
			for (int i = 0; i < l; i++) {
				arc[i] = ar[i];
			}
		}

		for (int i = 0; i < ar.length; i++) {
			int h = ar[i][0];
			int w = ar[i][1];

			String sYoko = "";
			for (int j = 0; j < w; j++) {
				sYoko = sYoko + "#";
			}
			//String sHako = "";
			for (int j = 0; j < h; j++) {
				//sHako = sHako + sYoko + "\n";
				System.out.println(sYoko);
			}
			System.out.println();
		}
	} java.util.Scanner sc = new java.util.Scanner(System.in); sc new java.util.Scanner(System.in) StringBuilder sb = new StringBuilder(); sb new StringBuilder() int l =0; l 0 int [][] ar = new int[0][2]; ar new int[0][2] 0 2 int [][] arc = new int[0][2]; arc new int[0][2] 0 2 while (true) {
			int h = sc.nextInt();
			int w = sc.nextInt();
			if (h == 0 && w == 0) {
				break;
			}
			l++;
			ar = new int[l][2];
			for (int i = 0; i < l - 1; i++) {
				ar[i] = arc[i];
			}
			ar[l - 1] = new int[] { h, w };
			arc = new int[l][2];
			for (int i = 0; i < l; i++) {
				arc[i] = ar[i];
			}
		} true {
			int h = sc.nextInt();
			int w = sc.nextInt();
			if (h == 0 && w == 0) {
				break;
			}
			l++;
			ar = new int[l][2];
			for (int i = 0; i < l - 1; i++) {
				ar[i] = arc[i];
			}
			ar[l - 1] = new int[] { h, w };
			arc = new int[l][2];
			for (int i = 0; i < l; i++) {
				arc[i] = ar[i];
			}
		} int h = sc.nextInt(); h sc.nextInt() sc.nextInt sc int w = sc.nextInt(); w sc.nextInt() sc.nextInt sc if (h == 0 && w == 0) {
				break;
			} h == 0 && w == 0 h == 0 h 0 w == 0 w 0 {
				break;
			} break; l++ l ar = new int[l][2] ar new int[l][2] l 2 for (int i = 0; i < l - 1; i++) {
				ar[i] = arc[i];
			} int i = 0; int i = 0; i 0 i < l - 1 i l - 1 l 1 i++ i++ i {
				ar[i] = arc[i];
			} {
				ar[i] = arc[i];
			} ar[i] = arc[i] ar[i] ar i arc[i] arc i ar[l - 1] = new int[] { h, w } ar[l - 1] ar l - 1 l 1 new int[] { h, w } arc = new int[l][2] arc new int[l][2] l 2 for (int i = 0; i < l; i++) {
				arc[i] = ar[i];
			} int i = 0; int i = 0; i 0 i < l i l i++ i++ i {
				arc[i] = ar[i];
			} {
				arc[i] = ar[i];
			} arc[i] = ar[i] arc[i] arc i ar[i] ar i for (int i = 0; i < ar.length; i++) {
			int h = ar[i][0];
			int w = ar[i][1];

			String sYoko = "";
			for (int j = 0; j < w; j++) {
				sYoko = sYoko + "#";
			}
			//String sHako = "";
			for (int j = 0; j < h; j++) {
				//sHako = sHako + sYoko + "\n";
				System.out.println(sYoko);
			}
			System.out.println();
		} int i = 0; int i = 0; i 0 i < ar.length i ar.length ar ar.length i++ i++ i {
			int h = ar[i][0];
			int w = ar[i][1];

			String sYoko = "";
			for (int j = 0; j < w; j++) {
				sYoko = sYoko + "#";
			}
			//String sHako = "";
			for (int j = 0; j < h; j++) {
				//sHako = sHako + sYoko + "\n";
				System.out.println(sYoko);
			}
			System.out.println();
		} {
			int h = ar[i][0];
			int w = ar[i][1];

			String sYoko = "";
			for (int j = 0; j < w; j++) {
				sYoko = sYoko + "#";
			}
			//String sHako = "";
			for (int j = 0; j < h; j++) {
				//sHako = sHako + sYoko + "\n";
				System.out.println(sYoko);
			}
			System.out.println();
		} int h = ar[i][0]; h ar[i][0] ar[i] ar i 0 int w = ar[i][1]; w ar[i][1] ar[i] ar i 1 String sYoko = ""; sYoko "" for (int j = 0; j < w; j++) {
				sYoko = sYoko + "#";
			} int j = 0; int j = 0; j 0 j < w j w j++ j++ j {
				sYoko = sYoko + "#";
			} {
				sYoko = sYoko + "#";
			} sYoko = sYoko + "#" sYoko sYoko + "#" sYoko "#" for (int j = 0; j < h; j++) {
				//sHako = sHako + sYoko + "\n";
				System.out.println(sYoko);
			} int j = 0; int j = 0; j 0 j < h j h j++ j++ j {
				//sHako = sHako + sYoko + "\n";
				System.out.println(sYoko);
			} {
				//sHako = sHako + sYoko + "\n";
				System.out.println(sYoko);
			} System.out.println(sYoko) System.out.println System.out System System.out sYoko System.out.println() System.out.println System.out System System.out String[] args args public class Main {
	public static void main(String[] args) {
		java.util.Scanner sc = new java.util.Scanner(System.in);
		StringBuilder sb = new StringBuilder();

		int l =0;
		int [][] ar = new int[0][2];
		int [][] arc = new int[0][2];
		while (true) {
			int h = sc.nextInt();
			int w = sc.nextInt();
			if (h == 0 && w == 0) {
				break;
			}
			l++;
			ar = new int[l][2];
			for (int i = 0; i < l - 1; i++) {
				ar[i] = arc[i];
			}
			ar[l - 1] = new int[] { h, w };
			arc = new int[l][2];
			for (int i = 0; i < l; i++) {
				arc[i] = ar[i];
			}
		}

		for (int i = 0; i < ar.length; i++) {
			int h = ar[i][0];
			int w = ar[i][1];

			String sYoko = "";
			for (int j = 0; j < w; j++) {
				sYoko = sYoko + "#";
			}
			//String sHako = "";
			for (int j = 0; j < h; j++) {
				//sHako = sHako + sYoko + "\n";
				System.out.println(sYoko);
			}
			System.out.println();
		}
	}
} public class Main {
	public static void main(String[] args) {
		java.util.Scanner sc = new java.util.Scanner(System.in);
		StringBuilder sb = new StringBuilder();

		int l =0;
		int [][] ar = new int[0][2];
		int [][] arc = new int[0][2];
		while (true) {
			int h = sc.nextInt();
			int w = sc.nextInt();
			if (h == 0 && w == 0) {
				break;
			}
			l++;
			ar = new int[l][2];
			for (int i = 0; i < l - 1; i++) {
				ar[i] = arc[i];
			}
			ar[l - 1] = new int[] { h, w };
			arc = new int[l][2];
			for (int i = 0; i < l; i++) {
				arc[i] = ar[i];
			}
		}

		for (int i = 0; i < ar.length; i++) {
			int h = ar[i][0];
			int w = ar[i][1];

			String sYoko = "";
			for (int j = 0; j < w; j++) {
				sYoko = sYoko + "#";
			}
			//String sHako = "";
			for (int j = 0; j < h; j++) {
				//sHako = sHako + sYoko + "\n";
				System.out.println(sYoko);
			}
			System.out.println();
		}
	}
} Main
public class Main {
	public static void main(String[] args) {
		java.util.Scanner sc = new java.util.Scanner(System.in);
		StringBuilder sb = new StringBuilder();

		int l =0;
		int [][] ar = new int[0][2];
		int [][] arc = new int[0][2];
		while (true) {
			int h = sc.nextInt();
			int w = sc.nextInt();
			if (h == 0 && w == 0) {
				break;
			}
			l++;
			ar = new int[l][2];
			for (int i = 0; i < l - 1; i++) {
				ar[i] = arc[i];
			}
			ar[l - 1] = new int[] { h, w };
			arc = new int[l][2];
			for (int i = 0; i < l; i++) {
				arc[i] = ar[i];
			}
		}

		for (int i = 0; i < ar.length; i++) {
			int h = ar[i][0];
			int w = ar[i][1];

			String sYoko = "";
			for (int j = 0; j < w; j++) {
				sYoko = sYoko + "#";
			}
			//String sHako = "";
			for (int j = 0; j < h; j++) {
				//sHako = sHako + sYoko + "\n";
				System.out.println(sYoko);
			}
			System.out.println();
		}
	}
}