import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 *
 */

/**
 * @author cthanh
 *
 */
public class Main {

	/**
	 * @param args
	 * @throws IOException
	 */
	public static void main(String[] args) throws IOException {
		// TODO ?????????????????????????????????????????????
		 BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	        String str = br.readLine();

	    String[] strAry = str.split(" ");
	    int H = Integer.parseInt(strAry[0]);
	  	int W = Integer.parseInt(strAry[1]);
        int i,j ;

        while (H != 0 || W != 0){
        for ( i = 0 ; i<H && H!= 0; i++ ){
	  		for ( j=0; j< W && W !=0; j++){
	  			System.out.printf("#");

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

	  	}
	  	 System.out.printf("\n");
	       str = br.readLine();

		   strAry = str.split(" ");
		   H = Integer.parseInt(strAry[0]);
		   W = Integer.parseInt(strAry[1]);

	}
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {

	/**
	 * @param args
	 * @throws IOException
	 */
	public static void main(String[] args) throws IOException {
		// TODO ?????????????????????????????????????????????
		 BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	        String str = br.readLine();

	    String[] strAry = str.split(" ");
	    int H = Integer.parseInt(strAry[0]);
	  	int W = Integer.parseInt(strAry[1]);
        int i,j ;

        while (H != 0 || W != 0){
        for ( i = 0 ; i<H && H!= 0; i++ ){
	  		for ( j=0; j< W && W !=0; j++){
	  			System.out.printf("#");

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

	  	}
	  	 System.out.printf("\n");
	       str = br.readLine();

		   strAry = str.split(" ");
		   H = Integer.parseInt(strAry[0]);
		   W = Integer.parseInt(strAry[1]);

	}
	}
} Main /**
	 * @param args
	 * @throws IOException
	 */
	public static void main(String[] args) throws IOException {
		// TODO ?????????????????????????????????????????????
		 BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	        String str = br.readLine();

	    String[] strAry = str.split(" ");
	    int H = Integer.parseInt(strAry[0]);
	  	int W = Integer.parseInt(strAry[1]);
        int i,j ;

        while (H != 0 || W != 0){
        for ( i = 0 ; i<H && H!= 0; i++ ){
	  		for ( j=0; j< W && W !=0; j++){
	  			System.out.printf("#");

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

	  	}
	  	 System.out.printf("\n");
	       str = br.readLine();

		   strAry = str.split(" ");
		   H = Integer.parseInt(strAry[0]);
		   W = Integer.parseInt(strAry[1]);

	}
	} main {
		// TODO ?????????????????????????????????????????????
		 BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	        String str = br.readLine();

	    String[] strAry = str.split(" ");
	    int H = Integer.parseInt(strAry[0]);
	  	int W = Integer.parseInt(strAry[1]);
        int i,j ;

        while (H != 0 || W != 0){
        for ( i = 0 ; i<H && H!= 0; i++ ){
	  		for ( j=0; j< W && W !=0; j++){
	  			System.out.printf("#");

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

	  	}
	  	 System.out.printf("\n");
	       str = br.readLine();

		   strAry = str.split(" ");
		   H = Integer.parseInt(strAry[0]);
		   W = Integer.parseInt(strAry[1]);

	}
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String str = br.readLine(); str br.readLine() br.readLine br String[] strAry = str.split(" "); strAry str.split(" ") str.split str " " int H = Integer.parseInt(strAry[0]); H Integer.parseInt(strAry[0]) Integer.parseInt Integer strAry[0] strAry 0 int W = Integer.parseInt(strAry[1]); W Integer.parseInt(strAry[1]) Integer.parseInt Integer strAry[1] strAry 1 int i i j ; j while (H != 0 || W != 0){
        for ( i = 0 ; i<H && H!= 0; i++ ){
	  		for ( j=0; j< W && W !=0; j++){
	  			System.out.printf("#");

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

	  	}
	  	 System.out.printf("\n");
	       str = br.readLine();

		   strAry = str.split(" ");
		   H = Integer.parseInt(strAry[0]);
		   W = Integer.parseInt(strAry[1]);

	} H != 0 || W != 0 H != 0 H 0 W != 0 W 0 {
        for ( i = 0 ; i<H && H!= 0; i++ ){
	  		for ( j=0; j< W && W !=0; j++){
	  			System.out.printf("#");

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

	  	}
	  	 System.out.printf("\n");
	       str = br.readLine();

		   strAry = str.split(" ");
		   H = Integer.parseInt(strAry[0]);
		   W = Integer.parseInt(strAry[1]);

	} for ( i = 0 ; i<H && H!= 0; i++ ){
	  		for ( j=0; j< W && W !=0; j++){
	  			System.out.printf("#");

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

	  	} i = 0 ; i = 0 i 0 i<H && H!= 0 i<H i H H!= 0 H 0 i++ i++ i {
	  		for ( j=0; j< W && W !=0; j++){
	  			System.out.printf("#");

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

	  	} {
	  		for ( j=0; j< W && W !=0; j++){
	  			System.out.printf("#");

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

	  	} for ( j=0; j< W && W !=0; j++){
	  			System.out.printf("#");

	  		} j=0; j=0 j 0 j< W && W !=0 j< W j W W !=0 W 0 j++ j++ j {
	  			System.out.printf("#");

	  		} {
	  			System.out.printf("#");

	  		} System.out.printf("#") System.out.printf System.out System System.out "#" System.out.printf("\n") System.out.printf System.out System System.out "\n" System.out.printf("\n") System.out.printf System.out System System.out "\n" str = br.readLine() str br.readLine() br.readLine br strAry = str.split(" ") strAry str.split(" ") str.split str " " H = Integer.parseInt(strAry[0]) H Integer.parseInt(strAry[0]) Integer.parseInt Integer strAry[0] strAry 0 W = Integer.parseInt(strAry[1]) W Integer.parseInt(strAry[1]) Integer.parseInt Integer strAry[1] strAry 1 String[] args args public class Main {

	/**
	 * @param args
	 * @throws IOException
	 */
	public static void main(String[] args) throws IOException {
		// TODO ?????????????????????????????????????????????
		 BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	        String str = br.readLine();

	    String[] strAry = str.split(" ");
	    int H = Integer.parseInt(strAry[0]);
	  	int W = Integer.parseInt(strAry[1]);
        int i,j ;

        while (H != 0 || W != 0){
        for ( i = 0 ; i<H && H!= 0; i++ ){
	  		for ( j=0; j< W && W !=0; j++){
	  			System.out.printf("#");

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

	  	}
	  	 System.out.printf("\n");
	       str = br.readLine();

		   strAry = str.split(" ");
		   H = Integer.parseInt(strAry[0]);
		   W = Integer.parseInt(strAry[1]);

	}
	}
} public class Main {

	/**
	 * @param args
	 * @throws IOException
	 */
	public static void main(String[] args) throws IOException {
		// TODO ?????????????????????????????????????????????
		 BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	        String str = br.readLine();

	    String[] strAry = str.split(" ");
	    int H = Integer.parseInt(strAry[0]);
	  	int W = Integer.parseInt(strAry[1]);
        int i,j ;

        while (H != 0 || W != 0){
        for ( i = 0 ; i<H && H!= 0; i++ ){
	  		for ( j=0; j< W && W !=0; j++){
	  			System.out.printf("#");

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

	  	}
	  	 System.out.printf("\n");
	       str = br.readLine();

		   strAry = str.split(" ");
		   H = Integer.parseInt(strAry[0]);
		   W = Integer.parseInt(strAry[1]);

	}
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 *
 */

/**
 * @author cthanh
 *
 */
public class Main {

	/**
	 * @param args
	 * @throws IOException
	 */
	public static void main(String[] args) throws IOException {
		// TODO ?????????????????????????????????????????????
		 BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	        String str = br.readLine();

	    String[] strAry = str.split(" ");
	    int H = Integer.parseInt(strAry[0]);
	  	int W = Integer.parseInt(strAry[1]);
        int i,j ;

        while (H != 0 || W != 0){
        for ( i = 0 ; i<H && H!= 0; i++ ){
	  		for ( j=0; j< W && W !=0; j++){
	  			System.out.printf("#");

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

	  	}
	  	 System.out.printf("\n");
	       str = br.readLine();

		   strAry = str.split(" ");
		   H = Integer.parseInt(strAry[0]);
		   W = Integer.parseInt(strAry[1]);

	}
	}
}