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

public class Main{
	public static void main(String[] args) {
		BufferedReader input = new BufferedReader(new InputStreamReader(System.in));


		  try{


			  String ab;
			  String[] strAry;
			  int a;
			  int b;


			  while(true){
			      ab = input.readLine();
		          strAry = ab.split(" ");
		          a=Integer.parseInt(strAry[0]);
	              b=Integer.parseInt(strAry[1]);

	              if(a==0&&b==0){
	        	      break;
	               }
	                  for(int i=0; i<a; i++){

	        	          for(int j=0; j<b-1; j++){
	        		          System.out.print('#');
	        		     
	        	          }
	        	          System.out.println('#');
                          //println??§?????????????????????????????¨???????????????
	                  }

	                  System.out.println("");
	              }



		    }catch(IOException e) {   System.out.println("Exception : " + e);
		    }

	}
} 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) {
		BufferedReader input = new BufferedReader(new InputStreamReader(System.in));


		  try{


			  String ab;
			  String[] strAry;
			  int a;
			  int b;


			  while(true){
			      ab = input.readLine();
		          strAry = ab.split(" ");
		          a=Integer.parseInt(strAry[0]);
	              b=Integer.parseInt(strAry[1]);

	              if(a==0&&b==0){
	        	      break;
	               }
	                  for(int i=0; i<a; i++){

	        	          for(int j=0; j<b-1; j++){
	        		          System.out.print('#');
	        		     
	        	          }
	        	          System.out.println('#');
                          //println??§?????????????????????????????¨???????????????
	                  }

	                  System.out.println("");
	              }



		    }catch(IOException e) {   System.out.println("Exception : " + e);
		    }

	}
} Main public static void main(String[] args) {
		BufferedReader input = new BufferedReader(new InputStreamReader(System.in));


		  try{


			  String ab;
			  String[] strAry;
			  int a;
			  int b;


			  while(true){
			      ab = input.readLine();
		          strAry = ab.split(" ");
		          a=Integer.parseInt(strAry[0]);
	              b=Integer.parseInt(strAry[1]);

	              if(a==0&&b==0){
	        	      break;
	               }
	                  for(int i=0; i<a; i++){

	        	          for(int j=0; j<b-1; j++){
	        		          System.out.print('#');
	        		     
	        	          }
	        	          System.out.println('#');
                          //println??§?????????????????????????????¨???????????????
	                  }

	                  System.out.println("");
	              }



		    }catch(IOException e) {   System.out.println("Exception : " + e);
		    }

	} main {
		BufferedReader input = new BufferedReader(new InputStreamReader(System.in));


		  try{


			  String ab;
			  String[] strAry;
			  int a;
			  int b;


			  while(true){
			      ab = input.readLine();
		          strAry = ab.split(" ");
		          a=Integer.parseInt(strAry[0]);
	              b=Integer.parseInt(strAry[1]);

	              if(a==0&&b==0){
	        	      break;
	               }
	                  for(int i=0; i<a; i++){

	        	          for(int j=0; j<b-1; j++){
	        		          System.out.print('#');
	        		     
	        	          }
	        	          System.out.println('#');
                          //println??§?????????????????????????????¨???????????????
	                  }

	                  System.out.println("");
	              }



		    }catch(IOException e) {   System.out.println("Exception : " + e);
		    }

	} BufferedReader input = new BufferedReader(new InputStreamReader(System.in)); input new BufferedReader(new InputStreamReader(System.in)) try{


			  String ab;
			  String[] strAry;
			  int a;
			  int b;


			  while(true){
			      ab = input.readLine();
		          strAry = ab.split(" ");
		          a=Integer.parseInt(strAry[0]);
	              b=Integer.parseInt(strAry[1]);

	              if(a==0&&b==0){
	        	      break;
	               }
	                  for(int i=0; i<a; i++){

	        	          for(int j=0; j<b-1; j++){
	        		          System.out.print('#');
	        		     
	        	          }
	        	          System.out.println('#');
                          //println??§?????????????????????????????¨???????????????
	                  }

	                  System.out.println("");
	              }



		    }catch(IOException e) {   System.out.println("Exception : " + e);
		    } catch(IOException e) {   System.out.println("Exception : " + e);
		    } IOException e {   System.out.println("Exception : " + e);
		    } System.out.println("Exception : " + e) System.out.println System.out System System.out "Exception : " + e "Exception : " e {


			  String ab;
			  String[] strAry;
			  int a;
			  int b;


			  while(true){
			      ab = input.readLine();
		          strAry = ab.split(" ");
		          a=Integer.parseInt(strAry[0]);
	              b=Integer.parseInt(strAry[1]);

	              if(a==0&&b==0){
	        	      break;
	               }
	                  for(int i=0; i<a; i++){

	        	          for(int j=0; j<b-1; j++){
	        		          System.out.print('#');
	        		     
	        	          }
	        	          System.out.println('#');
                          //println??§?????????????????????????????¨???????????????
	                  }

	                  System.out.println("");
	              }



		    } String ab; ab String[] strAry; strAry int a; a int b; b while(true){
			      ab = input.readLine();
		          strAry = ab.split(" ");
		          a=Integer.parseInt(strAry[0]);
	              b=Integer.parseInt(strAry[1]);

	              if(a==0&&b==0){
	        	      break;
	               }
	                  for(int i=0; i<a; i++){

	        	          for(int j=0; j<b-1; j++){
	        		          System.out.print('#');
	        		     
	        	          }
	        	          System.out.println('#');
                          //println??§?????????????????????????????¨???????????????
	                  }

	                  System.out.println("");
	              } true {
			      ab = input.readLine();
		          strAry = ab.split(" ");
		          a=Integer.parseInt(strAry[0]);
	              b=Integer.parseInt(strAry[1]);

	              if(a==0&&b==0){
	        	      break;
	               }
	                  for(int i=0; i<a; i++){

	        	          for(int j=0; j<b-1; j++){
	        		          System.out.print('#');
	        		     
	        	          }
	        	          System.out.println('#');
                          //println??§?????????????????????????????¨???????????????
	                  }

	                  System.out.println("");
	              } ab = input.readLine() ab input.readLine() input.readLine input strAry = ab.split(" ") strAry ab.split(" ") ab.split ab " " a=Integer.parseInt(strAry[0]) a Integer.parseInt(strAry[0]) Integer.parseInt Integer strAry[0] strAry 0 b=Integer.parseInt(strAry[1]) b Integer.parseInt(strAry[1]) Integer.parseInt Integer strAry[1] strAry 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-1; j++){
	        		          System.out.print('#');
	        		     
	        	          }
	        	          System.out.println('#');
                          //println??§?????????????????????????????¨???????????????
	                  } int i=0; int i=0; i 0 i<a i a i++ i++ i {

	        	          for(int j=0; j<b-1; j++){
	        		          System.out.print('#');
	        		     
	        	          }
	        	          System.out.println('#');
                          //println??§?????????????????????????????¨???????????????
	                  } {

	        	          for(int j=0; j<b-1; j++){
	        		          System.out.print('#');
	        		     
	        	          }
	        	          System.out.println('#');
                          //println??§?????????????????????????????¨???????????????
	                  } for(int j=0; j<b-1; j++){
	        		          System.out.print('#');
	        		     
	        	          } int j=0; int j=0; j 0 j<b-1 j b-1 b 1 j++ j++ j {
	        		          System.out.print('#');
	        		     
	        	          } {
	        		          System.out.print('#');
	        		     
	        	          } System.out.print('#') System.out.print System.out System System.out '#' System.out.println('#') System.out.println System.out System System.out '#' System.out.println("") System.out.println System.out System System.out "" String[] args args public class Main{
	public static void main(String[] args) {
		BufferedReader input = new BufferedReader(new InputStreamReader(System.in));


		  try{


			  String ab;
			  String[] strAry;
			  int a;
			  int b;


			  while(true){
			      ab = input.readLine();
		          strAry = ab.split(" ");
		          a=Integer.parseInt(strAry[0]);
	              b=Integer.parseInt(strAry[1]);

	              if(a==0&&b==0){
	        	      break;
	               }
	                  for(int i=0; i<a; i++){

	        	          for(int j=0; j<b-1; j++){
	        		          System.out.print('#');
	        		     
	        	          }
	        	          System.out.println('#');
                          //println??§?????????????????????????????¨???????????????
	                  }

	                  System.out.println("");
	              }



		    }catch(IOException e) {   System.out.println("Exception : " + e);
		    }

	}
} public class Main{
	public static void main(String[] args) {
		BufferedReader input = new BufferedReader(new InputStreamReader(System.in));


		  try{


			  String ab;
			  String[] strAry;
			  int a;
			  int b;


			  while(true){
			      ab = input.readLine();
		          strAry = ab.split(" ");
		          a=Integer.parseInt(strAry[0]);
	              b=Integer.parseInt(strAry[1]);

	              if(a==0&&b==0){
	        	      break;
	               }
	                  for(int i=0; i<a; i++){

	        	          for(int j=0; j<b-1; j++){
	        		          System.out.print('#');
	        		     
	        	          }
	        	          System.out.println('#');
                          //println??§?????????????????????????????¨???????????????
	                  }

	                  System.out.println("");
	              }



		    }catch(IOException e) {   System.out.println("Exception : " + e);
		    }

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

public class Main{
	public static void main(String[] args) {
		BufferedReader input = new BufferedReader(new InputStreamReader(System.in));


		  try{


			  String ab;
			  String[] strAry;
			  int a;
			  int b;


			  while(true){
			      ab = input.readLine();
		          strAry = ab.split(" ");
		          a=Integer.parseInt(strAry[0]);
	              b=Integer.parseInt(strAry[1]);

	              if(a==0&&b==0){
	        	      break;
	               }
	                  for(int i=0; i<a; i++){

	        	          for(int j=0; j<b-1; j++){
	        		          System.out.print('#');
	        		     
	        	          }
	        	          System.out.println('#');
                          //println??§?????????????????????????????¨???????????????
	                  }

	                  System.out.println("");
	              }



		    }catch(IOException e) {   System.out.println("Exception : " + e);
		    }

	}
}