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

public class Main {
    public static void main (String[] args ) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        StringBuilder builder = new StringBuilder();        
        String str = "#";
        
        while(true){
            String data = reader.readLine();
            String[] number = data.split(" ");
            int y = Integer.parseInt(number[0]);
            int x = Integer.parseInt(number[1]);
            if (x == 0 && y == 0 ) {
                break;
            }
            for ( int c = 0; c < y ; c++) {
                builder
                   .append(StringUtilsRepeat(str,x))
                   .append("\n");
            }
            builder.append("\n");
                   
        }
        System.out.print(builder);
        
    }
    public static StringBuilder StringUtilsRepeat(String str,int x) {
        StringBuilder line = new StringBuilder();
        
        for ( int i = 0; i < x ; i++) {
            line.append(str);
        }
        return line;
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
    public static void main (String[] args ) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        StringBuilder builder = new StringBuilder();        
        String str = "#";
        
        while(true){
            String data = reader.readLine();
            String[] number = data.split(" ");
            int y = Integer.parseInt(number[0]);
            int x = Integer.parseInt(number[1]);
            if (x == 0 && y == 0 ) {
                break;
            }
            for ( int c = 0; c < y ; c++) {
                builder
                   .append(StringUtilsRepeat(str,x))
                   .append("\n");
            }
            builder.append("\n");
                   
        }
        System.out.print(builder);
        
    }
    public static StringBuilder StringUtilsRepeat(String str,int x) {
        StringBuilder line = new StringBuilder();
        
        for ( int i = 0; i < x ; i++) {
            line.append(str);
        }
        return line;
    }
} Main public static void main (String[] args ) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        StringBuilder builder = new StringBuilder();        
        String str = "#";
        
        while(true){
            String data = reader.readLine();
            String[] number = data.split(" ");
            int y = Integer.parseInt(number[0]);
            int x = Integer.parseInt(number[1]);
            if (x == 0 && y == 0 ) {
                break;
            }
            for ( int c = 0; c < y ; c++) {
                builder
                   .append(StringUtilsRepeat(str,x))
                   .append("\n");
            }
            builder.append("\n");
                   
        }
        System.out.print(builder);
        
    } main {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        StringBuilder builder = new StringBuilder();        
        String str = "#";
        
        while(true){
            String data = reader.readLine();
            String[] number = data.split(" ");
            int y = Integer.parseInt(number[0]);
            int x = Integer.parseInt(number[1]);
            if (x == 0 && y == 0 ) {
                break;
            }
            for ( int c = 0; c < y ; c++) {
                builder
                   .append(StringUtilsRepeat(str,x))
                   .append("\n");
            }
            builder.append("\n");
                   
        }
        System.out.print(builder);
        
    } BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); reader new BufferedReader(new InputStreamReader(System.in)) StringBuilder builder = new StringBuilder(); builder new StringBuilder() String str = "#"; str "#" while(true){
            String data = reader.readLine();
            String[] number = data.split(" ");
            int y = Integer.parseInt(number[0]);
            int x = Integer.parseInt(number[1]);
            if (x == 0 && y == 0 ) {
                break;
            }
            for ( int c = 0; c < y ; c++) {
                builder
                   .append(StringUtilsRepeat(str,x))
                   .append("\n");
            }
            builder.append("\n");
                   
        } true {
            String data = reader.readLine();
            String[] number = data.split(" ");
            int y = Integer.parseInt(number[0]);
            int x = Integer.parseInt(number[1]);
            if (x == 0 && y == 0 ) {
                break;
            }
            for ( int c = 0; c < y ; c++) {
                builder
                   .append(StringUtilsRepeat(str,x))
                   .append("\n");
            }
            builder.append("\n");
                   
        } String data = reader.readLine(); data reader.readLine() reader.readLine reader String[] number = data.split(" "); number data.split(" ") data.split data " " int y = Integer.parseInt(number[0]); y Integer.parseInt(number[0]) Integer.parseInt Integer number[0] number 0 int x = Integer.parseInt(number[1]); x Integer.parseInt(number[1]) Integer.parseInt Integer number[1] number 1 if (x == 0 && y == 0 ) {
                break;
            } x == 0 && y == 0 x == 0 x 0 y == 0 y 0 {
                break;
            } break; for ( int c = 0; c < y ; c++) {
                builder
                   .append(StringUtilsRepeat(str,x))
                   .append("\n");
            } int c = 0; int c = 0; c 0 c < y c y c++ c++ c {
                builder
                   .append(StringUtilsRepeat(str,x))
                   .append("\n");
            } {
                builder
                   .append(StringUtilsRepeat(str,x))
                   .append("\n");
            } builder
                   .append(StringUtilsRepeat(str,x))
                   .append("\n") builder
                   .append(StringUtilsRepeat(str,x))
                   .append builder
                   .append(StringUtilsRepeat(str,x)) builder
                   .append builder StringUtilsRepeat(str,x) StringUtilsRepeat str x "\n" builder.append("\n") builder.append builder "\n" System.out.print(builder) System.out.print System.out System System.out builder String[] args args public static StringBuilder StringUtilsRepeat(String str,int x) {
        StringBuilder line = new StringBuilder();
        
        for ( int i = 0; i < x ; i++) {
            line.append(str);
        }
        return line;
    } StringUtilsRepeat {
        StringBuilder line = new StringBuilder();
        
        for ( int i = 0; i < x ; i++) {
            line.append(str);
        }
        return line;
    } StringBuilder line = new StringBuilder(); line new StringBuilder() for ( int i = 0; i < x ; i++) {
            line.append(str);
        } int i = 0; int i = 0; i 0 i < x i x i++ i++ i {
            line.append(str);
        } {
            line.append(str);
        } line.append(str) line.append line str return line; line String str str int x x public class Main {
    public static void main (String[] args ) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        StringBuilder builder = new StringBuilder();        
        String str = "#";
        
        while(true){
            String data = reader.readLine();
            String[] number = data.split(" ");
            int y = Integer.parseInt(number[0]);
            int x = Integer.parseInt(number[1]);
            if (x == 0 && y == 0 ) {
                break;
            }
            for ( int c = 0; c < y ; c++) {
                builder
                   .append(StringUtilsRepeat(str,x))
                   .append("\n");
            }
            builder.append("\n");
                   
        }
        System.out.print(builder);
        
    }
    public static StringBuilder StringUtilsRepeat(String str,int x) {
        StringBuilder line = new StringBuilder();
        
        for ( int i = 0; i < x ; i++) {
            line.append(str);
        }
        return line;
    }
} public class Main {
    public static void main (String[] args ) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        StringBuilder builder = new StringBuilder();        
        String str = "#";
        
        while(true){
            String data = reader.readLine();
            String[] number = data.split(" ");
            int y = Integer.parseInt(number[0]);
            int x = Integer.parseInt(number[1]);
            if (x == 0 && y == 0 ) {
                break;
            }
            for ( int c = 0; c < y ; c++) {
                builder
                   .append(StringUtilsRepeat(str,x))
                   .append("\n");
            }
            builder.append("\n");
                   
        }
        System.out.print(builder);
        
    }
    public static StringBuilder StringUtilsRepeat(String str,int x) {
        StringBuilder line = new StringBuilder();
        
        for ( int i = 0; i < x ; i++) {
            line.append(str);
        }
        return line;
    }
} Main

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

public class Main {
    public static void main (String[] args ) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        StringBuilder builder = new StringBuilder();        
        String str = "#";
        
        while(true){
            String data = reader.readLine();
            String[] number = data.split(" ");
            int y = Integer.parseInt(number[0]);
            int x = Integer.parseInt(number[1]);
            if (x == 0 && y == 0 ) {
                break;
            }
            for ( int c = 0; c < y ; c++) {
                builder
                   .append(StringUtilsRepeat(str,x))
                   .append("\n");
            }
            builder.append("\n");
                   
        }
        System.out.print(builder);
        
    }
    public static StringBuilder StringUtilsRepeat(String str,int x) {
        StringBuilder line = new StringBuilder();
        
        for ( int i = 0; i < x ; i++) {
            line.append(str);
        }
        return line;
    }
}