import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args)throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int a = 0;
		int b = 0;

		while(true){
			String str = br.readLine();
			String[] s = str.split(" ");

			a = Integer.parseInt(s[0]);
			b = Integer.parseInt(s[1]);
			if((a <= 300) &&(b <= 300)){
				if((a == 0)&&(b == 0)){
					break;
				}

				for(int i = 0; i < a; i++){
					for(int j = 0; j < b; 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 public class Main {
	public static void main(String[] args)throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int a = 0;
		int b = 0;

		while(true){
			String str = br.readLine();
			String[] s = str.split(" ");

			a = Integer.parseInt(s[0]);
			b = Integer.parseInt(s[1]);
			if((a <= 300) &&(b <= 300)){
				if((a == 0)&&(b == 0)){
					break;
				}

				for(int i = 0; i < a; i++){
					for(int j = 0; j < b; 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));
		int a = 0;
		int b = 0;

		while(true){
			String str = br.readLine();
			String[] s = str.split(" ");

			a = Integer.parseInt(s[0]);
			b = Integer.parseInt(s[1]);
			if((a <= 300) &&(b <= 300)){
				if((a == 0)&&(b == 0)){
					break;
				}

				for(int i = 0; i < a; i++){
					for(int j = 0; j < b; j++){
						System.out.print("#");
					}
					System.out.println();
				}
				System.out.println();
			}
		}
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int a = 0;
		int b = 0;

		while(true){
			String str = br.readLine();
			String[] s = str.split(" ");

			a = Integer.parseInt(s[0]);
			b = Integer.parseInt(s[1]);
			if((a <= 300) &&(b <= 300)){
				if((a == 0)&&(b == 0)){
					break;
				}

				for(int i = 0; i < a; i++){
					for(int j = 0; j < b; 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)) int a = 0; a 0 int b = 0; b 0 while(true){
			String str = br.readLine();
			String[] s = str.split(" ");

			a = Integer.parseInt(s[0]);
			b = Integer.parseInt(s[1]);
			if((a <= 300) &&(b <= 300)){
				if((a == 0)&&(b == 0)){
					break;
				}

				for(int i = 0; i < a; i++){
					for(int j = 0; j < b; j++){
						System.out.print("#");
					}
					System.out.println();
				}
				System.out.println();
			}
		} true {
			String str = br.readLine();
			String[] s = str.split(" ");

			a = Integer.parseInt(s[0]);
			b = Integer.parseInt(s[1]);
			if((a <= 300) &&(b <= 300)){
				if((a == 0)&&(b == 0)){
					break;
				}

				for(int i = 0; i < a; i++){
					for(int j = 0; j < b; j++){
						System.out.print("#");
					}
					System.out.println();
				}
				System.out.println();
			}
		} String str = br.readLine(); str br.readLine() br.readLine br String[] s = str.split(" "); s str.split(" ") str.split str " " a = Integer.parseInt(s[0]) a Integer.parseInt(s[0]) Integer.parseInt Integer s[0] s 0 b = Integer.parseInt(s[1]) b Integer.parseInt(s[1]) Integer.parseInt Integer s[1] s 1 if((a <= 300) &&(b <= 300)){
				if((a == 0)&&(b == 0)){
					break;
				}

				for(int i = 0; i < a; i++){
					for(int j = 0; j < b; j++){
						System.out.print("#");
					}
					System.out.println();
				}
				System.out.println();
			} (a <= 300) &&(b <= 300) (a <= 300) a 300 (b <= 300) b 300 {
				if((a == 0)&&(b == 0)){
					break;
				}

				for(int i = 0; i < a; i++){
					for(int j = 0; j < b; j++){
						System.out.print("#");
					}
					System.out.println();
				}
				System.out.println();
			} if((a == 0)&&(b == 0)){
					break;
				} (a == 0)&&(b == 0) (a == 0) a 0 (b == 0) b 0 {
					break;
				} break; for(int i = 0; i < a; i++){
					for(int j = 0; j < b; j++){
						System.out.print("#");
					}
					System.out.println();
				} int i = 0; int i = 0; i 0 i < a i a i++ i++ i {
					for(int j = 0; j < b; j++){
						System.out.print("#");
					}
					System.out.println();
				} {
					for(int j = 0; j < b; j++){
						System.out.print("#");
					}
					System.out.println();
				} for(int j = 0; j < b; j++){
						System.out.print("#");
					} int j = 0; int j = 0; j 0 j < b j b 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));
		int a = 0;
		int b = 0;

		while(true){
			String str = br.readLine();
			String[] s = str.split(" ");

			a = Integer.parseInt(s[0]);
			b = Integer.parseInt(s[1]);
			if((a <= 300) &&(b <= 300)){
				if((a == 0)&&(b == 0)){
					break;
				}

				for(int i = 0; i < a; i++){
					for(int j = 0; j < b; 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));
		int a = 0;
		int b = 0;

		while(true){
			String str = br.readLine();
			String[] s = str.split(" ");

			a = Integer.parseInt(s[0]);
			b = Integer.parseInt(s[1]);
			if((a <= 300) &&(b <= 300)){
				if((a == 0)&&(b == 0)){
					break;
				}

				for(int i = 0; i < a; i++){
					for(int j = 0; j < b; j++){
						System.out.print("#");
					}
					System.out.println();
				}
				System.out.println();
			}
		}
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args)throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int a = 0;
		int b = 0;

		while(true){
			String str = br.readLine();
			String[] s = str.split(" ");

			a = Integer.parseInt(s[0]);
			b = Integer.parseInt(s[1]);
			if((a <= 300) &&(b <= 300)){
				if((a == 0)&&(b == 0)){
					break;
				}

				for(int i = 0; i < a; i++){
					for(int j = 0; j < b; j++){
						System.out.print("#");
					}
					System.out.println();
				}
				System.out.println();
			}
		}
	}
}