import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while (true) {
			int h = sc.nextInt();
			int w = sc.nextInt();
			if (h == 0 || w == 0) {
				sc.close();
				break;
			}
			printRectangle(h, w);
		}
	}
	
	public static void printRectangle(int h, int w) {
		StringBuilder sb = new StringBuilder();
		for (int i = 0; i < h; i++) {
			for (int j = 0; j < w; j++) {
				sb.append('#');
			}
			sb.append("\n");
		}
		System.out.println(sb);
	}
} 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 h = sc.nextInt();
			int w = sc.nextInt();
			if (h == 0 || w == 0) {
				sc.close();
				break;
			}
			printRectangle(h, w);
		}
	}
	
	public static void printRectangle(int h, int w) {
		StringBuilder sb = new StringBuilder();
		for (int i = 0; i < h; i++) {
			for (int j = 0; j < w; j++) {
				sb.append('#');
			}
			sb.append("\n");
		}
		System.out.println(sb);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while (true) {
			int h = sc.nextInt();
			int w = sc.nextInt();
			if (h == 0 || w == 0) {
				sc.close();
				break;
			}
			printRectangle(h, w);
		}
	} main {
		Scanner sc = new Scanner(System.in);
		while (true) {
			int h = sc.nextInt();
			int w = sc.nextInt();
			if (h == 0 || w == 0) {
				sc.close();
				break;
			}
			printRectangle(h, w);
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) while (true) {
			int h = sc.nextInt();
			int w = sc.nextInt();
			if (h == 0 || w == 0) {
				sc.close();
				break;
			}
			printRectangle(h, w);
		} true {
			int h = sc.nextInt();
			int w = sc.nextInt();
			if (h == 0 || w == 0) {
				sc.close();
				break;
			}
			printRectangle(h, w);
		} int h = sc.nextInt(); h sc.nextInt() sc.nextInt sc int w = sc.nextInt(); w sc.nextInt() sc.nextInt sc if (h == 0 || w == 0) {
				sc.close();
				break;
			} h == 0 || w == 0 h == 0 h 0 w == 0 w 0 {
				sc.close();
				break;
			} sc.close() sc.close sc break; printRectangle(h, w) printRectangle h w String[] args args public static void printRectangle(int h, int w) {
		StringBuilder sb = new StringBuilder();
		for (int i = 0; i < h; i++) {
			for (int j = 0; j < w; j++) {
				sb.append('#');
			}
			sb.append("\n");
		}
		System.out.println(sb);
	} printRectangle {
		StringBuilder sb = new StringBuilder();
		for (int i = 0; i < h; i++) {
			for (int j = 0; j < w; j++) {
				sb.append('#');
			}
			sb.append("\n");
		}
		System.out.println(sb);
	} StringBuilder sb = new StringBuilder(); sb new StringBuilder() for (int i = 0; i < h; i++) {
			for (int j = 0; j < w; j++) {
				sb.append('#');
			}
			sb.append("\n");
		} int i = 0; int i = 0; i 0 i < h i h i++ i++ i {
			for (int j = 0; j < w; j++) {
				sb.append('#');
			}
			sb.append("\n");
		} {
			for (int j = 0; j < w; j++) {
				sb.append('#');
			}
			sb.append("\n");
		} for (int j = 0; j < w; j++) {
				sb.append('#');
			} int j = 0; int j = 0; j 0 j < w j w j++ j++ j {
				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 int h h int w w public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while (true) {
			int h = sc.nextInt();
			int w = sc.nextInt();
			if (h == 0 || w == 0) {
				sc.close();
				break;
			}
			printRectangle(h, w);
		}
	}
	
	public static void printRectangle(int h, int w) {
		StringBuilder sb = new StringBuilder();
		for (int i = 0; i < h; i++) {
			for (int j = 0; j < w; j++) {
				sb.append('#');
			}
			sb.append("\n");
		}
		System.out.println(sb);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while (true) {
			int h = sc.nextInt();
			int w = sc.nextInt();
			if (h == 0 || w == 0) {
				sc.close();
				break;
			}
			printRectangle(h, w);
		}
	}
	
	public static void printRectangle(int h, int w) {
		StringBuilder sb = new StringBuilder();
		for (int i = 0; i < h; i++) {
			for (int j = 0; j < w; j++) {
				sb.append('#');
			}
			sb.append("\n");
		}
		System.out.println(sb);
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while (true) {
			int h = sc.nextInt();
			int w = sc.nextInt();
			if (h == 0 || w == 0) {
				sc.close();
				break;
			}
			printRectangle(h, w);
		}
	}
	
	public static void printRectangle(int h, int w) {
		StringBuilder sb = new StringBuilder();
		for (int i = 0; i < h; i++) {
			for (int j = 0; j < w; j++) {
				sb.append('#');
			}
			sb.append("\n");
		}
		System.out.println(sb);
	}
}