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));
		StringBuilder sb = new StringBuilder();

		String[] strArray = new String[2];
		int a, b;

		while(true) {
	        strArray = br.readLine().split(" ");
	        a = Integer.parseInt(strArray[0]);
	        b = Integer.parseInt(strArray[1]);

	        if(a == 0 && b == 0) {
	        	break;
	        }

	        for(int i=0; i<a; i++) {
	        	for(int j=0; j<b; j++) {
	        		sb.append("#");
	        	}
	        	sb.append("\n");
	        }
	        sb.append("\n");
		}

        System.out.print(sb);
	}
} 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));
		StringBuilder sb = new StringBuilder();

		String[] strArray = new String[2];
		int a, b;

		while(true) {
	        strArray = br.readLine().split(" ");
	        a = Integer.parseInt(strArray[0]);
	        b = Integer.parseInt(strArray[1]);

	        if(a == 0 && b == 0) {
	        	break;
	        }

	        for(int i=0; i<a; i++) {
	        	for(int j=0; j<b; j++) {
	        		sb.append("#");
	        	}
	        	sb.append("\n");
	        }
	        sb.append("\n");
		}

        System.out.print(sb);
	}
} Main public static void main(String[] args) throws IOException {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();

		String[] strArray = new String[2];
		int a, b;

		while(true) {
	        strArray = br.readLine().split(" ");
	        a = Integer.parseInt(strArray[0]);
	        b = Integer.parseInt(strArray[1]);

	        if(a == 0 && b == 0) {
	        	break;
	        }

	        for(int i=0; i<a; i++) {
	        	for(int j=0; j<b; j++) {
	        		sb.append("#");
	        	}
	        	sb.append("\n");
	        }
	        sb.append("\n");
		}

        System.out.print(sb);
	} main {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();

		String[] strArray = new String[2];
		int a, b;

		while(true) {
	        strArray = br.readLine().split(" ");
	        a = Integer.parseInt(strArray[0]);
	        b = Integer.parseInt(strArray[1]);

	        if(a == 0 && b == 0) {
	        	break;
	        }

	        for(int i=0; i<a; i++) {
	        	for(int j=0; j<b; j++) {
	        		sb.append("#");
	        	}
	        	sb.append("\n");
	        }
	        sb.append("\n");
		}

        System.out.print(sb);
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) StringBuilder sb = new StringBuilder(); sb new StringBuilder() String[] strArray = new String[2]; strArray new String[2] 2 int a a b; b while(true) {
	        strArray = br.readLine().split(" ");
	        a = Integer.parseInt(strArray[0]);
	        b = Integer.parseInt(strArray[1]);

	        if(a == 0 && b == 0) {
	        	break;
	        }

	        for(int i=0; i<a; i++) {
	        	for(int j=0; j<b; j++) {
	        		sb.append("#");
	        	}
	        	sb.append("\n");
	        }
	        sb.append("\n");
		} true {
	        strArray = br.readLine().split(" ");
	        a = Integer.parseInt(strArray[0]);
	        b = Integer.parseInt(strArray[1]);

	        if(a == 0 && b == 0) {
	        	break;
	        }

	        for(int i=0; i<a; i++) {
	        	for(int j=0; j<b; j++) {
	        		sb.append("#");
	        	}
	        	sb.append("\n");
	        }
	        sb.append("\n");
		} strArray = br.readLine().split(" ") strArray br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " a = Integer.parseInt(strArray[0]) a Integer.parseInt(strArray[0]) Integer.parseInt Integer strArray[0] strArray 0 b = Integer.parseInt(strArray[1]) b Integer.parseInt(strArray[1]) Integer.parseInt Integer strArray[1] strArray 1 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++) {
	        		sb.append("#");
	        	}
	        	sb.append("\n");
	        } int i=0; int i=0; i 0 i<a i a i++ i++ i {
	        	for(int j=0; j<b; j++) {
	        		sb.append("#");
	        	}
	        	sb.append("\n");
	        } {
	        	for(int j=0; j<b; j++) {
	        		sb.append("#");
	        	}
	        	sb.append("\n");
	        } for(int j=0; j<b; j++) {
	        		sb.append("#");
	        	} int j=0; int j=0; j 0 j<b j b j++ j++ j {
	        		sb.append("#");
	        	} {
	        		sb.append("#");
	        	} sb.append("#") sb.append sb "#" sb.append("\n") sb.append sb "\n" sb.append("\n") sb.append sb "\n" System.out.print(sb) System.out.print System.out System System.out sb String[] args args public class Main {

	public static void main(String[] args) throws IOException {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();

		String[] strArray = new String[2];
		int a, b;

		while(true) {
	        strArray = br.readLine().split(" ");
	        a = Integer.parseInt(strArray[0]);
	        b = Integer.parseInt(strArray[1]);

	        if(a == 0 && b == 0) {
	        	break;
	        }

	        for(int i=0; i<a; i++) {
	        	for(int j=0; j<b; j++) {
	        		sb.append("#");
	        	}
	        	sb.append("\n");
	        }
	        sb.append("\n");
		}

        System.out.print(sb);
	}
} public class Main {

	public static void main(String[] args) throws IOException {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringBuilder sb = new StringBuilder();

		String[] strArray = new String[2];
		int a, b;

		while(true) {
	        strArray = br.readLine().split(" ");
	        a = Integer.parseInt(strArray[0]);
	        b = Integer.parseInt(strArray[1]);

	        if(a == 0 && b == 0) {
	        	break;
	        }

	        for(int i=0; i<a; i++) {
	        	for(int j=0; j<b; j++) {
	        		sb.append("#");
	        	}
	        	sb.append("\n");
	        }
	        sb.append("\n");
		}

        System.out.print(sb);
	}
} 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));
		StringBuilder sb = new StringBuilder();

		String[] strArray = new String[2];
		int a, b;

		while(true) {
	        strArray = br.readLine().split(" ");
	        a = Integer.parseInt(strArray[0]);
	        b = Integer.parseInt(strArray[1]);

	        if(a == 0 && b == 0) {
	        	break;
	        }

	        for(int i=0; i<a; i++) {
	        	for(int j=0; j<b; j++) {
	        		sb.append("#");
	        	}
	        	sb.append("\n");
	        }
	        sb.append("\n");
		}

        System.out.print(sb);
	}
}