{$apptype console}
{$o-,q+,r+}
uses sysutils;

var cdeg:integer;


function myrandom (x:integer):integer;
var i:integer;
begin
  for i:=1 to cdeg do x:=random (x)+1;
  Result:=x;
end;

var c:array [1..64] of integer;
    e, p, ent:extended;
    i, j, tmp, sym, sum:integer;
    s:string;

begin
  readln (s); tmp:=pos ('.', s);
  if tmp>0 then assert (length (s)-tmp<=2);
  for i:=1 to length (s) do assert (s[i] in ['0'..'9', '.']);
  val (s, e, tmp); assert (tmp=0);
  assert ((e>=0) and (e<=6));
  assert (seekeof);
  cdeg:=1;
  repeat
    ent:=0; sum:=0; sym:=0;
    repeat
      inc (sym); c[sym]:=myrandom (1000-sum); inc (sum, c[sym]);
    until (sum=1000) or (sym=64);
    for i:=1 to sym do begin
      p:=c[i]/sum; ent:=ent-p*ln (p)/ln (2);
    end;
    if ent<e then inc (cdeg) else dec (cdeg);
  until abs (ent-e)<0.0045;
  for i:=1 to sym do
    for j:=1 to c[i] do
      case i of
        1..26:write (chr (i+64));
        27..52:write (chr (i+70));
        53..62:write (chr (i-5));
        63:write (' ');
        64:write ('.');
      end;
  writeln;
end.
