import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;

class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String strNum = "";
		ArrayList<String> squea = new ArrayList<String>();
		while (true) {
			strNum = br.readLine();
			if ("0 0".equals(strNum)) {
				break;
			}
			for (int i = 0; i < Integer.parseInt(strNum.split(" ")[0]); i++) {
				String line = "";
				for (int j = 0; j < Integer.parseInt(strNum.split(" ")[1]); j++) {
					line += "#";
				}
				squea.add(line);
			}
			squea.add("");
		}
		for (int i = 0; i < squea.size(); i++) {
			System.out.println(squea.get(i));
		}
	}

} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.ArrayList; ArrayList java.util class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String strNum = "";
		ArrayList<String> squea = new ArrayList<String>();
		while (true) {
			strNum = br.readLine();
			if ("0 0".equals(strNum)) {
				break;
			}
			for (int i = 0; i < Integer.parseInt(strNum.split(" ")[0]); i++) {
				String line = "";
				for (int j = 0; j < Integer.parseInt(strNum.split(" ")[1]); j++) {
					line += "#";
				}
				squea.add(line);
			}
			squea.add("");
		}
		for (int i = 0; i < squea.size(); i++) {
			System.out.println(squea.get(i));
		}
	}

} Main public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String strNum = "";
		ArrayList<String> squea = new ArrayList<String>();
		while (true) {
			strNum = br.readLine();
			if ("0 0".equals(strNum)) {
				break;
			}
			for (int i = 0; i < Integer.parseInt(strNum.split(" ")[0]); i++) {
				String line = "";
				for (int j = 0; j < Integer.parseInt(strNum.split(" ")[1]); j++) {
					line += "#";
				}
				squea.add(line);
			}
			squea.add("");
		}
		for (int i = 0; i < squea.size(); i++) {
			System.out.println(squea.get(i));
		}
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String strNum = "";
		ArrayList<String> squea = new ArrayList<String>();
		while (true) {
			strNum = br.readLine();
			if ("0 0".equals(strNum)) {
				break;
			}
			for (int i = 0; i < Integer.parseInt(strNum.split(" ")[0]); i++) {
				String line = "";
				for (int j = 0; j < Integer.parseInt(strNum.split(" ")[1]); j++) {
					line += "#";
				}
				squea.add(line);
			}
			squea.add("");
		}
		for (int i = 0; i < squea.size(); i++) {
			System.out.println(squea.get(i));
		}
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String strNum = ""; strNum "" ArrayList<String> squea = new ArrayList<String>(); squea new ArrayList<String>() while (true) {
			strNum = br.readLine();
			if ("0 0".equals(strNum)) {
				break;
			}
			for (int i = 0; i < Integer.parseInt(strNum.split(" ")[0]); i++) {
				String line = "";
				for (int j = 0; j < Integer.parseInt(strNum.split(" ")[1]); j++) {
					line += "#";
				}
				squea.add(line);
			}
			squea.add("");
		} true {
			strNum = br.readLine();
			if ("0 0".equals(strNum)) {
				break;
			}
			for (int i = 0; i < Integer.parseInt(strNum.split(" ")[0]); i++) {
				String line = "";
				for (int j = 0; j < Integer.parseInt(strNum.split(" ")[1]); j++) {
					line += "#";
				}
				squea.add(line);
			}
			squea.add("");
		} strNum = br.readLine() strNum br.readLine() br.readLine br if ("0 0".equals(strNum)) {
				break;
			} "0 0".equals(strNum) "0 0".equals "0 0" strNum {
				break;
			} break; for (int i = 0; i < Integer.parseInt(strNum.split(" ")[0]); i++) {
				String line = "";
				for (int j = 0; j < Integer.parseInt(strNum.split(" ")[1]); j++) {
					line += "#";
				}
				squea.add(line);
			} int i = 0; int i = 0; i 0 i < Integer.parseInt(strNum.split(" ")[0]) i Integer.parseInt(strNum.split(" ")[0]) Integer.parseInt Integer strNum.split(" ")[0] strNum.split(" ") strNum.split strNum " " 0 i++ i++ i {
				String line = "";
				for (int j = 0; j < Integer.parseInt(strNum.split(" ")[1]); j++) {
					line += "#";
				}
				squea.add(line);
			} {
				String line = "";
				for (int j = 0; j < Integer.parseInt(strNum.split(" ")[1]); j++) {
					line += "#";
				}
				squea.add(line);
			} String line = ""; line "" for (int j = 0; j < Integer.parseInt(strNum.split(" ")[1]); j++) {
					line += "#";
				} int j = 0; int j = 0; j 0 j < Integer.parseInt(strNum.split(" ")[1]) j Integer.parseInt(strNum.split(" ")[1]) Integer.parseInt Integer strNum.split(" ")[1] strNum.split(" ") strNum.split strNum " " 1 j++ j++ j {
					line += "#";
				} {
					line += "#";
				} line += "#" line "#" squea.add(line) squea.add squea line squea.add("") squea.add squea "" for (int i = 0; i < squea.size(); i++) {
			System.out.println(squea.get(i));
		} int i = 0; int i = 0; i 0 i < squea.size() i squea.size() squea.size squea i++ i++ i {
			System.out.println(squea.get(i));
		} {
			System.out.println(squea.get(i));
		} System.out.println(squea.get(i)) System.out.println System.out System System.out squea.get(i) squea.get squea i String[] args args
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;

class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String strNum = "";
		ArrayList<String> squea = new ArrayList<String>();
		while (true) {
			strNum = br.readLine();
			if ("0 0".equals(strNum)) {
				break;
			}
			for (int i = 0; i < Integer.parseInt(strNum.split(" ")[0]); i++) {
				String line = "";
				for (int j = 0; j < Integer.parseInt(strNum.split(" ")[1]); j++) {
					line += "#";
				}
				squea.add(line);
			}
			squea.add("");
		}
		for (int i = 0; i < squea.size(); i++) {
			System.out.println(squea.get(i));
		}
	}

}