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 line_space(N:longint);
var i:longint;
begin
  for i:=1 to N do
    write(' ');
end;

procedure triangle_space_1(height: longint; border,fill_char : char);
var i:longint;
begin
  for i:=1 to height-1 do
  begin
     line_space((height-i)*2);
     line_symbol(i,border,fill_char);
  end;
  line_symbol(height,border,border);
end;

procedure triangle_space_2(height: longint; border,fill_char : char);
var i:longint;
begin
  for i:=1 to height-1 do
  begin
     line_space((height-i)*2);
     line_symbol(2*i-1,border,fill_char);
  end;
  line_symbol(2*height-1,border,border);
end;

procedure triangle_space_3(height: longint; border,fill_char : char);
var i:longint;
begin
  for i:=1 to height do
  begin
     line_space((height-i)*2);
     line_symbol(i,border,fill_char);
  end;
  for i:=height-1 downto 1 do
  begin
     line_space((height-i)*2);
     line_symbol(i,border,fill_char);
  end;
end;
var height:longint;
begin
  read(height);
  triangle_space_3(height,'*','$');
end.
