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

public class Main{
	public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		final String LINE_SEPARATOR = System.getProperty("line.separator");
		int H, W;
		while (true) {
			StringBuilder sb = new StringBuilder();
			String[] str = in.readLine().split(" ");
			H = Integer.parseInt(str[0]);
			W = Integer.parseInt(str[1]);
			if (H == 0 && W == 0)
				break;
			for (int i = 0; i < H; i += 1) {
				for (int j = 0; j < W; j += 1) {
					sb.append("#");
				}
				sb.append(LINE_SEPARATOR);
			}
			sb.append(LINE_SEPARATOR);
			System.out.print(sb);
		}
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main{
	public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		final String LINE_SEPARATOR = System.getProperty("line.separator");
		int H, W;
		while (true) {
			StringBuilder sb = new StringBuilder();
			String[] str = in.readLine().split(" ");
			H = Integer.parseInt(str[0]);
			W = Integer.parseInt(str[1]);
			if (H == 0 && W == 0)
				break;
			for (int i = 0; i < H; i += 1) {
				for (int j = 0; j < W; j += 1) {
					sb.append("#");
				}
				sb.append(LINE_SEPARATOR);
			}
			sb.append(LINE_SEPARATOR);
			System.out.print(sb);
		}
	}
} Main public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		final String LINE_SEPARATOR = System.getProperty("line.separator");
		int H, W;
		while (true) {
			StringBuilder sb = new StringBuilder();
			String[] str = in.readLine().split(" ");
			H = Integer.parseInt(str[0]);
			W = Integer.parseInt(str[1]);
			if (H == 0 && W == 0)
				break;
			for (int i = 0; i < H; i += 1) {
				for (int j = 0; j < W; j += 1) {
					sb.append("#");
				}
				sb.append(LINE_SEPARATOR);
			}
			sb.append(LINE_SEPARATOR);
			System.out.print(sb);
		}
	} main {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		final String LINE_SEPARATOR = System.getProperty("line.separator");
		int H, W;
		while (true) {
			StringBuilder sb = new StringBuilder();
			String[] str = in.readLine().split(" ");
			H = Integer.parseInt(str[0]);
			W = Integer.parseInt(str[1]);
			if (H == 0 && W == 0)
				break;
			for (int i = 0; i < H; i += 1) {
				for (int j = 0; j < W; j += 1) {
					sb.append("#");
				}
				sb.append(LINE_SEPARATOR);
			}
			sb.append(LINE_SEPARATOR);
			System.out.print(sb);
		}
	} BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); in new BufferedReader(new InputStreamReader(System.in)) final String LINE_SEPARATOR = System.getProperty("line.separator"); LINE_SEPARATOR System.getProperty("line.separator") System.getProperty System "line.separator" int H H W; W while (true) {
			StringBuilder sb = new StringBuilder();
			String[] str = in.readLine().split(" ");
			H = Integer.parseInt(str[0]);
			W = Integer.parseInt(str[1]);
			if (H == 0 && W == 0)
				break;
			for (int i = 0; i < H; i += 1) {
				for (int j = 0; j < W; j += 1) {
					sb.append("#");
				}
				sb.append(LINE_SEPARATOR);
			}
			sb.append(LINE_SEPARATOR);
			System.out.print(sb);
		} true {
			StringBuilder sb = new StringBuilder();
			String[] str = in.readLine().split(" ");
			H = Integer.parseInt(str[0]);
			W = Integer.parseInt(str[1]);
			if (H == 0 && W == 0)
				break;
			for (int i = 0; i < H; i += 1) {
				for (int j = 0; j < W; j += 1) {
					sb.append("#");
				}
				sb.append(LINE_SEPARATOR);
			}
			sb.append(LINE_SEPARATOR);
			System.out.print(sb);
		} StringBuilder sb = new StringBuilder(); sb new StringBuilder() String[] str = in.readLine().split(" "); str in.readLine().split(" ") in.readLine().split in.readLine() in.readLine in " " H = Integer.parseInt(str[0]) H Integer.parseInt(str[0]) Integer.parseInt Integer str[0] str 0 W = Integer.parseInt(str[1]) W Integer.parseInt(str[1]) Integer.parseInt Integer str[1] str 1 if (H == 0 && W == 0)
				break; H == 0 && W == 0 H == 0 H 0 W == 0 W 0 break; for (int i = 0; i < H; i += 1) {
				for (int j = 0; j < W; j += 1) {
					sb.append("#");
				}
				sb.append(LINE_SEPARATOR);
			} int i = 0; int i = 0; i 0 i < H i H i += 1 i += 1 i 1 {
				for (int j = 0; j < W; j += 1) {
					sb.append("#");
				}
				sb.append(LINE_SEPARATOR);
			} {
				for (int j = 0; j < W; j += 1) {
					sb.append("#");
				}
				sb.append(LINE_SEPARATOR);
			} for (int j = 0; j < W; j += 1) {
					sb.append("#");
				} int j = 0; int j = 0; j 0 j < W j W j += 1 j += 1 j 1 {
					sb.append("#");
				} {
					sb.append("#");
				} sb.append("#") sb.append sb "#" sb.append(LINE_SEPARATOR) sb.append sb LINE_SEPARATOR sb.append(LINE_SEPARATOR) sb.append sb LINE_SEPARATOR System.out.print(sb) System.out.print System.out System System.out sb String[] args args public class Main{
	public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		final String LINE_SEPARATOR = System.getProperty("line.separator");
		int H, W;
		while (true) {
			StringBuilder sb = new StringBuilder();
			String[] str = in.readLine().split(" ");
			H = Integer.parseInt(str[0]);
			W = Integer.parseInt(str[1]);
			if (H == 0 && W == 0)
				break;
			for (int i = 0; i < H; i += 1) {
				for (int j = 0; j < W; j += 1) {
					sb.append("#");
				}
				sb.append(LINE_SEPARATOR);
			}
			sb.append(LINE_SEPARATOR);
			System.out.print(sb);
		}
	}
} public class Main{
	public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		final String LINE_SEPARATOR = System.getProperty("line.separator");
		int H, W;
		while (true) {
			StringBuilder sb = new StringBuilder();
			String[] str = in.readLine().split(" ");
			H = Integer.parseInt(str[0]);
			W = Integer.parseInt(str[1]);
			if (H == 0 && W == 0)
				break;
			for (int i = 0; i < H; i += 1) {
				for (int j = 0; j < W; j += 1) {
					sb.append("#");
				}
				sb.append(LINE_SEPARATOR);
			}
			sb.append(LINE_SEPARATOR);
			System.out.print(sb);
		}
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main{
	public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		final String LINE_SEPARATOR = System.getProperty("line.separator");
		int H, W;
		while (true) {
			StringBuilder sb = new StringBuilder();
			String[] str = in.readLine().split(" ");
			H = Integer.parseInt(str[0]);
			W = Integer.parseInt(str[1]);
			if (H == 0 && W == 0)
				break;
			for (int i = 0; i < H; i += 1) {
				for (int j = 0; j < W; j += 1) {
					sb.append("#");
				}
				sb.append(LINE_SEPARATOR);
			}
			sb.append(LINE_SEPARATOR);
			System.out.print(sb);
		}
	}
}