import java.util.*;

public class Main{

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		while(true){
			int H = scanner.nextInt();
			int W = scanner.nextInt();
			if(H == 0 && W == 0){ break;}
			Print(H, W);
		}
		scanner.close();
	}
	
	
	public static void Print(int H , int W){
		for(int y = 0; y < H ; y++){
			for(int x = 0 ; x < W ; x++){
				System.out.print("#");
			}
			System.out.println("");
		}
                System.out.println("");
		return ;
	}

} import java.util.*; util.* java public class Main{

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		while(true){
			int H = scanner.nextInt();
			int W = scanner.nextInt();
			if(H == 0 && W == 0){ break;}
			Print(H, W);
		}
		scanner.close();
	}
	
	
	public static void Print(int H , int W){
		for(int y = 0; y < H ; y++){
			for(int x = 0 ; x < W ; x++){
				System.out.print("#");
			}
			System.out.println("");
		}
                System.out.println("");
		return ;
	}

} Main public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		while(true){
			int H = scanner.nextInt();
			int W = scanner.nextInt();
			if(H == 0 && W == 0){ break;}
			Print(H, W);
		}
		scanner.close();
	} main {
		Scanner scanner = new Scanner(System.in);
		while(true){
			int H = scanner.nextInt();
			int W = scanner.nextInt();
			if(H == 0 && W == 0){ break;}
			Print(H, W);
		}
		scanner.close();
	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) while(true){
			int H = scanner.nextInt();
			int W = scanner.nextInt();
			if(H == 0 && W == 0){ break;}
			Print(H, W);
		} true {
			int H = scanner.nextInt();
			int W = scanner.nextInt();
			if(H == 0 && W == 0){ break;}
			Print(H, W);
		} int H = scanner.nextInt(); H scanner.nextInt() scanner.nextInt scanner int W = scanner.nextInt(); W scanner.nextInt() scanner.nextInt scanner if(H == 0 && W == 0){ break;} H == 0 && W == 0 H == 0 H 0 W == 0 W 0 { break;} break; Print(H, W) Print H W scanner.close() scanner.close scanner String[] args args public static void Print(int H , int W){
		for(int y = 0; y < H ; y++){
			for(int x = 0 ; x < W ; x++){
				System.out.print("#");
			}
			System.out.println("");
		}
                System.out.println("");
		return ;
	} Print {
		for(int y = 0; y < H ; y++){
			for(int x = 0 ; x < W ; x++){
				System.out.print("#");
			}
			System.out.println("");
		}
                System.out.println("");
		return ;
	} for(int y = 0; y < H ; y++){
			for(int x = 0 ; x < W ; x++){
				System.out.print("#");
			}
			System.out.println("");
		} int y = 0; int y = 0; y 0 y < H y H y++ y++ y {
			for(int x = 0 ; x < W ; x++){
				System.out.print("#");
			}
			System.out.println("");
		} {
			for(int x = 0 ; x < W ; x++){
				System.out.print("#");
			}
			System.out.println("");
		} for(int x = 0 ; x < W ; x++){
				System.out.print("#");
			} int x = 0 ; int x = 0 ; x 0 x < W x W x++ x++ x {
				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 "" return ; int H H int W W public class Main{

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		while(true){
			int H = scanner.nextInt();
			int W = scanner.nextInt();
			if(H == 0 && W == 0){ break;}
			Print(H, W);
		}
		scanner.close();
	}
	
	
	public static void Print(int H , int W){
		for(int y = 0; y < H ; y++){
			for(int x = 0 ; x < W ; x++){
				System.out.print("#");
			}
			System.out.println("");
		}
                System.out.println("");
		return ;
	}

} public class Main{

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		while(true){
			int H = scanner.nextInt();
			int W = scanner.nextInt();
			if(H == 0 && W == 0){ break;}
			Print(H, W);
		}
		scanner.close();
	}
	
	
	public static void Print(int H , int W){
		for(int y = 0; y < H ; y++){
			for(int x = 0 ; x < W ; x++){
				System.out.print("#");
			}
			System.out.println("");
		}
                System.out.println("");
		return ;
	}

} Main
import java.util.*;

public class Main{

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		while(true){
			int H = scanner.nextInt();
			int W = scanner.nextInt();
			if(H == 0 && W == 0){ break;}
			Print(H, W);
		}
		scanner.close();
	}
	
	
	public static void Print(int H , int W){
		for(int y = 0; y < H ; y++){
			for(int x = 0 ; x < W ; x++){
				System.out.print("#");
			}
			System.out.println("");
		}
                System.out.println("");
		return ;
	}

}