import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner x = new Scanner(System.in);
		int h = x.nextInt();
		int w = x.nextInt();
		
		StringBuilder sb1 = new StringBuilder("");
		
		while(h != 0 || w != 0 ){
				for(int i = 0 ; i < h ; i++){

			for(int n = 0 ; n < w ; n++){
				sb1.append("#");
			}
			sb1.append("\n");
		}
		sb1.append("\n");
		 h = x.nextInt();
		 w = x.nextInt();
		}
		
		System.out.print(sb1);
		
		
		
	}

} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner x = new Scanner(System.in);
		int h = x.nextInt();
		int w = x.nextInt();
		
		StringBuilder sb1 = new StringBuilder("");
		
		while(h != 0 || w != 0 ){
				for(int i = 0 ; i < h ; i++){

			for(int n = 0 ; n < w ; n++){
				sb1.append("#");
			}
			sb1.append("\n");
		}
		sb1.append("\n");
		 h = x.nextInt();
		 w = x.nextInt();
		}
		
		System.out.print(sb1);
		
		
		
	}

} Main public static void main(String[] args) {
		Scanner x = new Scanner(System.in);
		int h = x.nextInt();
		int w = x.nextInt();
		
		StringBuilder sb1 = new StringBuilder("");
		
		while(h != 0 || w != 0 ){
				for(int i = 0 ; i < h ; i++){

			for(int n = 0 ; n < w ; n++){
				sb1.append("#");
			}
			sb1.append("\n");
		}
		sb1.append("\n");
		 h = x.nextInt();
		 w = x.nextInt();
		}
		
		System.out.print(sb1);
		
		
		
	} main {
		Scanner x = new Scanner(System.in);
		int h = x.nextInt();
		int w = x.nextInt();
		
		StringBuilder sb1 = new StringBuilder("");
		
		while(h != 0 || w != 0 ){
				for(int i = 0 ; i < h ; i++){

			for(int n = 0 ; n < w ; n++){
				sb1.append("#");
			}
			sb1.append("\n");
		}
		sb1.append("\n");
		 h = x.nextInt();
		 w = x.nextInt();
		}
		
		System.out.print(sb1);
		
		
		
	} Scanner x = new Scanner(System.in); x new Scanner(System.in) int h = x.nextInt(); h x.nextInt() x.nextInt x int w = x.nextInt(); w x.nextInt() x.nextInt x StringBuilder sb1 = new StringBuilder(""); sb1 new StringBuilder("") while(h != 0 || w != 0 ){
				for(int i = 0 ; i < h ; i++){

			for(int n = 0 ; n < w ; n++){
				sb1.append("#");
			}
			sb1.append("\n");
		}
		sb1.append("\n");
		 h = x.nextInt();
		 w = x.nextInt();
		} h != 0 || w != 0 h != 0 h 0 w != 0 w 0 {
				for(int i = 0 ; i < h ; i++){

			for(int n = 0 ; n < w ; n++){
				sb1.append("#");
			}
			sb1.append("\n");
		}
		sb1.append("\n");
		 h = x.nextInt();
		 w = x.nextInt();
		} for(int i = 0 ; i < h ; i++){

			for(int n = 0 ; n < w ; n++){
				sb1.append("#");
			}
			sb1.append("\n");
		} int i = 0 ; int i = 0 ; i 0 i < h i h i++ i++ i {

			for(int n = 0 ; n < w ; n++){
				sb1.append("#");
			}
			sb1.append("\n");
		} {

			for(int n = 0 ; n < w ; n++){
				sb1.append("#");
			}
			sb1.append("\n");
		} for(int n = 0 ; n < w ; n++){
				sb1.append("#");
			} int n = 0 ; int n = 0 ; n 0 n < w n w n++ n++ n {
				sb1.append("#");
			} {
				sb1.append("#");
			} sb1.append("#") sb1.append sb1 "#" sb1.append("\n") sb1.append sb1 "\n" sb1.append("\n") sb1.append sb1 "\n" h = x.nextInt() h x.nextInt() x.nextInt x w = x.nextInt() w x.nextInt() x.nextInt x System.out.print(sb1) System.out.print System.out System System.out sb1 String[] args args public class Main {
	public static void main(String[] args) {
		Scanner x = new Scanner(System.in);
		int h = x.nextInt();
		int w = x.nextInt();
		
		StringBuilder sb1 = new StringBuilder("");
		
		while(h != 0 || w != 0 ){
				for(int i = 0 ; i < h ; i++){

			for(int n = 0 ; n < w ; n++){
				sb1.append("#");
			}
			sb1.append("\n");
		}
		sb1.append("\n");
		 h = x.nextInt();
		 w = x.nextInt();
		}
		
		System.out.print(sb1);
		
		
		
	}

} public class Main {
	public static void main(String[] args) {
		Scanner x = new Scanner(System.in);
		int h = x.nextInt();
		int w = x.nextInt();
		
		StringBuilder sb1 = new StringBuilder("");
		
		while(h != 0 || w != 0 ){
				for(int i = 0 ; i < h ; i++){

			for(int n = 0 ; n < w ; n++){
				sb1.append("#");
			}
			sb1.append("\n");
		}
		sb1.append("\n");
		 h = x.nextInt();
		 w = x.nextInt();
		}
		
		System.out.print(sb1);
		
		
		
	}

} Main
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner x = new Scanner(System.in);
		int h = x.nextInt();
		int w = x.nextInt();
		
		StringBuilder sb1 = new StringBuilder("");
		
		while(h != 0 || w != 0 ){
				for(int i = 0 ; i < h ; i++){

			for(int n = 0 ; n < w ; n++){
				sb1.append("#");
			}
			sb1.append("\n");
		}
		sb1.append("\n");
		 h = x.nextInt();
		 w = x.nextInt();
		}
		
		System.out.print(sb1);
		
		
		
	}

}