import java.util.*;
 
class Main {
    public static void main(String[] arg){
        Scanner in = new Scanner(System.in);
        while(true){
            int x = in.nextInt();   
            int y = in.nextInt();
            if (x == 0 && y == 0)break;
            StringBuilder sb = new StringBuilder();
            for(int i = 0;i < x;i++){
                for(int j=0;j < y;j++){
                    sb.append("#");
                }
                sb.append("\n");
            }
            System.out.println(sb);
        }   
    }
} import java.util.*; util.* java class Main {
    public static void main(String[] arg){
        Scanner in = new Scanner(System.in);
        while(true){
            int x = in.nextInt();   
            int y = in.nextInt();
            if (x == 0 && y == 0)break;
            StringBuilder sb = new StringBuilder();
            for(int i = 0;i < x;i++){
                for(int j=0;j < y;j++){
                    sb.append("#");
                }
                sb.append("\n");
            }
            System.out.println(sb);
        }   
    }
} Main public static void main(String[] arg){
        Scanner in = new Scanner(System.in);
        while(true){
            int x = in.nextInt();   
            int y = in.nextInt();
            if (x == 0 && y == 0)break;
            StringBuilder sb = new StringBuilder();
            for(int i = 0;i < x;i++){
                for(int j=0;j < y;j++){
                    sb.append("#");
                }
                sb.append("\n");
            }
            System.out.println(sb);
        }   
    } main {
        Scanner in = new Scanner(System.in);
        while(true){
            int x = in.nextInt();   
            int y = in.nextInt();
            if (x == 0 && y == 0)break;
            StringBuilder sb = new StringBuilder();
            for(int i = 0;i < x;i++){
                for(int j=0;j < y;j++){
                    sb.append("#");
                }
                sb.append("\n");
            }
            System.out.println(sb);
        }   
    } Scanner in = new Scanner(System.in); in new Scanner(System.in) while(true){
            int x = in.nextInt();   
            int y = in.nextInt();
            if (x == 0 && y == 0)break;
            StringBuilder sb = new StringBuilder();
            for(int i = 0;i < x;i++){
                for(int j=0;j < y;j++){
                    sb.append("#");
                }
                sb.append("\n");
            }
            System.out.println(sb);
        } true {
            int x = in.nextInt();   
            int y = in.nextInt();
            if (x == 0 && y == 0)break;
            StringBuilder sb = new StringBuilder();
            for(int i = 0;i < x;i++){
                for(int j=0;j < y;j++){
                    sb.append("#");
                }
                sb.append("\n");
            }
            System.out.println(sb);
        } int x = in.nextInt(); x in.nextInt() in.nextInt in int y = in.nextInt(); y in.nextInt() in.nextInt in if (x == 0 && y == 0)break; x == 0 && y == 0 x == 0 x 0 y == 0 y 0 break; StringBuilder sb = new StringBuilder(); sb new StringBuilder() for(int i = 0;i < x;i++){
                for(int j=0;j < y;j++){
                    sb.append("#");
                }
                sb.append("\n");
            } int i = 0; int i = 0; i 0 i < x i x i++ i++ i {
                for(int j=0;j < y;j++){
                    sb.append("#");
                }
                sb.append("\n");
            } {
                for(int j=0;j < y;j++){
                    sb.append("#");
                }
                sb.append("\n");
            } for(int j=0;j < y;j++){
                    sb.append("#");
                } int j=0; int j=0; j 0 j < y j y j++ j++ j {
                    sb.append("#");
                } {
                    sb.append("#");
                } sb.append("#") sb.append sb "#" sb.append("\n") sb.append sb "\n" System.out.println(sb) System.out.println System.out System System.out sb String[] arg arg
import java.util.*;
 
class Main {
    public static void main(String[] arg){
        Scanner in = new Scanner(System.in);
        while(true){
            int x = in.nextInt();   
            int y = in.nextInt();
            if (x == 0 && y == 0)break;
            StringBuilder sb = new StringBuilder();
            for(int i = 0;i < x;i++){
                for(int j=0;j < y;j++){
                    sb.append("#");
                }
                sb.append("\n");
            }
            System.out.println(sb);
        }   
    }
}