import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int H;
		int W;

		while (true) {
			do {
				H = sc.nextInt();
				W = sc.nextInt();
			} while (H >= 300 && W >= 300);

			if (H == 0 && W == 0) {
				break;
			}
			for (int j = 0; j < H; j++) {
				for (int i = 0; i < W; i++){
					System.out.print("#");
				}
				System.out.print("\n");
			}

			System.out.print("\n");
		}
	}

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

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int H;
		int W;

		while (true) {
			do {
				H = sc.nextInt();
				W = sc.nextInt();
			} while (H >= 300 && W >= 300);

			if (H == 0 && W == 0) {
				break;
			}
			for (int j = 0; j < H; j++) {
				for (int i = 0; i < W; i++){
					System.out.print("#");
				}
				System.out.print("\n");
			}

			System.out.print("\n");
		}
	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int H;
		int W;

		while (true) {
			do {
				H = sc.nextInt();
				W = sc.nextInt();
			} while (H >= 300 && W >= 300);

			if (H == 0 && W == 0) {
				break;
			}
			for (int j = 0; j < H; j++) {
				for (int i = 0; i < W; i++){
					System.out.print("#");
				}
				System.out.print("\n");
			}

			System.out.print("\n");
		}
	} main {
		Scanner sc = new Scanner(System.in);

		int H;
		int W;

		while (true) {
			do {
				H = sc.nextInt();
				W = sc.nextInt();
			} while (H >= 300 && W >= 300);

			if (H == 0 && W == 0) {
				break;
			}
			for (int j = 0; j < H; j++) {
				for (int i = 0; i < W; i++){
					System.out.print("#");
				}
				System.out.print("\n");
			}

			System.out.print("\n");
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int H; H int W; W while (true) {
			do {
				H = sc.nextInt();
				W = sc.nextInt();
			} while (H >= 300 && W >= 300);

			if (H == 0 && W == 0) {
				break;
			}
			for (int j = 0; j < H; j++) {
				for (int i = 0; i < W; i++){
					System.out.print("#");
				}
				System.out.print("\n");
			}

			System.out.print("\n");
		} true {
			do {
				H = sc.nextInt();
				W = sc.nextInt();
			} while (H >= 300 && W >= 300);

			if (H == 0 && W == 0) {
				break;
			}
			for (int j = 0; j < H; j++) {
				for (int i = 0; i < W; i++){
					System.out.print("#");
				}
				System.out.print("\n");
			}

			System.out.print("\n");
		} do {
				H = sc.nextInt();
				W = sc.nextInt();
			} while (H >= 300 && W >= 300); H >= 300 && W >= 300 H >= 300 H 300 W >= 300 W 300 {
				H = sc.nextInt();
				W = sc.nextInt();
			} H = sc.nextInt() H sc.nextInt() sc.nextInt sc W = sc.nextInt() W sc.nextInt() sc.nextInt sc if (H == 0 && W == 0) {
				break;
			} H == 0 && W == 0 H == 0 H 0 W == 0 W 0 {
				break;
			} break; for (int j = 0; j < H; j++) {
				for (int i = 0; i < W; i++){
					System.out.print("#");
				}
				System.out.print("\n");
			} int j = 0; int j = 0; j 0 j < H j H j++ j++ j {
				for (int i = 0; i < W; i++){
					System.out.print("#");
				}
				System.out.print("\n");
			} {
				for (int i = 0; i < W; i++){
					System.out.print("#");
				}
				System.out.print("\n");
			} for (int i = 0; i < W; i++){
					System.out.print("#");
				} int i = 0; int i = 0; i 0 i < W i W i++ i++ i {
					System.out.print("#");
				} {
					System.out.print("#");
				} System.out.print("#") System.out.print System.out System System.out "#" System.out.print("\n") System.out.print System.out System System.out "\n" System.out.print("\n") System.out.print System.out System System.out "\n" String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int H;
		int W;

		while (true) {
			do {
				H = sc.nextInt();
				W = sc.nextInt();
			} while (H >= 300 && W >= 300);

			if (H == 0 && W == 0) {
				break;
			}
			for (int j = 0; j < H; j++) {
				for (int i = 0; i < W; i++){
					System.out.print("#");
				}
				System.out.print("\n");
			}

			System.out.print("\n");
		}
	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int H;
		int W;

		while (true) {
			do {
				H = sc.nextInt();
				W = sc.nextInt();
			} while (H >= 300 && W >= 300);

			if (H == 0 && W == 0) {
				break;
			}
			for (int j = 0; j < H; j++) {
				for (int i = 0; i < W; i++){
					System.out.print("#");
				}
				System.out.print("\n");
			}

			System.out.print("\n");
		}
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int H;
		int W;

		while (true) {
			do {
				H = sc.nextInt();
				W = sc.nextInt();
			} while (H >= 300 && W >= 300);

			if (H == 0 && W == 0) {
				break;
			}
			for (int j = 0; j < H; j++) {
				for (int i = 0; i < W; i++){
					System.out.print("#");
				}
				System.out.print("\n");
			}

			System.out.print("\n");
		}
	}

}