import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int intH;
		int intW;
		while(true){
			intH = scan.nextInt();
			intW = scan.nextInt();
			if(intH == 0 && intW ==0){
				break;
			}
			for(int i = 0; i < intH; i++){
				for(int j = 0; j < intW; j++){
					System.out.print("#");
				}
				System.out.println();
			}
			System.out.println();
		}

		scan.close();

	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int intH;
		int intW;
		while(true){
			intH = scan.nextInt();
			intW = scan.nextInt();
			if(intH == 0 && intW ==0){
				break;
			}
			for(int i = 0; i < intH; i++){
				for(int j = 0; j < intW; j++){
					System.out.print("#");
				}
				System.out.println();
			}
			System.out.println();
		}

		scan.close();

	}
} Main public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int intH;
		int intW;
		while(true){
			intH = scan.nextInt();
			intW = scan.nextInt();
			if(intH == 0 && intW ==0){
				break;
			}
			for(int i = 0; i < intH; i++){
				for(int j = 0; j < intW; j++){
					System.out.print("#");
				}
				System.out.println();
			}
			System.out.println();
		}

		scan.close();

	} main {
		Scanner scan = new Scanner(System.in);
		int intH;
		int intW;
		while(true){
			intH = scan.nextInt();
			intW = scan.nextInt();
			if(intH == 0 && intW ==0){
				break;
			}
			for(int i = 0; i < intH; i++){
				for(int j = 0; j < intW; j++){
					System.out.print("#");
				}
				System.out.println();
			}
			System.out.println();
		}

		scan.close();

	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int intH; intH int intW; intW while(true){
			intH = scan.nextInt();
			intW = scan.nextInt();
			if(intH == 0 && intW ==0){
				break;
			}
			for(int i = 0; i < intH; i++){
				for(int j = 0; j < intW; j++){
					System.out.print("#");
				}
				System.out.println();
			}
			System.out.println();
		} true {
			intH = scan.nextInt();
			intW = scan.nextInt();
			if(intH == 0 && intW ==0){
				break;
			}
			for(int i = 0; i < intH; i++){
				for(int j = 0; j < intW; j++){
					System.out.print("#");
				}
				System.out.println();
			}
			System.out.println();
		} intH = scan.nextInt() intH scan.nextInt() scan.nextInt scan intW = scan.nextInt() intW scan.nextInt() scan.nextInt scan if(intH == 0 && intW ==0){
				break;
			} intH == 0 && intW ==0 intH == 0 intH 0 intW ==0 intW 0 {
				break;
			} break; for(int i = 0; i < intH; i++){
				for(int j = 0; j < intW; j++){
					System.out.print("#");
				}
				System.out.println();
			} int i = 0; int i = 0; i 0 i < intH i intH i++ i++ i {
				for(int j = 0; j < intW; j++){
					System.out.print("#");
				}
				System.out.println();
			} {
				for(int j = 0; j < intW; j++){
					System.out.print("#");
				}
				System.out.println();
			} for(int j = 0; j < intW; j++){
					System.out.print("#");
				} int j = 0; int j = 0; j 0 j < intW j intW 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 scan.close() scan.close scan String[] args args public class Main {
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int intH;
		int intW;
		while(true){
			intH = scan.nextInt();
			intW = scan.nextInt();
			if(intH == 0 && intW ==0){
				break;
			}
			for(int i = 0; i < intH; i++){
				for(int j = 0; j < intW; j++){
					System.out.print("#");
				}
				System.out.println();
			}
			System.out.println();
		}

		scan.close();

	}
} public class Main {
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int intH;
		int intW;
		while(true){
			intH = scan.nextInt();
			intW = scan.nextInt();
			if(intH == 0 && intW ==0){
				break;
			}
			for(int i = 0; i < intH; i++){
				for(int j = 0; j < intW; j++){
					System.out.print("#");
				}
				System.out.println();
			}
			System.out.println();
		}

		scan.close();

	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int intH;
		int intW;
		while(true){
			intH = scan.nextInt();
			intW = scan.nextInt();
			if(intH == 0 && intW ==0){
				break;
			}
			for(int i = 0; i < intH; i++){
				for(int j = 0; j < intW; j++){
					System.out.print("#");
				}
				System.out.println();
			}
			System.out.println();
		}

		scan.close();

	}
}