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));
		while (true) {
			String[] tmp = br.readLine().split(" ");
			long h = Long.parseLong(tmp[0]);
			long w = Long.parseLong(tmp[1]);
			if(h == 0 && w == 0)break;
			else write(h, w);
		}
	}
	
	private static void write(long h, long w){
		StringBuilder sb = new StringBuilder();
		for(int i = 0;i < w;i++){
			sb.append("#");
		}
		sb.append(String.format("%n"));
		String line = sb.toString();
		sb.delete(0, sb.length());
		for(int i = 0;i < h;i++){
			sb.append(line);
		}
		System.out.println(sb.toString());
	}
} 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));
		while (true) {
			String[] tmp = br.readLine().split(" ");
			long h = Long.parseLong(tmp[0]);
			long w = Long.parseLong(tmp[1]);
			if(h == 0 && w == 0)break;
			else write(h, w);
		}
	}
	
	private static void write(long h, long w){
		StringBuilder sb = new StringBuilder();
		for(int i = 0;i < w;i++){
			sb.append("#");
		}
		sb.append(String.format("%n"));
		String line = sb.toString();
		sb.delete(0, sb.length());
		for(int i = 0;i < h;i++){
			sb.append(line);
		}
		System.out.println(sb.toString());
	}
} Main public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		while (true) {
			String[] tmp = br.readLine().split(" ");
			long h = Long.parseLong(tmp[0]);
			long w = Long.parseLong(tmp[1]);
			if(h == 0 && w == 0)break;
			else write(h, w);
		}
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		while (true) {
			String[] tmp = br.readLine().split(" ");
			long h = Long.parseLong(tmp[0]);
			long w = Long.parseLong(tmp[1]);
			if(h == 0 && w == 0)break;
			else write(h, w);
		}
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) while (true) {
			String[] tmp = br.readLine().split(" ");
			long h = Long.parseLong(tmp[0]);
			long w = Long.parseLong(tmp[1]);
			if(h == 0 && w == 0)break;
			else write(h, w);
		} true {
			String[] tmp = br.readLine().split(" ");
			long h = Long.parseLong(tmp[0]);
			long w = Long.parseLong(tmp[1]);
			if(h == 0 && w == 0)break;
			else write(h, w);
		} String[] tmp = br.readLine().split(" "); tmp br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " long h = Long.parseLong(tmp[0]); h Long.parseLong(tmp[0]) Long.parseLong Long tmp[0] tmp 0 long w = Long.parseLong(tmp[1]); w Long.parseLong(tmp[1]) Long.parseLong Long tmp[1] tmp 1 if(h == 0 && w == 0)break;
			else write(h, w); h == 0 && w == 0 h == 0 h 0 w == 0 w 0 break; write(h, w) write h w String[] args args private static void write(long h, long w){
		StringBuilder sb = new StringBuilder();
		for(int i = 0;i < w;i++){
			sb.append("#");
		}
		sb.append(String.format("%n"));
		String line = sb.toString();
		sb.delete(0, sb.length());
		for(int i = 0;i < h;i++){
			sb.append(line);
		}
		System.out.println(sb.toString());
	} write {
		StringBuilder sb = new StringBuilder();
		for(int i = 0;i < w;i++){
			sb.append("#");
		}
		sb.append(String.format("%n"));
		String line = sb.toString();
		sb.delete(0, sb.length());
		for(int i = 0;i < h;i++){
			sb.append(line);
		}
		System.out.println(sb.toString());
	} StringBuilder sb = new StringBuilder(); sb new StringBuilder() for(int i = 0;i < w;i++){
			sb.append("#");
		} int i = 0; int i = 0; i 0 i < w i w i++ i++ i {
			sb.append("#");
		} {
			sb.append("#");
		} sb.append("#") sb.append sb "#" sb.append(String.format("%n")) sb.append sb String.format("%n") String.format String "%n" String line = sb.toString(); line sb.toString() sb.toString sb sb.delete(0, sb.length()) sb.delete sb 0 sb.length() sb.length sb for(int i = 0;i < h;i++){
			sb.append(line);
		} int i = 0; int i = 0; i 0 i < h i h i++ i++ i {
			sb.append(line);
		} {
			sb.append(line);
		} sb.append(line) sb.append sb line System.out.println(sb.toString()) System.out.println System.out System System.out sb.toString() sb.toString sb long h h long w w public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		while (true) {
			String[] tmp = br.readLine().split(" ");
			long h = Long.parseLong(tmp[0]);
			long w = Long.parseLong(tmp[1]);
			if(h == 0 && w == 0)break;
			else write(h, w);
		}
	}
	
	private static void write(long h, long w){
		StringBuilder sb = new StringBuilder();
		for(int i = 0;i < w;i++){
			sb.append("#");
		}
		sb.append(String.format("%n"));
		String line = sb.toString();
		sb.delete(0, sb.length());
		for(int i = 0;i < h;i++){
			sb.append(line);
		}
		System.out.println(sb.toString());
	}
} public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		while (true) {
			String[] tmp = br.readLine().split(" ");
			long h = Long.parseLong(tmp[0]);
			long w = Long.parseLong(tmp[1]);
			if(h == 0 && w == 0)break;
			else write(h, w);
		}
	}
	
	private static void write(long h, long w){
		StringBuilder sb = new StringBuilder();
		for(int i = 0;i < w;i++){
			sb.append("#");
		}
		sb.append(String.format("%n"));
		String line = sb.toString();
		sb.delete(0, sb.length());
		for(int i = 0;i < h;i++){
			sb.append(line);
		}
		System.out.println(sb.toString());
	}
} 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));
		while (true) {
			String[] tmp = br.readLine().split(" ");
			long h = Long.parseLong(tmp[0]);
			long w = Long.parseLong(tmp[1]);
			if(h == 0 && w == 0)break;
			else write(h, w);
		}
	}
	
	private static void write(long h, long w){
		StringBuilder sb = new StringBuilder();
		for(int i = 0;i < w;i++){
			sb.append("#");
		}
		sb.append(String.format("%n"));
		String line = sb.toString();
		sb.delete(0, sb.length());
		for(int i = 0;i < h;i++){
			sb.append(line);
		}
		System.out.println(sb.toString());
	}
}