procedure line_symbol(N:longint; border,fill_char:char);
var i:longint;
begin
  if (N>1) then 
  write(border,' ');
  for i:=1 to N-2 do
    write(fill_char,' ');
  writeln(border);
end;

procedure triangle(height: longint; border,fill_char : char);
var i:longint;
begin
  if (height>1) then 
  line_symbol(height,border,border);
  for i:=1 to height-2 do
     line_symbol(i,border,fill_char);
  line_symbol(1,border,border);
end;

var height,width:longint;
begin
  read(height,width);
  rectangle(height,width,'*',' ');
end.
