
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

/**
 * ????????¢?????????
 *
 * ??????H cm ?????? W cm ???????????¢?????????????????°?????????????????????????????????
 *
 * 1 cm ?? 1cm ???????????¢??? '#'??§??¨????????????
 *
 * Input
 * ??\???????????°????????????????????????????§???????????????????????????????????????????????????¢????????\????????¨????????§??????
 *
 * H W
 *
 * H, W ?????¨?????? 0 ?????¨????????\?????????????????¨????????????
 *
 * Output
 * ????????????????????????????????????H ?? W ?????? '#' ??§????????????????????¢???????????????????????????
 *
 * ?????????????????????????????????????????????????????\??????????????????
 *
 * Constraints
 * 1 ??? H, W ??? 300
 *
 * http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_5_A
 *
 * @author wsKmatsuda
 *
 */
public class Main {

	public static void main(String[] args) {
		new Main().run();
	}

	public void run(){

        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        String inputData;
        List<Square> squareList = new ArrayList<Square>();
        try {
        	//??\???
	        while(true){
				inputData = reader.readLine();
	            if("0 0".equals(inputData)){
	            	break;
	            }else{
					String[] strNumber = inputData.split(" ");
					int h = Integer.parseInt(strNumber[0]);
					int w = Integer.parseInt(strNumber[1]);
					squareList.add(new Square(h,w));
	            }
	        }

	        //??????
	        for(Square square : squareList){
				outputSquare(square.h , square.w);
				System.out.println();
	        }

		} catch (IOException e) {
			e.printStackTrace();
		}

	}

	/**
	 * ????????¢?????????
	 * @param h
	 * @param w
	 */
	private static void outputSquare(int h, int w) {
		StringBuilder sbLine = new StringBuilder();
		for(int i=0;i< w ;i++){
			sbLine.append("#");
		}
		for(int i=0;i<h;i++){
			System.out.println(sbLine.toString());
		}
	}

	/**
	 * ????§???¢?????????
	 * h,w???????????????
	 */
	class Square{

		public int h;
		public int w;

		Square(int _h ,int _w){
			h = _h;
			w = _w;
		}
	}

}
/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz