import java.io.*;

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb;
		String[] strs;
		int H, W;
		
		do {
			sb = new StringBuilder();
			
			strs = br.readLine().split("\\s+");
			
			H = Integer.parseInt(strs[0]);
			W = Integer.parseInt(strs[1]);
			
			if (H == 0 && W == 0) break;
			
			for (int i = 0; i < H; i++) {
				for (int j = 0; j < W; j++) sb.append("#");
				sb.append("\n");
			}
			
			System.out.println(sb);
		} while (true);
	}
} import java.io.*; io.* java public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb;
		String[] strs;
		int H, W;
		
		do {
			sb = new StringBuilder();
			
			strs = br.readLine().split("\\s+");
			
			H = Integer.parseInt(strs[0]);
			W = Integer.parseInt(strs[1]);
			
			if (H == 0 && W == 0) break;
			
			for (int i = 0; i < H; i++) {
				for (int j = 0; j < W; j++) sb.append("#");
				sb.append("\n");
			}
			
			System.out.println(sb);
		} while (true);
	}
} Main public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb;
		String[] strs;
		int H, W;
		
		do {
			sb = new StringBuilder();
			
			strs = br.readLine().split("\\s+");
			
			H = Integer.parseInt(strs[0]);
			W = Integer.parseInt(strs[1]);
			
			if (H == 0 && W == 0) break;
			
			for (int i = 0; i < H; i++) {
				for (int j = 0; j < W; j++) sb.append("#");
				sb.append("\n");
			}
			
			System.out.println(sb);
		} while (true);
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb;
		String[] strs;
		int H, W;
		
		do {
			sb = new StringBuilder();
			
			strs = br.readLine().split("\\s+");
			
			H = Integer.parseInt(strs[0]);
			W = Integer.parseInt(strs[1]);
			
			if (H == 0 && W == 0) break;
			
			for (int i = 0; i < H; i++) {
				for (int j = 0; j < W; j++) sb.append("#");
				sb.append("\n");
			}
			
			System.out.println(sb);
		} while (true);
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) StringBuilder sb; sb String[] strs; strs int H H W; W do {
			sb = new StringBuilder();
			
			strs = br.readLine().split("\\s+");
			
			H = Integer.parseInt(strs[0]);
			W = Integer.parseInt(strs[1]);
			
			if (H == 0 && W == 0) break;
			
			for (int i = 0; i < H; i++) {
				for (int j = 0; j < W; j++) sb.append("#");
				sb.append("\n");
			}
			
			System.out.println(sb);
		} while (true); true {
			sb = new StringBuilder();
			
			strs = br.readLine().split("\\s+");
			
			H = Integer.parseInt(strs[0]);
			W = Integer.parseInt(strs[1]);
			
			if (H == 0 && W == 0) break;
			
			for (int i = 0; i < H; i++) {
				for (int j = 0; j < W; j++) sb.append("#");
				sb.append("\n");
			}
			
			System.out.println(sb);
		} sb = new StringBuilder() sb new StringBuilder() strs = br.readLine().split("\\s+") strs br.readLine().split("\\s+") br.readLine().split br.readLine() br.readLine br "\\s+" H = Integer.parseInt(strs[0]) H Integer.parseInt(strs[0]) Integer.parseInt Integer strs[0] strs 0 W = Integer.parseInt(strs[1]) W Integer.parseInt(strs[1]) Integer.parseInt Integer strs[1] strs 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++) {
				for (int j = 0; j < W; j++) sb.append("#");
				sb.append("\n");
			} int i = 0; int i = 0; i 0 i < H i H i++ i++ i {
				for (int j = 0; j < W; j++) sb.append("#");
				sb.append("\n");
			} {
				for (int j = 0; j < W; j++) sb.append("#");
				sb.append("\n");
			} for (int j = 0; j < W; j++) sb.append("#"); int j = 0; int j = 0; j 0 j < W j W j++ j++ j sb.append("#"); sb.append("#") sb.append sb "#" sb.append("\n") sb.append sb "\n" System.out.println(sb) System.out.println System.out System System.out sb String[] args args public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb;
		String[] strs;
		int H, W;
		
		do {
			sb = new StringBuilder();
			
			strs = br.readLine().split("\\s+");
			
			H = Integer.parseInt(strs[0]);
			W = Integer.parseInt(strs[1]);
			
			if (H == 0 && W == 0) break;
			
			for (int i = 0; i < H; i++) {
				for (int j = 0; j < W; j++) sb.append("#");
				sb.append("\n");
			}
			
			System.out.println(sb);
		} while (true);
	}
} public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb;
		String[] strs;
		int H, W;
		
		do {
			sb = new StringBuilder();
			
			strs = br.readLine().split("\\s+");
			
			H = Integer.parseInt(strs[0]);
			W = Integer.parseInt(strs[1]);
			
			if (H == 0 && W == 0) break;
			
			for (int i = 0; i < H; i++) {
				for (int j = 0; j < W; j++) sb.append("#");
				sb.append("\n");
			}
			
			System.out.println(sb);
		} while (true);
	}
} Main
import java.io.*;

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb;
		String[] strs;
		int H, W;
		
		do {
			sb = new StringBuilder();
			
			strs = br.readLine().split("\\s+");
			
			H = Integer.parseInt(strs[0]);
			W = Integer.parseInt(strs[1]);
			
			if (H == 0 && W == 0) break;
			
			for (int i = 0; i < H; i++) {
				for (int j = 0; j < W; j++) sb.append("#");
				sb.append("\n");
			}
			
			System.out.println(sb);
		} while (true);
	}
}