import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;
import java.util.StringTokenizer;


public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		Scanner scan=new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		while(scan.hasNext()){
			int x=scan.nextInt();
			int y=scan.nextInt();
			if(x==0 && y==0)
				break;
			for (int i = 0; i < x; i++) {
				for (int j = 0; j < y; j++) {
					System.out.print("#");
				}
				System.out.println();
			}
			System.out.println();
		}

	}

} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.Scanner; Scanner java.util import java.util.StringTokenizer; StringTokenizer java.util public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		Scanner scan=new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		while(scan.hasNext()){
			int x=scan.nextInt();
			int y=scan.nextInt();
			if(x==0 && y==0)
				break;
			for (int i = 0; i < x; i++) {
				for (int j = 0; j < y; j++) {
					System.out.print("#");
				}
				System.out.println();
			}
			System.out.println();
		}

	}

} Main public static void main(String[] args) throws IOException {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		Scanner scan=new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		while(scan.hasNext()){
			int x=scan.nextInt();
			int y=scan.nextInt();
			if(x==0 && y==0)
				break;
			for (int i = 0; i < x; i++) {
				for (int j = 0; j < y; j++) {
					System.out.print("#");
				}
				System.out.println();
			}
			System.out.println();
		}

	} main {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		Scanner scan=new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		while(scan.hasNext()){
			int x=scan.nextInt();
			int y=scan.nextInt();
			if(x==0 && y==0)
				break;
			for (int i = 0; i < x; i++) {
				for (int j = 0; j < y; j++) {
					System.out.print("#");
				}
				System.out.println();
			}
			System.out.println();
		}

	} BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) Scanner scan=new Scanner(new BufferedReader(new InputStreamReader(System.in))); scan new Scanner(new BufferedReader(new InputStreamReader(System.in))) while(scan.hasNext()){
			int x=scan.nextInt();
			int y=scan.nextInt();
			if(x==0 && y==0)
				break;
			for (int i = 0; i < x; i++) {
				for (int j = 0; j < y; j++) {
					System.out.print("#");
				}
				System.out.println();
			}
			System.out.println();
		} scan.hasNext() scan.hasNext scan {
			int x=scan.nextInt();
			int y=scan.nextInt();
			if(x==0 && y==0)
				break;
			for (int i = 0; i < x; i++) {
				for (int j = 0; j < y; j++) {
					System.out.print("#");
				}
				System.out.println();
			}
			System.out.println();
		} int x=scan.nextInt(); x scan.nextInt() scan.nextInt scan int y=scan.nextInt(); y scan.nextInt() scan.nextInt scan if(x==0 && y==0)
				break; x==0 && y==0 x==0 x 0 y==0 y 0 break; for (int i = 0; i < x; i++) {
				for (int j = 0; j < y; j++) {
					System.out.print("#");
				}
				System.out.println();
			} int i = 0; int i = 0; i 0 i < x i x i++ i++ i {
				for (int j = 0; j < y; j++) {
					System.out.print("#");
				}
				System.out.println();
			} {
				for (int j = 0; j < y; j++) {
					System.out.print("#");
				}
				System.out.println();
			} for (int j = 0; j < y; j++) {
					System.out.print("#");
				} int j = 0; int j = 0; j 0 j < y j y 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 String[] args args public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		Scanner scan=new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		while(scan.hasNext()){
			int x=scan.nextInt();
			int y=scan.nextInt();
			if(x==0 && y==0)
				break;
			for (int i = 0; i < x; i++) {
				for (int j = 0; j < y; j++) {
					System.out.print("#");
				}
				System.out.println();
			}
			System.out.println();
		}

	}

} public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		Scanner scan=new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		while(scan.hasNext()){
			int x=scan.nextInt();
			int y=scan.nextInt();
			if(x==0 && y==0)
				break;
			for (int i = 0; i < x; i++) {
				for (int j = 0; j < y; j++) {
					System.out.print("#");
				}
				System.out.println();
			}
			System.out.println();
		}

	}

} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;
import java.util.StringTokenizer;


public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		Scanner scan=new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		while(scan.hasNext()){
			int x=scan.nextInt();
			int y=scan.nextInt();
			if(x==0 && y==0)
				break;
			for (int i = 0; i < x; i++) {
				for (int j = 0; j < y; j++) {
					System.out.print("#");
				}
				System.out.println();
			}
			System.out.println();
		}

	}

}