import java.util.*;

public class Main {
    private static final Scanner scn = new Scanner(System.in);
    
    public static void main(String[] args) {
        int h, w;
        while((h = scn.nextInt()) != 0 | (w = scn.nextInt()) != 0) {
            rect(h, w);
            System.out.println();
        }
    }
    
    private static void rect(int h, int w) {
        for(int i = 0; i++ < h; System.out.println()) {
            for(int j = 0; j++ < w; System.out.print("#"));
        }
    }
} import java.util.*; util.* java public class Main {
    private static final Scanner scn = new Scanner(System.in);
    
    public static void main(String[] args) {
        int h, w;
        while((h = scn.nextInt()) != 0 | (w = scn.nextInt()) != 0) {
            rect(h, w);
            System.out.println();
        }
    }
    
    private static void rect(int h, int w) {
        for(int i = 0; i++ < h; System.out.println()) {
            for(int j = 0; j++ < w; System.out.print("#"));
        }
    }
} Main private static final Scanner scn = new Scanner(System.in); scn new Scanner(System.in) public static void main(String[] args) {
        int h, w;
        while((h = scn.nextInt()) != 0 | (w = scn.nextInt()) != 0) {
            rect(h, w);
            System.out.println();
        }
    } main {
        int h, w;
        while((h = scn.nextInt()) != 0 | (w = scn.nextInt()) != 0) {
            rect(h, w);
            System.out.println();
        }
    } int h h w; w while((h = scn.nextInt()) != 0 | (w = scn.nextInt()) != 0) {
            rect(h, w);
            System.out.println();
        } (h = scn.nextInt()) != 0 | (w = scn.nextInt()) != 0 (h = scn.nextInt()) != 0 (h = scn.nextInt()) h scn.nextInt() scn.nextInt scn 0 (w = scn.nextInt()) != 0 (w = scn.nextInt()) w scn.nextInt() scn.nextInt scn 0 {
            rect(h, w);
            System.out.println();
        } rect(h, w) rect h w System.out.println() System.out.println System.out System System.out String[] args args private static void rect(int h, int w) {
        for(int i = 0; i++ < h; System.out.println()) {
            for(int j = 0; j++ < w; System.out.print("#"));
        }
    } rect {
        for(int i = 0; i++ < h; System.out.println()) {
            for(int j = 0; j++ < w; System.out.print("#"));
        }
    } for(int i = 0; i++ < h; System.out.println()) {
            for(int j = 0; j++ < w; System.out.print("#"));
        } int i = 0; int i = 0; i 0 i++ < h i++ i h System.out.println() System.out.println() System.out.println System.out System System.out {
            for(int j = 0; j++ < w; System.out.print("#"));
        } {
            for(int j = 0; j++ < w; System.out.print("#"));
        } for(int j = 0; j++ < w; System.out.print("#")); int j = 0; int j = 0; j 0 j++ < w j++ j w System.out.print("#") System.out.print("#") System.out.print System.out System System.out "#" ; int h h int w w public class Main {
    private static final Scanner scn = new Scanner(System.in);
    
    public static void main(String[] args) {
        int h, w;
        while((h = scn.nextInt()) != 0 | (w = scn.nextInt()) != 0) {
            rect(h, w);
            System.out.println();
        }
    }
    
    private static void rect(int h, int w) {
        for(int i = 0; i++ < h; System.out.println()) {
            for(int j = 0; j++ < w; System.out.print("#"));
        }
    }
} public class Main {
    private static final Scanner scn = new Scanner(System.in);
    
    public static void main(String[] args) {
        int h, w;
        while((h = scn.nextInt()) != 0 | (w = scn.nextInt()) != 0) {
            rect(h, w);
            System.out.println();
        }
    }
    
    private static void rect(int h, int w) {
        for(int i = 0; i++ < h; System.out.println()) {
            for(int j = 0; j++ < w; System.out.print("#"));
        }
    }
} Main
import java.util.*;

public class Main {
    private static final Scanner scn = new Scanner(System.in);
    
    public static void main(String[] args) {
        int h, w;
        while((h = scn.nextInt()) != 0 | (w = scn.nextInt()) != 0) {
            rect(h, w);
            System.out.println();
        }
    }
    
    private static void rect(int h, int w) {
        for(int i = 0; i++ < h; System.out.println()) {
            for(int j = 0; j++ < w; System.out.print("#"));
        }
    }
}