Program txt2ANSI;
Var
  ControlCh:Char;
  BlackCh,RedCh,GreenCh,YellowCh,BlueCh,MagentaCh,CyanCh,WhiteCh:Char;
  ConfigFile, InputFile, TextFile:Text;
  C1 : Char;
  Light : char;


Procedure SetDefault;
 Begin
  ControlCh := '&';
  BlackCh   := 'z';
  RedCh     := 'r';
  GreenCh   := 'g';
  YellowCh  := 'y';
  BlueCh    := 'b';
  MagentaCh := 'm';
  CyanCh    := 'c';
  WhiteCh   := 'w';
 End;

Procedure OpenFile;
Begin
 Assign(InputFile, ParamStr(1));
 Reset(InputFile);
End;

Procedure OutPut;
 Begin
  While not EOF(InputFile) do
   begin
     Read(InputFile,C1);
      If (C1 = ControlCh) and (not EOF(InputFile)) then
        begin
         Read(InputFile, C1);
         Light := '0';
         If Ord(C1) in [66..90] then begin Light := '1'; Inc(C1,32);end;
         If C1 = ControlCh then Write (ControlCh) else
         If C1 = BlackCh   then Write (#27,'[',Light,';30m') else
         If C1 = RedCh     then Write (#27,'[',Light,';31m') else
         If C1 = GreenCh   then Write (#27,'[',Light,';32m') else
         If C1 = YellowCh  then Write (#27,'[',Light,';33m') else
         If C1 = BlueCh    then Write (#27,'[',Light,';34m') else
         If C1 = MagentaCh then Write (#27,'[',Light,';35m') else
         If C1 = CyanCh    then Write (#27,'[',Light,';36m') else
         If C1 = WhiteCh   then Write (#27,'[',Light,';37m') else
                                Write (#27,'[0m');
        end
      else Write(C1);
   end;
   Close(InputFile);
 End;

Begin
SetDefault;
OpenFile;
OutPut;
End.