import java.util.Scanner;

public class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    int H = scan.nextInt();
    int W = scan.nextInt();
    while(H != 0 || W != 0){
      StringBuilder sb = new StringBuilder();
      for(int i=0; i<W; i++ ){
        sb.append("#");
      }
      for(int j=0; j<H; j++){
        System.out.println(sb);
      }
      System.out.println("");
      H = scan.nextInt();
      W = scan.nextInt();
    }
    
  }
} import java.util.Scanner; Scanner java.util public class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    int H = scan.nextInt();
    int W = scan.nextInt();
    while(H != 0 || W != 0){
      StringBuilder sb = new StringBuilder();
      for(int i=0; i<W; i++ ){
        sb.append("#");
      }
      for(int j=0; j<H; j++){
        System.out.println(sb);
      }
      System.out.println("");
      H = scan.nextInt();
      W = scan.nextInt();
    }
    
  }
} Main public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    int H = scan.nextInt();
    int W = scan.nextInt();
    while(H != 0 || W != 0){
      StringBuilder sb = new StringBuilder();
      for(int i=0; i<W; i++ ){
        sb.append("#");
      }
      for(int j=0; j<H; j++){
        System.out.println(sb);
      }
      System.out.println("");
      H = scan.nextInt();
      W = scan.nextInt();
    }
    
  } main {
    Scanner scan = new Scanner(System.in);
    int H = scan.nextInt();
    int W = scan.nextInt();
    while(H != 0 || W != 0){
      StringBuilder sb = new StringBuilder();
      for(int i=0; i<W; i++ ){
        sb.append("#");
      }
      for(int j=0; j<H; j++){
        System.out.println(sb);
      }
      System.out.println("");
      H = scan.nextInt();
      W = scan.nextInt();
    }
    
  } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int H = scan.nextInt(); H scan.nextInt() scan.nextInt scan int W = scan.nextInt(); W scan.nextInt() scan.nextInt scan while(H != 0 || W != 0){
      StringBuilder sb = new StringBuilder();
      for(int i=0; i<W; i++ ){
        sb.append("#");
      }
      for(int j=0; j<H; j++){
        System.out.println(sb);
      }
      System.out.println("");
      H = scan.nextInt();
      W = scan.nextInt();
    } H != 0 || W != 0 H != 0 H 0 W != 0 W 0 {
      StringBuilder sb = new StringBuilder();
      for(int i=0; i<W; i++ ){
        sb.append("#");
      }
      for(int j=0; j<H; j++){
        System.out.println(sb);
      }
      System.out.println("");
      H = scan.nextInt();
      W = scan.nextInt();
    } StringBuilder sb = new StringBuilder(); sb new StringBuilder() for(int i=0; i<W; i++ ){
        sb.append("#");
      } int i=0; int i=0; i 0 i<W i W i++ i++ i {
        sb.append("#");
      } {
        sb.append("#");
      } sb.append("#") sb.append sb "#" for(int j=0; j<H; j++){
        System.out.println(sb);
      } int j=0; int j=0; j 0 j<H j H j++ j++ j {
        System.out.println(sb);
      } {
        System.out.println(sb);
      } System.out.println(sb) System.out.println System.out System System.out sb System.out.println("") System.out.println System.out System System.out "" H = scan.nextInt() H scan.nextInt() scan.nextInt scan W = scan.nextInt() W scan.nextInt() scan.nextInt scan String[] args args public class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    int H = scan.nextInt();
    int W = scan.nextInt();
    while(H != 0 || W != 0){
      StringBuilder sb = new StringBuilder();
      for(int i=0; i<W; i++ ){
        sb.append("#");
      }
      for(int j=0; j<H; j++){
        System.out.println(sb);
      }
      System.out.println("");
      H = scan.nextInt();
      W = scan.nextInt();
    }
    
  }
} public class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    int H = scan.nextInt();
    int W = scan.nextInt();
    while(H != 0 || W != 0){
      StringBuilder sb = new StringBuilder();
      for(int i=0; i<W; i++ ){
        sb.append("#");
      }
      for(int j=0; j<H; j++){
        System.out.println(sb);
      }
      System.out.println("");
      H = scan.nextInt();
      W = scan.nextInt();
    }
    
  }
} Main
import java.util.Scanner;

public class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    int H = scan.nextInt();
    int W = scan.nextInt();
    while(H != 0 || W != 0){
      StringBuilder sb = new StringBuilder();
      for(int i=0; i<W; i++ ){
        sb.append("#");
      }
      for(int j=0; j<H; j++){
        System.out.println(sb);
      }
      System.out.println("");
      H = scan.nextInt();
      W = scan.nextInt();
    }
    
  }
}