import java.util.*;

class Main {
   public static void main(String[] args) {
      Scanner sc = new Scanner(System.in);
      int H = Integer.parseInt(sc.next());
      int W = Integer.parseInt(sc.next());
      while (H != 0 && W != 0) {
         if (H > 300 || W > 300) break;
         for (int i = 0; i < H; i++) {
            for (int j = 0; j < W; j++) {
               System.out.print("#");
            }
            System.out.println();
         }
         System.out.println();
         H = Integer.parseInt(sc.next());
         W = Integer.parseInt(sc.next());
      }
   }
} import java.util.*; util.* java class Main {
   public static void main(String[] args) {
      Scanner sc = new Scanner(System.in);
      int H = Integer.parseInt(sc.next());
      int W = Integer.parseInt(sc.next());
      while (H != 0 && W != 0) {
         if (H > 300 || W > 300) break;
         for (int i = 0; i < H; i++) {
            for (int j = 0; j < W; j++) {
               System.out.print("#");
            }
            System.out.println();
         }
         System.out.println();
         H = Integer.parseInt(sc.next());
         W = Integer.parseInt(sc.next());
      }
   }
} Main public static void main(String[] args) {
      Scanner sc = new Scanner(System.in);
      int H = Integer.parseInt(sc.next());
      int W = Integer.parseInt(sc.next());
      while (H != 0 && W != 0) {
         if (H > 300 || W > 300) break;
         for (int i = 0; i < H; i++) {
            for (int j = 0; j < W; j++) {
               System.out.print("#");
            }
            System.out.println();
         }
         System.out.println();
         H = Integer.parseInt(sc.next());
         W = Integer.parseInt(sc.next());
      }
   } main {
      Scanner sc = new Scanner(System.in);
      int H = Integer.parseInt(sc.next());
      int W = Integer.parseInt(sc.next());
      while (H != 0 && W != 0) {
         if (H > 300 || W > 300) break;
         for (int i = 0; i < H; i++) {
            for (int j = 0; j < W; j++) {
               System.out.print("#");
            }
            System.out.println();
         }
         System.out.println();
         H = Integer.parseInt(sc.next());
         W = Integer.parseInt(sc.next());
      }
   } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int H = Integer.parseInt(sc.next()); H Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int W = Integer.parseInt(sc.next()); W Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc while (H != 0 && W != 0) {
         if (H > 300 || W > 300) break;
         for (int i = 0; i < H; i++) {
            for (int j = 0; j < W; j++) {
               System.out.print("#");
            }
            System.out.println();
         }
         System.out.println();
         H = Integer.parseInt(sc.next());
         W = Integer.parseInt(sc.next());
      } H != 0 && W != 0 H != 0 H 0 W != 0 W 0 {
         if (H > 300 || W > 300) break;
         for (int i = 0; i < H; i++) {
            for (int j = 0; j < W; j++) {
               System.out.print("#");
            }
            System.out.println();
         }
         System.out.println();
         H = Integer.parseInt(sc.next());
         W = Integer.parseInt(sc.next());
      } if (H > 300 || W > 300) break; H > 300 || W > 300 H > 300 H 300 W > 300 W 300 break; for (int i = 0; i < H; i++) {
            for (int j = 0; j < W; j++) {
               System.out.print("#");
            }
            System.out.println();
         } int i = 0; int i = 0; i 0 i < H i H i++ i++ i {
            for (int j = 0; j < W; j++) {
               System.out.print("#");
            }
            System.out.println();
         } {
            for (int j = 0; j < W; j++) {
               System.out.print("#");
            }
            System.out.println();
         } for (int j = 0; j < W; j++) {
               System.out.print("#");
            } int j = 0; int j = 0; j 0 j < W j W j++ j++ j {
               System.out.print("#");
            } {
               System.out.print("#");
            } System.out.print("#") System.out.print System.out System System.out "#" System.out.println() System.out.println System.out System System.out System.out.println() System.out.println System.out System System.out H = Integer.parseInt(sc.next()) H Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc W = Integer.parseInt(sc.next()) W Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc String[] args args
import java.util.*;

class Main {
   public static void main(String[] args) {
      Scanner sc = new Scanner(System.in);
      int H = Integer.parseInt(sc.next());
      int W = Integer.parseInt(sc.next());
      while (H != 0 && W != 0) {
         if (H > 300 || W > 300) break;
         for (int i = 0; i < H; i++) {
            for (int j = 0; j < W; j++) {
               System.out.print("#");
            }
            System.out.println();
         }
         System.out.println();
         H = Integer.parseInt(sc.next());
         W = Integer.parseInt(sc.next());
      }
   }
}