import java.io.BufferedInputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main{
	public static void main(String[] args) {
		Scanner stdin = new Scanner(new BufferedInputStream(System.in));
		List<String> output = new ArrayList<String>();
		while (stdin.hasNext()) {
			String input = stdin.nextLine();
			String[] inputs = input.split(" ");
			int h = Integer.parseInt(inputs[0]);
			int w = Integer.parseInt(inputs[1]);
			if (h == 0 && w == 0) {
				break;
			} else {
				if (h >= 1 && h <= 300 && w >= 1 && w <= 300) {
                    for (int i = 1; i <= h; i++) {
                        String result = "";
                        for (int j = 1; j <= w; j++) {
                            result += "#";
                        }
                        output.add(result);
                    }
                    output.add("");
				}
			}
		}
		for (String out : output) {
            System.out.println(out);
        }


	}

} import java.io.BufferedInputStream; BufferedInputStream java.io import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util import java.util.Scanner; Scanner java.util public class Main{
	public static void main(String[] args) {
		Scanner stdin = new Scanner(new BufferedInputStream(System.in));
		List<String> output = new ArrayList<String>();
		while (stdin.hasNext()) {
			String input = stdin.nextLine();
			String[] inputs = input.split(" ");
			int h = Integer.parseInt(inputs[0]);
			int w = Integer.parseInt(inputs[1]);
			if (h == 0 && w == 0) {
				break;
			} else {
				if (h >= 1 && h <= 300 && w >= 1 && w <= 300) {
                    for (int i = 1; i <= h; i++) {
                        String result = "";
                        for (int j = 1; j <= w; j++) {
                            result += "#";
                        }
                        output.add(result);
                    }
                    output.add("");
				}
			}
		}
		for (String out : output) {
            System.out.println(out);
        }


	}

} Main public static void main(String[] args) {
		Scanner stdin = new Scanner(new BufferedInputStream(System.in));
		List<String> output = new ArrayList<String>();
		while (stdin.hasNext()) {
			String input = stdin.nextLine();
			String[] inputs = input.split(" ");
			int h = Integer.parseInt(inputs[0]);
			int w = Integer.parseInt(inputs[1]);
			if (h == 0 && w == 0) {
				break;
			} else {
				if (h >= 1 && h <= 300 && w >= 1 && w <= 300) {
                    for (int i = 1; i <= h; i++) {
                        String result = "";
                        for (int j = 1; j <= w; j++) {
                            result += "#";
                        }
                        output.add(result);
                    }
                    output.add("");
				}
			}
		}
		for (String out : output) {
            System.out.println(out);
        }


	} main {
		Scanner stdin = new Scanner(new BufferedInputStream(System.in));
		List<String> output = new ArrayList<String>();
		while (stdin.hasNext()) {
			String input = stdin.nextLine();
			String[] inputs = input.split(" ");
			int h = Integer.parseInt(inputs[0]);
			int w = Integer.parseInt(inputs[1]);
			if (h == 0 && w == 0) {
				break;
			} else {
				if (h >= 1 && h <= 300 && w >= 1 && w <= 300) {
                    for (int i = 1; i <= h; i++) {
                        String result = "";
                        for (int j = 1; j <= w; j++) {
                            result += "#";
                        }
                        output.add(result);
                    }
                    output.add("");
				}
			}
		}
		for (String out : output) {
            System.out.println(out);
        }


	} Scanner stdin = new Scanner(new BufferedInputStream(System.in)); stdin new Scanner(new BufferedInputStream(System.in)) List<String> output = new ArrayList<String>(); output new ArrayList<String>() while (stdin.hasNext()) {
			String input = stdin.nextLine();
			String[] inputs = input.split(" ");
			int h = Integer.parseInt(inputs[0]);
			int w = Integer.parseInt(inputs[1]);
			if (h == 0 && w == 0) {
				break;
			} else {
				if (h >= 1 && h <= 300 && w >= 1 && w <= 300) {
                    for (int i = 1; i <= h; i++) {
                        String result = "";
                        for (int j = 1; j <= w; j++) {
                            result += "#";
                        }
                        output.add(result);
                    }
                    output.add("");
				}
			}
		} stdin.hasNext() stdin.hasNext stdin {
			String input = stdin.nextLine();
			String[] inputs = input.split(" ");
			int h = Integer.parseInt(inputs[0]);
			int w = Integer.parseInt(inputs[1]);
			if (h == 0 && w == 0) {
				break;
			} else {
				if (h >= 1 && h <= 300 && w >= 1 && w <= 300) {
                    for (int i = 1; i <= h; i++) {
                        String result = "";
                        for (int j = 1; j <= w; j++) {
                            result += "#";
                        }
                        output.add(result);
                    }
                    output.add("");
				}
			}
		} String input = stdin.nextLine(); input stdin.nextLine() stdin.nextLine stdin String[] inputs = input.split(" "); inputs input.split(" ") input.split input " " int h = Integer.parseInt(inputs[0]); h Integer.parseInt(inputs[0]) Integer.parseInt Integer inputs[0] inputs 0 int w = Integer.parseInt(inputs[1]); w Integer.parseInt(inputs[1]) Integer.parseInt Integer inputs[1] inputs 1 if (h == 0 && w == 0) {
				break;
			} else {
				if (h >= 1 && h <= 300 && w >= 1 && w <= 300) {
                    for (int i = 1; i <= h; i++) {
                        String result = "";
                        for (int j = 1; j <= w; j++) {
                            result += "#";
                        }
                        output.add(result);
                    }
                    output.add("");
				}
			} h == 0 && w == 0 h == 0 h 0 w == 0 w 0 {
				break;
			} break; {
				if (h >= 1 && h <= 300 && w >= 1 && w <= 300) {
                    for (int i = 1; i <= h; i++) {
                        String result = "";
                        for (int j = 1; j <= w; j++) {
                            result += "#";
                        }
                        output.add(result);
                    }
                    output.add("");
				}
			} if (h >= 1 && h <= 300 && w >= 1 && w <= 300) {
                    for (int i = 1; i <= h; i++) {
                        String result = "";
                        for (int j = 1; j <= w; j++) {
                            result += "#";
                        }
                        output.add(result);
                    }
                    output.add("");
				} h >= 1 && h <= 300 && w >= 1 && w <= 300 w >= 1 h >= 1 && h <= 300 && w >= 1 && w <= 300 h >= 1 h 1 h <= 300 h 300 w >= 1 w 1 w <= 300 w 300 {
                    for (int i = 1; i <= h; i++) {
                        String result = "";
                        for (int j = 1; j <= w; j++) {
                            result += "#";
                        }
                        output.add(result);
                    }
                    output.add("");
				} for (int i = 1; i <= h; i++) {
                        String result = "";
                        for (int j = 1; j <= w; j++) {
                            result += "#";
                        }
                        output.add(result);
                    } int i = 1; int i = 1; i 1 i <= h i h i++ i++ i {
                        String result = "";
                        for (int j = 1; j <= w; j++) {
                            result += "#";
                        }
                        output.add(result);
                    } {
                        String result = "";
                        for (int j = 1; j <= w; j++) {
                            result += "#";
                        }
                        output.add(result);
                    } String result = ""; result "" for (int j = 1; j <= w; j++) {
                            result += "#";
                        } int j = 1; int j = 1; j 1 j <= w j w j++ j++ j {
                            result += "#";
                        } {
                            result += "#";
                        } result += "#" result "#" output.add(result) output.add output result output.add("") output.add output "" for (String out : output) {
            System.out.println(out);
        } String out output {
            System.out.println(out);
        } {
            System.out.println(out);
        } System.out.println(out) System.out.println System.out System System.out out String[] args args public class Main{
	public static void main(String[] args) {
		Scanner stdin = new Scanner(new BufferedInputStream(System.in));
		List<String> output = new ArrayList<String>();
		while (stdin.hasNext()) {
			String input = stdin.nextLine();
			String[] inputs = input.split(" ");
			int h = Integer.parseInt(inputs[0]);
			int w = Integer.parseInt(inputs[1]);
			if (h == 0 && w == 0) {
				break;
			} else {
				if (h >= 1 && h <= 300 && w >= 1 && w <= 300) {
                    for (int i = 1; i <= h; i++) {
                        String result = "";
                        for (int j = 1; j <= w; j++) {
                            result += "#";
                        }
                        output.add(result);
                    }
                    output.add("");
				}
			}
		}
		for (String out : output) {
            System.out.println(out);
        }


	}

} public class Main{
	public static void main(String[] args) {
		Scanner stdin = new Scanner(new BufferedInputStream(System.in));
		List<String> output = new ArrayList<String>();
		while (stdin.hasNext()) {
			String input = stdin.nextLine();
			String[] inputs = input.split(" ");
			int h = Integer.parseInt(inputs[0]);
			int w = Integer.parseInt(inputs[1]);
			if (h == 0 && w == 0) {
				break;
			} else {
				if (h >= 1 && h <= 300 && w >= 1 && w <= 300) {
                    for (int i = 1; i <= h; i++) {
                        String result = "";
                        for (int j = 1; j <= w; j++) {
                            result += "#";
                        }
                        output.add(result);
                    }
                    output.add("");
				}
			}
		}
		for (String out : output) {
            System.out.println(out);
        }


	}

} Main
import java.io.BufferedInputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main{
	public static void main(String[] args) {
		Scanner stdin = new Scanner(new BufferedInputStream(System.in));
		List<String> output = new ArrayList<String>();
		while (stdin.hasNext()) {
			String input = stdin.nextLine();
			String[] inputs = input.split(" ");
			int h = Integer.parseInt(inputs[0]);
			int w = Integer.parseInt(inputs[1]);
			if (h == 0 && w == 0) {
				break;
			} else {
				if (h >= 1 && h <= 300 && w >= 1 && w <= 300) {
                    for (int i = 1; i <= h; i++) {
                        String result = "";
                        for (int j = 1; j <= w; j++) {
                            result += "#";
                        }
                        output.add(result);
                    }
                    output.add("");
				}
			}
		}
		for (String out : output) {
            System.out.println(out);
        }


	}

}