program typing2;
uses
   crt;
type
   arra=array[1..100]of char;
var
   ch:arra;
   i,k,j:integer;
   ch1:char;
label
   10;
begin
   clrscr;
   k:=0;
   randomize;
   for i:=1 to 100 do
      begin
         j:=random(75);
         case j of
             1:ch[i]:='a';
             2:ch[i]:='s';
             3:ch[i]:='d';
             4:ch[i]:='f';
             5:ch[i]:='g';
             6:ch[i]:='h';
             7:ch[i]:='j';
             8:ch[i]:='k';
             9:ch[i]:='l';
             10:ch[i]:='p';
             11:ch[i]:='o';
             12:ch[i]:='i';
             13:ch[i]:='u';
             14:ch[i]:='y';
             15:ch[i]:='t';
             16:ch[i]:='r';
             17:ch[i]:='e';
             18:ch[i]:='w';
             19:ch[i]:='q';
             20:ch[i]:='z';
             21:ch[i]:='x';
             22:ch[i]:='c';
             23:ch[i]:='v';
             24:ch[i]:='b';
             25:ch[i]:='n';
             26:ch[i]:='m';
             28:ch[i]:='A';
             29:ch[i]:='S';
             30:ch[i]:='D';
             31:ch[i]:='F';
             32:ch[i]:='G';
             33:ch[i]:='H';
             34:ch[i]:='J';
             35:ch[i]:='K';
             36:ch[i]:='L';
             37:ch[i]:='M';
             38:ch[i]:='N';
             39:ch[i]:='B';
             40:ch[i]:='V';
             41:ch[i]:='C';
             42:ch[i]:='X';
             43:ch[i]:='Z';
             44:ch[i]:='Q';
             45:ch[i]:='W';
             46:ch[i]:='E';
             47:ch[i]:='R';
             48:ch[i]:='T';
             49:ch[i]:='Y';
             50:ch[i]:='U';
             51:ch[i]:='I';
             52:ch[i]:='O';
             53:ch[i]:='P';
             54:ch[i]:='1';
             55:ch[i]:='2';
             56:ch[i]:='3';
             57:ch[i]:='4';
             58:ch[i]:='5';
             59:ch[i]:='6';
             60:ch[i]:='7';
             61:ch[i]:='8';
             62:ch[i]:='9';
             63:ch[i]:='0';
             else ch[i]:=' ';
         end;
      end;
   for i:=1 to 100 do
      write(ch[i]);
   gotoxy(1,1);
   for i:=1 to 100 do
      begin
         10:ch1:=readkey;
         if ch1=#13 then
           halt;
         if ch1=ch[i] then
           begin
              if k=0 then
                begin
                   textcolor(lightgreen);
                   write(ch1);
                   textcolor(lightgray);
                end
              else
                  begin
                     k:=0;
                     textcolor(lightred);
                     write(ch1);
                     textcolor(lightgray);
                  end;
           end
         else
             begin
                inc(k);
                goto 10;
             end;
      end;
   readln;
end.