import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

/**
 * Created 2017/06/01.
 */
public class Main {
  public static void main(String[] args) {
    //??\?????¨?????????
    Scanner sc = new Scanner(System.in);
    ArrayList<ArrayList<Integer>> ary_ans = new ArrayList<>();
    while (true) {
      ArrayList<Integer> ary = new ArrayList<>();
      int input1 = Integer.parseInt(sc.next());
      int input2 = Integer.parseInt(sc.next());
      if (input1 == 0 && input2 == 0) break;
      ary.add(input1);
      ary.add(input2);
      ary_ans.add(ary);
    }
    for (ArrayList<Integer> index : ary_ans) {
      for (int i = 0; i < index.get(0);i++){
        System.out.print("#");
        for (int j = 1; j < index.get(1);j++){
          System.out.print("#");
        }
        System.out.println("");
      }
      System.out.println("");
    }
  }
} import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util import java.util.Scanner; Scanner java.util public class Main {
  public static void main(String[] args) {
    //??\?????¨?????????
    Scanner sc = new Scanner(System.in);
    ArrayList<ArrayList<Integer>> ary_ans = new ArrayList<>();
    while (true) {
      ArrayList<Integer> ary = new ArrayList<>();
      int input1 = Integer.parseInt(sc.next());
      int input2 = Integer.parseInt(sc.next());
      if (input1 == 0 && input2 == 0) break;
      ary.add(input1);
      ary.add(input2);
      ary_ans.add(ary);
    }
    for (ArrayList<Integer> index : ary_ans) {
      for (int i = 0; i < index.get(0);i++){
        System.out.print("#");
        for (int j = 1; j < index.get(1);j++){
          System.out.print("#");
        }
        System.out.println("");
      }
      System.out.println("");
    }
  }
} Main public static void main(String[] args) {
    //??\?????¨?????????
    Scanner sc = new Scanner(System.in);
    ArrayList<ArrayList<Integer>> ary_ans = new ArrayList<>();
    while (true) {
      ArrayList<Integer> ary = new ArrayList<>();
      int input1 = Integer.parseInt(sc.next());
      int input2 = Integer.parseInt(sc.next());
      if (input1 == 0 && input2 == 0) break;
      ary.add(input1);
      ary.add(input2);
      ary_ans.add(ary);
    }
    for (ArrayList<Integer> index : ary_ans) {
      for (int i = 0; i < index.get(0);i++){
        System.out.print("#");
        for (int j = 1; j < index.get(1);j++){
          System.out.print("#");
        }
        System.out.println("");
      }
      System.out.println("");
    }
  } main {
    //??\?????¨?????????
    Scanner sc = new Scanner(System.in);
    ArrayList<ArrayList<Integer>> ary_ans = new ArrayList<>();
    while (true) {
      ArrayList<Integer> ary = new ArrayList<>();
      int input1 = Integer.parseInt(sc.next());
      int input2 = Integer.parseInt(sc.next());
      if (input1 == 0 && input2 == 0) break;
      ary.add(input1);
      ary.add(input2);
      ary_ans.add(ary);
    }
    for (ArrayList<Integer> index : ary_ans) {
      for (int i = 0; i < index.get(0);i++){
        System.out.print("#");
        for (int j = 1; j < index.get(1);j++){
          System.out.print("#");
        }
        System.out.println("");
      }
      System.out.println("");
    }
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) ArrayList<ArrayList<Integer>> ary_ans = new ArrayList<>(); ary_ans new ArrayList<>() while (true) {
      ArrayList<Integer> ary = new ArrayList<>();
      int input1 = Integer.parseInt(sc.next());
      int input2 = Integer.parseInt(sc.next());
      if (input1 == 0 && input2 == 0) break;
      ary.add(input1);
      ary.add(input2);
      ary_ans.add(ary);
    } true {
      ArrayList<Integer> ary = new ArrayList<>();
      int input1 = Integer.parseInt(sc.next());
      int input2 = Integer.parseInt(sc.next());
      if (input1 == 0 && input2 == 0) break;
      ary.add(input1);
      ary.add(input2);
      ary_ans.add(ary);
    } ArrayList<Integer> ary = new ArrayList<>(); ary new ArrayList<>() int input1 = Integer.parseInt(sc.next()); input1 Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int input2 = Integer.parseInt(sc.next()); input2 Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc if (input1 == 0 && input2 == 0) break; input1 == 0 && input2 == 0 input1 == 0 input1 0 input2 == 0 input2 0 break; ary.add(input1) ary.add ary input1 ary.add(input2) ary.add ary input2 ary_ans.add(ary) ary_ans.add ary_ans ary for (ArrayList<Integer> index : ary_ans) {
      for (int i = 0; i < index.get(0);i++){
        System.out.print("#");
        for (int j = 1; j < index.get(1);j++){
          System.out.print("#");
        }
        System.out.println("");
      }
      System.out.println("");
    } ArrayList<Integer> index ary_ans {
      for (int i = 0; i < index.get(0);i++){
        System.out.print("#");
        for (int j = 1; j < index.get(1);j++){
          System.out.print("#");
        }
        System.out.println("");
      }
      System.out.println("");
    } {
      for (int i = 0; i < index.get(0);i++){
        System.out.print("#");
        for (int j = 1; j < index.get(1);j++){
          System.out.print("#");
        }
        System.out.println("");
      }
      System.out.println("");
    } for (int i = 0; i < index.get(0);i++){
        System.out.print("#");
        for (int j = 1; j < index.get(1);j++){
          System.out.print("#");
        }
        System.out.println("");
      } int i = 0; int i = 0; i 0 i < index.get(0) i index.get(0) index.get index 0 i++ i++ i {
        System.out.print("#");
        for (int j = 1; j < index.get(1);j++){
          System.out.print("#");
        }
        System.out.println("");
      } {
        System.out.print("#");
        for (int j = 1; j < index.get(1);j++){
          System.out.print("#");
        }
        System.out.println("");
      } System.out.print("#") System.out.print System.out System System.out "#" for (int j = 1; j < index.get(1);j++){
          System.out.print("#");
        } int j = 1; int j = 1; j 1 j < index.get(1) j index.get(1) index.get index 1 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 "" String[] args args public class Main {
  public static void main(String[] args) {
    //??\?????¨?????????
    Scanner sc = new Scanner(System.in);
    ArrayList<ArrayList<Integer>> ary_ans = new ArrayList<>();
    while (true) {
      ArrayList<Integer> ary = new ArrayList<>();
      int input1 = Integer.parseInt(sc.next());
      int input2 = Integer.parseInt(sc.next());
      if (input1 == 0 && input2 == 0) break;
      ary.add(input1);
      ary.add(input2);
      ary_ans.add(ary);
    }
    for (ArrayList<Integer> index : ary_ans) {
      for (int i = 0; i < index.get(0);i++){
        System.out.print("#");
        for (int j = 1; j < index.get(1);j++){
          System.out.print("#");
        }
        System.out.println("");
      }
      System.out.println("");
    }
  }
} public class Main {
  public static void main(String[] args) {
    //??\?????¨?????????
    Scanner sc = new Scanner(System.in);
    ArrayList<ArrayList<Integer>> ary_ans = new ArrayList<>();
    while (true) {
      ArrayList<Integer> ary = new ArrayList<>();
      int input1 = Integer.parseInt(sc.next());
      int input2 = Integer.parseInt(sc.next());
      if (input1 == 0 && input2 == 0) break;
      ary.add(input1);
      ary.add(input2);
      ary_ans.add(ary);
    }
    for (ArrayList<Integer> index : ary_ans) {
      for (int i = 0; i < index.get(0);i++){
        System.out.print("#");
        for (int j = 1; j < index.get(1);j++){
          System.out.print("#");
        }
        System.out.println("");
      }
      System.out.println("");
    }
  }
} Main
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

/**
 * Created 2017/06/01.
 */
public class Main {
  public static void main(String[] args) {
    //??\?????¨?????????
    Scanner sc = new Scanner(System.in);
    ArrayList<ArrayList<Integer>> ary_ans = new ArrayList<>();
    while (true) {
      ArrayList<Integer> ary = new ArrayList<>();
      int input1 = Integer.parseInt(sc.next());
      int input2 = Integer.parseInt(sc.next());
      if (input1 == 0 && input2 == 0) break;
      ary.add(input1);
      ary.add(input2);
      ary_ans.add(ary);
    }
    for (ArrayList<Integer> index : ary_ans) {
      for (int i = 0; i < index.get(0);i++){
        System.out.print("#");
        for (int j = 1; j < index.get(1);j++){
          System.out.print("#");
        }
        System.out.println("");
      }
      System.out.println("");
    }
  }
}