import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		StringBuilder sb=new StringBuilder("");
		
		Scanner n=new Scanner(System.in);
		
		int a=n.nextInt();
		int b=n.nextInt();
		
		while (a!=0 || b!=0){
			for (int c=0;c<a;c++){
				for (int d=0;d<b;d++){
					sb.append("#");
				}
				sb.append("\n");
				
			}
			System.out.println(sb);
			a=n.nextInt();
			b=n.nextInt();
			sb=new StringBuilder("");
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		StringBuilder sb=new StringBuilder("");
		
		Scanner n=new Scanner(System.in);
		
		int a=n.nextInt();
		int b=n.nextInt();
		
		while (a!=0 || b!=0){
			for (int c=0;c<a;c++){
				for (int d=0;d<b;d++){
					sb.append("#");
				}
				sb.append("\n");
				
			}
			System.out.println(sb);
			a=n.nextInt();
			b=n.nextInt();
			sb=new StringBuilder("");
		}
	}
} Main public static void main(String[] args) {
		StringBuilder sb=new StringBuilder("");
		
		Scanner n=new Scanner(System.in);
		
		int a=n.nextInt();
		int b=n.nextInt();
		
		while (a!=0 || b!=0){
			for (int c=0;c<a;c++){
				for (int d=0;d<b;d++){
					sb.append("#");
				}
				sb.append("\n");
				
			}
			System.out.println(sb);
			a=n.nextInt();
			b=n.nextInt();
			sb=new StringBuilder("");
		}
	} main {
		StringBuilder sb=new StringBuilder("");
		
		Scanner n=new Scanner(System.in);
		
		int a=n.nextInt();
		int b=n.nextInt();
		
		while (a!=0 || b!=0){
			for (int c=0;c<a;c++){
				for (int d=0;d<b;d++){
					sb.append("#");
				}
				sb.append("\n");
				
			}
			System.out.println(sb);
			a=n.nextInt();
			b=n.nextInt();
			sb=new StringBuilder("");
		}
	} StringBuilder sb=new StringBuilder(""); sb new StringBuilder("") Scanner n=new Scanner(System.in); n new Scanner(System.in) int a=n.nextInt(); a n.nextInt() n.nextInt n int b=n.nextInt(); b n.nextInt() n.nextInt n while (a!=0 || b!=0){
			for (int c=0;c<a;c++){
				for (int d=0;d<b;d++){
					sb.append("#");
				}
				sb.append("\n");
				
			}
			System.out.println(sb);
			a=n.nextInt();
			b=n.nextInt();
			sb=new StringBuilder("");
		} a!=0 || b!=0 a!=0 a 0 b!=0 b 0 {
			for (int c=0;c<a;c++){
				for (int d=0;d<b;d++){
					sb.append("#");
				}
				sb.append("\n");
				
			}
			System.out.println(sb);
			a=n.nextInt();
			b=n.nextInt();
			sb=new StringBuilder("");
		} for (int c=0;c<a;c++){
				for (int d=0;d<b;d++){
					sb.append("#");
				}
				sb.append("\n");
				
			} int c=0; int c=0; c 0 c<a c a c++ c++ c {
				for (int d=0;d<b;d++){
					sb.append("#");
				}
				sb.append("\n");
				
			} {
				for (int d=0;d<b;d++){
					sb.append("#");
				}
				sb.append("\n");
				
			} for (int d=0;d<b;d++){
					sb.append("#");
				} int d=0; int d=0; d 0 d<b d b d++ d++ d {
					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 a=n.nextInt() a n.nextInt() n.nextInt n b=n.nextInt() b n.nextInt() n.nextInt n sb=new StringBuilder("") sb new StringBuilder("") String[] args args public class Main {

	public static void main(String[] args) {
		StringBuilder sb=new StringBuilder("");
		
		Scanner n=new Scanner(System.in);
		
		int a=n.nextInt();
		int b=n.nextInt();
		
		while (a!=0 || b!=0){
			for (int c=0;c<a;c++){
				for (int d=0;d<b;d++){
					sb.append("#");
				}
				sb.append("\n");
				
			}
			System.out.println(sb);
			a=n.nextInt();
			b=n.nextInt();
			sb=new StringBuilder("");
		}
	}
} public class Main {

	public static void main(String[] args) {
		StringBuilder sb=new StringBuilder("");
		
		Scanner n=new Scanner(System.in);
		
		int a=n.nextInt();
		int b=n.nextInt();
		
		while (a!=0 || b!=0){
			for (int c=0;c<a;c++){
				for (int d=0;d<b;d++){
					sb.append("#");
				}
				sb.append("\n");
				
			}
			System.out.println(sb);
			a=n.nextInt();
			b=n.nextInt();
			sb=new StringBuilder("");
		}
	}
} Main
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		StringBuilder sb=new StringBuilder("");
		
		Scanner n=new Scanner(System.in);
		
		int a=n.nextInt();
		int b=n.nextInt();
		
		while (a!=0 || b!=0){
			for (int c=0;c<a;c++){
				for (int d=0;d<b;d++){
					sb.append("#");
				}
				sb.append("\n");
				
			}
			System.out.println(sb);
			a=n.nextInt();
			b=n.nextInt();
			sb=new StringBuilder("");
		}
	}
}