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

public class Main {

    public static void main(String[] args) {
        System.out.println(process(readAll(System.in)));
    }

    protected static String process(String data) {
        final String[] lines = splitForLines(data);

        StringBuilder sb = new StringBuilder();

        for (String line : lines) {
            final int[] split = split(line);

            int height = split[0];
            int width = split[1];

            if (height == 0 && width == 0) {
                break;
            }

            if (sb.length() > 0) {
                sb.append("\n");
            }

            sb.append(rectangle(width, height));
        }

        return sb.toString();
    }

    static String rectangle(int width, int height) {
        StringBuilder sb = new StringBuilder();

        for (int i = 0; i < height; i++) {
            for (int j = 0; j < width; j++) {
                sb.append('#');
            }
            sb.append('\n');
        }

        return sb.toString();
    }

    private static String readAll(InputStream is) {
        InputStreamReader r = null;
        BufferedReader br = null;

        try {
            r = new InputStreamReader(is);
            br = new BufferedReader(r);
            StringBuilder sb = new StringBuilder();
            String s;

            while ((s = br.readLine()) != null) {
                sb.append(s).append('\n');
            }

            return sb.toString();
        } catch (IOException e) {
            throw new RuntimeException(e);
        } finally {
            if (br != null) {
                try {
                    br.close();
                } catch (IOException e) {
                }
            }
            if (r != null) {
                try {
                    r.close();
                } catch (IOException e) {
                }
            }
        }
    }

    private static int[] split(String s) {
        final String[] s0 = s.split(" ");
        int[] ia = new int[s0.length];

        for (int i = 0; i < s0.length; i++) {
            ia[i] = Integer.parseInt(s0[i]);
        }

        return ia;
    }

    private static String[] splitForLines(String lines) {
        return lines.split("\\n");
    }

} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStream; InputStream java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {

    public static void main(String[] args) {
        System.out.println(process(readAll(System.in)));
    }

    protected static String process(String data) {
        final String[] lines = splitForLines(data);

        StringBuilder sb = new StringBuilder();

        for (String line : lines) {
            final int[] split = split(line);

            int height = split[0];
            int width = split[1];

            if (height == 0 && width == 0) {
                break;
            }

            if (sb.length() > 0) {
                sb.append("\n");
            }

            sb.append(rectangle(width, height));
        }

        return sb.toString();
    }

    static String rectangle(int width, int height) {
        StringBuilder sb = new StringBuilder();

        for (int i = 0; i < height; i++) {
            for (int j = 0; j < width; j++) {
                sb.append('#');
            }
            sb.append('\n');
        }

        return sb.toString();
    }

    private static String readAll(InputStream is) {
        InputStreamReader r = null;
        BufferedReader br = null;

        try {
            r = new InputStreamReader(is);
            br = new BufferedReader(r);
            StringBuilder sb = new StringBuilder();
            String s;

            while ((s = br.readLine()) != null) {
                sb.append(s).append('\n');
            }

            return sb.toString();
        } catch (IOException e) {
            throw new RuntimeException(e);
        } finally {
            if (br != null) {
                try {
                    br.close();
                } catch (IOException e) {
                }
            }
            if (r != null) {
                try {
                    r.close();
                } catch (IOException e) {
                }
            }
        }
    }

    private static int[] split(String s) {
        final String[] s0 = s.split(" ");
        int[] ia = new int[s0.length];

        for (int i = 0; i < s0.length; i++) {
            ia[i] = Integer.parseInt(s0[i]);
        }

        return ia;
    }

    private static String[] splitForLines(String lines) {
        return lines.split("\\n");
    }

} Main public static void main(String[] args) {
        System.out.println(process(readAll(System.in)));
    } main {
        System.out.println(process(readAll(System.in)));
    } System.out.println(process(readAll(System.in))) System.out.println System.out System System.out process(readAll(System.in)) process readAll(System.in) readAll System.in System System.in String[] args args protected static String process(String data) {
        final String[] lines = splitForLines(data);

        StringBuilder sb = new StringBuilder();

        for (String line : lines) {
            final int[] split = split(line);

            int height = split[0];
            int width = split[1];

            if (height == 0 && width == 0) {
                break;
            }

            if (sb.length() > 0) {
                sb.append("\n");
            }

            sb.append(rectangle(width, height));
        }

        return sb.toString();
    } process {
        final String[] lines = splitForLines(data);

        StringBuilder sb = new StringBuilder();

        for (String line : lines) {
            final int[] split = split(line);

            int height = split[0];
            int width = split[1];

            if (height == 0 && width == 0) {
                break;
            }

            if (sb.length() > 0) {
                sb.append("\n");
            }

            sb.append(rectangle(width, height));
        }

        return sb.toString();
    } final String[] lines = splitForLines(data); lines splitForLines(data) splitForLines data StringBuilder sb = new StringBuilder(); sb new StringBuilder() for (String line : lines) {
            final int[] split = split(line);

            int height = split[0];
            int width = split[1];

            if (height == 0 && width == 0) {
                break;
            }

            if (sb.length() > 0) {
                sb.append("\n");
            }

            sb.append(rectangle(width, height));
        } String line lines {
            final int[] split = split(line);

            int height = split[0];
            int width = split[1];

            if (height == 0 && width == 0) {
                break;
            }

            if (sb.length() > 0) {
                sb.append("\n");
            }

            sb.append(rectangle(width, height));
        } {
            final int[] split = split(line);

            int height = split[0];
            int width = split[1];

            if (height == 0 && width == 0) {
                break;
            }

            if (sb.length() > 0) {
                sb.append("\n");
            }

            sb.append(rectangle(width, height));
        } final int[] split = split(line); split split(line) split line int height = split[0]; height split[0] split 0 int width = split[1]; width split[1] split 1 if (height == 0 && width == 0) {
                break;
            } height == 0 && width == 0 height == 0 height 0 width == 0 width 0 {
                break;
            } break; if (sb.length() > 0) {
                sb.append("\n");
            } sb.length() > 0 sb.length() sb.length sb 0 {
                sb.append("\n");
            } sb.append("\n") sb.append sb "\n" sb.append(rectangle(width, height)) sb.append sb rectangle(width, height) rectangle width height return sb.toString(); sb.toString() sb.toString sb String data data static String rectangle(int width, int height) {
        StringBuilder sb = new StringBuilder();

        for (int i = 0; i < height; i++) {
            for (int j = 0; j < width; j++) {
                sb.append('#');
            }
            sb.append('\n');
        }

        return sb.toString();
    } rectangle {
        StringBuilder sb = new StringBuilder();

        for (int i = 0; i < height; i++) {
            for (int j = 0; j < width; j++) {
                sb.append('#');
            }
            sb.append('\n');
        }

        return sb.toString();
    } StringBuilder sb = new StringBuilder(); sb new StringBuilder() for (int i = 0; i < height; i++) {
            for (int j = 0; j < width; j++) {
                sb.append('#');
            }
            sb.append('\n');
        } int i = 0; int i = 0; i 0 i < height i height i++ i++ i {
            for (int j = 0; j < width; j++) {
                sb.append('#');
            }
            sb.append('\n');
        } {
            for (int j = 0; j < width; j++) {
                sb.append('#');
            }
            sb.append('\n');
        } for (int j = 0; j < width; j++) {
                sb.append('#');
            } int j = 0; int j = 0; j 0 j < width j width j++ j++ j {
                sb.append('#');
            } {
                sb.append('#');
            } sb.append('#') sb.append sb '#' sb.append('\n') sb.append sb '\n' return sb.toString(); sb.toString() sb.toString sb int width width int height height private static String readAll(InputStream is) {
        InputStreamReader r = null;
        BufferedReader br = null;

        try {
            r = new InputStreamReader(is);
            br = new BufferedReader(r);
            StringBuilder sb = new StringBuilder();
            String s;

            while ((s = br.readLine()) != null) {
                sb.append(s).append('\n');
            }

            return sb.toString();
        } catch (IOException e) {
            throw new RuntimeException(e);
        } finally {
            if (br != null) {
                try {
                    br.close();
                } catch (IOException e) {
                }
            }
            if (r != null) {
                try {
                    r.close();
                } catch (IOException e) {
                }
            }
        }
    } readAll {
        InputStreamReader r = null;
        BufferedReader br = null;

        try {
            r = new InputStreamReader(is);
            br = new BufferedReader(r);
            StringBuilder sb = new StringBuilder();
            String s;

            while ((s = br.readLine()) != null) {
                sb.append(s).append('\n');
            }

            return sb.toString();
        } catch (IOException e) {
            throw new RuntimeException(e);
        } finally {
            if (br != null) {
                try {
                    br.close();
                } catch (IOException e) {
                }
            }
            if (r != null) {
                try {
                    r.close();
                } catch (IOException e) {
                }
            }
        }
    } InputStreamReader r = null; r null BufferedReader br = null; br null try {
            r = new InputStreamReader(is);
            br = new BufferedReader(r);
            StringBuilder sb = new StringBuilder();
            String s;

            while ((s = br.readLine()) != null) {
                sb.append(s).append('\n');
            }

            return sb.toString();
        } catch (IOException e) {
            throw new RuntimeException(e);
        } finally {
            if (br != null) {
                try {
                    br.close();
                } catch (IOException e) {
                }
            }
            if (r != null) {
                try {
                    r.close();
                } catch (IOException e) {
                }
            }
        } catch (IOException e) {
            throw new RuntimeException(e);
        } IOException e {
            throw new RuntimeException(e);
        } throw new RuntimeException(e); new RuntimeException(e) {
            if (br != null) {
                try {
                    br.close();
                } catch (IOException e) {
                }
            }
            if (r != null) {
                try {
                    r.close();
                } catch (IOException e) {
                }
            }
        } if (br != null) {
                try {
                    br.close();
                } catch (IOException e) {
                }
            } br != null br null {
                try {
                    br.close();
                } catch (IOException e) {
                }
            } try {
                    br.close();
                } catch (IOException e) {
                } catch (IOException e) {
                } IOException e {
                } {
                    br.close();
                } br.close() br.close br if (r != null) {
                try {
                    r.close();
                } catch (IOException e) {
                }
            } r != null r null {
                try {
                    r.close();
                } catch (IOException e) {
                }
            } try {
                    r.close();
                } catch (IOException e) {
                } catch (IOException e) {
                } IOException e {
                } {
                    r.close();
                } r.close() r.close r {
            r = new InputStreamReader(is);
            br = new BufferedReader(r);
            StringBuilder sb = new StringBuilder();
            String s;

            while ((s = br.readLine()) != null) {
                sb.append(s).append('\n');
            }

            return sb.toString();
        } r = new InputStreamReader(is) r new InputStreamReader(is) br = new BufferedReader(r) br new BufferedReader(r) StringBuilder sb = new StringBuilder(); sb new StringBuilder() String s; s while ((s = br.readLine()) != null) {
                sb.append(s).append('\n');
            } (s = br.readLine()) != null (s = br.readLine()) s br.readLine() br.readLine br null {
                sb.append(s).append('\n');
            } sb.append(s).append('\n') sb.append(s).append sb.append(s) sb.append sb s '\n' return sb.toString(); sb.toString() sb.toString sb InputStream is is private static int[] split(String s) {
        final String[] s0 = s.split(" ");
        int[] ia = new int[s0.length];

        for (int i = 0; i < s0.length; i++) {
            ia[i] = Integer.parseInt(s0[i]);
        }

        return ia;
    } split {
        final String[] s0 = s.split(" ");
        int[] ia = new int[s0.length];

        for (int i = 0; i < s0.length; i++) {
            ia[i] = Integer.parseInt(s0[i]);
        }

        return ia;
    } final String[] s0 = s.split(" "); s0 s.split(" ") s.split s " " int[] ia = new int[s0.length]; ia new int[s0.length] s0.length s0 s0.length for (int i = 0; i < s0.length; i++) {
            ia[i] = Integer.parseInt(s0[i]);
        } int i = 0; int i = 0; i 0 i < s0.length i s0.length s0 s0.length i++ i++ i {
            ia[i] = Integer.parseInt(s0[i]);
        } {
            ia[i] = Integer.parseInt(s0[i]);
        } ia[i] = Integer.parseInt(s0[i]) ia[i] ia i Integer.parseInt(s0[i]) Integer.parseInt Integer s0[i] s0 i return ia; ia String s s private static String[] splitForLines(String lines) {
        return lines.split("\\n");
    } splitForLines {
        return lines.split("\\n");
    } return lines.split("\\n"); lines.split("\\n") lines.split lines "\\n" String lines lines public class Main {

    public static void main(String[] args) {
        System.out.println(process(readAll(System.in)));
    }

    protected static String process(String data) {
        final String[] lines = splitForLines(data);

        StringBuilder sb = new StringBuilder();

        for (String line : lines) {
            final int[] split = split(line);

            int height = split[0];
            int width = split[1];

            if (height == 0 && width == 0) {
                break;
            }

            if (sb.length() > 0) {
                sb.append("\n");
            }

            sb.append(rectangle(width, height));
        }

        return sb.toString();
    }

    static String rectangle(int width, int height) {
        StringBuilder sb = new StringBuilder();

        for (int i = 0; i < height; i++) {
            for (int j = 0; j < width; j++) {
                sb.append('#');
            }
            sb.append('\n');
        }

        return sb.toString();
    }

    private static String readAll(InputStream is) {
        InputStreamReader r = null;
        BufferedReader br = null;

        try {
            r = new InputStreamReader(is);
            br = new BufferedReader(r);
            StringBuilder sb = new StringBuilder();
            String s;

            while ((s = br.readLine()) != null) {
                sb.append(s).append('\n');
            }

            return sb.toString();
        } catch (IOException e) {
            throw new RuntimeException(e);
        } finally {
            if (br != null) {
                try {
                    br.close();
                } catch (IOException e) {
                }
            }
            if (r != null) {
                try {
                    r.close();
                } catch (IOException e) {
                }
            }
        }
    }

    private static int[] split(String s) {
        final String[] s0 = s.split(" ");
        int[] ia = new int[s0.length];

        for (int i = 0; i < s0.length; i++) {
            ia[i] = Integer.parseInt(s0[i]);
        }

        return ia;
    }

    private static String[] splitForLines(String lines) {
        return lines.split("\\n");
    }

} public class Main {

    public static void main(String[] args) {
        System.out.println(process(readAll(System.in)));
    }

    protected static String process(String data) {
        final String[] lines = splitForLines(data);

        StringBuilder sb = new StringBuilder();

        for (String line : lines) {
            final int[] split = split(line);

            int height = split[0];
            int width = split[1];

            if (height == 0 && width == 0) {
                break;
            }

            if (sb.length() > 0) {
                sb.append("\n");
            }

            sb.append(rectangle(width, height));
        }

        return sb.toString();
    }

    static String rectangle(int width, int height) {
        StringBuilder sb = new StringBuilder();

        for (int i = 0; i < height; i++) {
            for (int j = 0; j < width; j++) {
                sb.append('#');
            }
            sb.append('\n');
        }

        return sb.toString();
    }

    private static String readAll(InputStream is) {
        InputStreamReader r = null;
        BufferedReader br = null;

        try {
            r = new InputStreamReader(is);
            br = new BufferedReader(r);
            StringBuilder sb = new StringBuilder();
            String s;

            while ((s = br.readLine()) != null) {
                sb.append(s).append('\n');
            }

            return sb.toString();
        } catch (IOException e) {
            throw new RuntimeException(e);
        } finally {
            if (br != null) {
                try {
                    br.close();
                } catch (IOException e) {
                }
            }
            if (r != null) {
                try {
                    r.close();
                } catch (IOException e) {
                }
            }
        }
    }

    private static int[] split(String s) {
        final String[] s0 = s.split(" ");
        int[] ia = new int[s0.length];

        for (int i = 0; i < s0.length; i++) {
            ia[i] = Integer.parseInt(s0[i]);
        }

        return ia;
    }

    private static String[] splitForLines(String lines) {
        return lines.split("\\n");
    }

} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;

public class Main {

    public static void main(String[] args) {
        System.out.println(process(readAll(System.in)));
    }

    protected static String process(String data) {
        final String[] lines = splitForLines(data);

        StringBuilder sb = new StringBuilder();

        for (String line : lines) {
            final int[] split = split(line);

            int height = split[0];
            int width = split[1];

            if (height == 0 && width == 0) {
                break;
            }

            if (sb.length() > 0) {
                sb.append("\n");
            }

            sb.append(rectangle(width, height));
        }

        return sb.toString();
    }

    static String rectangle(int width, int height) {
        StringBuilder sb = new StringBuilder();

        for (int i = 0; i < height; i++) {
            for (int j = 0; j < width; j++) {
                sb.append('#');
            }
            sb.append('\n');
        }

        return sb.toString();
    }

    private static String readAll(InputStream is) {
        InputStreamReader r = null;
        BufferedReader br = null;

        try {
            r = new InputStreamReader(is);
            br = new BufferedReader(r);
            StringBuilder sb = new StringBuilder();
            String s;

            while ((s = br.readLine()) != null) {
                sb.append(s).append('\n');
            }

            return sb.toString();
        } catch (IOException e) {
            throw new RuntimeException(e);
        } finally {
            if (br != null) {
                try {
                    br.close();
                } catch (IOException e) {
                }
            }
            if (r != null) {
                try {
                    r.close();
                } catch (IOException e) {
                }
            }
        }
    }

    private static int[] split(String s) {
        final String[] s0 = s.split(" ");
        int[] ia = new int[s0.length];

        for (int i = 0; i < s0.length; i++) {
            ia[i] = Integer.parseInt(s0[i]);
        }

        return ia;
    }

    private static String[] splitForLines(String lines) {
        return lines.split("\\n");
    }

}