import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while (true) {
			int x = sc.nextInt();
			int y = sc.nextInt();
			if (x == 0 && y == 0)
				break;
			else
				opi(x, y);
			System.out.println();
		}
		sc.close();
	}

	static void opi(int x, int y) {
		for (int i = 0; i < x; i++) {
			for (int j = 0; j < y; j++) {
				System.out.print("#");
			}
			System.out.println();
		}
	}
}
 import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while (true) {
			int x = sc.nextInt();
			int y = sc.nextInt();
			if (x == 0 && y == 0)
				break;
			else
				opi(x, y);
			System.out.println();
		}
		sc.close();
	}

	static void opi(int x, int y) {
		for (int i = 0; i < x; i++) {
			for (int j = 0; j < y; j++) {
				System.out.print("#");
			}
			System.out.println();
		}
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while (true) {
			int x = sc.nextInt();
			int y = sc.nextInt();
			if (x == 0 && y == 0)
				break;
			else
				opi(x, y);
			System.out.println();
		}
		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);
		while (true) {
			int x = sc.nextInt();
			int y = sc.nextInt();
			if (x == 0 && y == 0)
				break;
			else
				opi(x, y);
			System.out.println();
		}
		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) while (true) {
			int x = sc.nextInt();
			int y = sc.nextInt();
			if (x == 0 && y == 0)
				break;
			else
				opi(x, y);
			System.out.println();
		} true {
			int x = sc.nextInt();
			int y = sc.nextInt();
			if (x == 0 && y == 0)
				break;
			else
				opi(x, y);
			System.out.println();
		} int x = sc.nextInt(); x sc.nextInt() sc.nextInt sc int y = sc.nextInt(); y sc.nextInt() sc.nextInt sc if (x == 0 && y == 0)
				break;
			else
				opi(x, y); x == 0 && y == 0 x == 0 x 0 y == 0 y 0 break; opi(x, y) opi x y System.out.println() System.out.println System.out System System.out sc.close() sc.close sc String[] args args static void opi(int x, int y) {
		for (int i = 0; i < x; i++) {
			for (int j = 0; j < y; j++) {
				System.out.print("#");
			}
			System.out.println();
		}
	} opi {
		for (int i = 0; i < x; i++) {
			for (int j = 0; j < y; j++) {
				System.out.print("#");
			}
			System.out.println();
		}
	} 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 int x x int y y public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while (true) {
			int x = sc.nextInt();
			int y = sc.nextInt();
			if (x == 0 && y == 0)
				break;
			else
				opi(x, y);
			System.out.println();
		}
		sc.close();
	}

	static void opi(int x, int y) {
		for (int i = 0; i < x; i++) {
			for (int j = 0; j < y; j++) {
				System.out.print("#");
			}
			System.out.println();
		}
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while (true) {
			int x = sc.nextInt();
			int y = sc.nextInt();
			if (x == 0 && y == 0)
				break;
			else
				opi(x, y);
			System.out.println();
		}
		sc.close();
	}

	static void opi(int x, int y) {
		for (int i = 0; i < x; i++) {
			for (int j = 0; j < y; j++) {
				System.out.print("#");
			}
			System.out.println();
		}
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while (true) {
			int x = sc.nextInt();
			int y = sc.nextInt();
			if (x == 0 && y == 0)
				break;
			else
				opi(x, y);
			System.out.println();
		}
		sc.close();
	}

	static void opi(int x, int y) {
		for (int i = 0; i < x; i++) {
			for (int j = 0; j < y; j++) {
				System.out.print("#");
			}
			System.out.println();
		}
	}
}

