uses graph,crt;
var a,b,c:integer;
begin
initgraph (a,b,'system');
setcolor (15);
setrgbpalette (1,21,21,63);
for a:=0 to 479 do begin
    b:=round((639/479)*a);
    c:=round((360/479)*a)+90;
    if (a<150) or (a>288) then putpixel (150-(a div 3),a,1) else putpixel (150-(a div 3),a,14);
    if (a<150) or (a>288) then putpixel (50+(a div 3),a,1) else putpixel (50+(a div 3),a,14);
    if (a<208) or (a>288) then putpixel (484,a,1) else putpixel (484,a,14);
    if (a<180) or (a>288) then putpixel (544,a,1) else putpixel (544,a,14);
    if (a<150) or (a>288) then putpixel (170,a,1) else putpixel (170,a,14);
    if (a<150) or (a>289) then putpixel (200,a,1) else putpixel (200,a,14);
    if (a<150) or (a>288) or ((a>170) and (a<190)) then putpixel (300,a,1) else putpixel (300,a,14);

    if (a>240) and (a<>479) then begin
       setcolor (14);
       ellipse (200,218-34,c-1,c+1,70,35);
       end else begin
           setcolor (1);
           ellipse (200,218-34,c-1,c+1,70,35);
           end;
    if (a>240) and (a<>479) then begin
       setcolor (14);
       ellipse (200,218+71-34,c-1,c+1,70,35);
       end else begin
           setcolor (1);
           ellipse (200,218+71-34,c-1,c+1,70,35);
           end;
    if (a<58) or (a>92) then begin
       putpixel (b,220,1);
       putpixel (b+1,220,1);
       end else begin
           putpixel (b,220,14);
           putpixel (b+1,220,14);
           end;
    if (a>240) and (a<469) then begin
       setcolor (1);
       ellipse (360,207,c-1,c+1,35,27);
       end else begin
           setcolor (14);
           ellipse (360,207,c-1,c+1,35,27);
           end;
    if (a>120){and (a<>479)}then begin
       setcolor (14);
       ellipse (360,207+54,c-1,c+1,35,27);
       end else begin
           setcolor (1);
           ellipse (360,207+54,c-1,c+1,35,27);
           end;
    setcolor (14);
    ellipse (440,221+27,c-1,c+1,30,40);
    if (a<363) or (a>393) then begin
       putpixel (b,208,1);
       putpixel (b+1,208,1);
       end else begin
           putpixel (b,208,14);
           putpixel (b+1,208,14);
           end;
    if (a<363) or (a>385) then begin
       putpixel (b,240,1);
       putpixel (b+1,240,1);
       end else begin
           putpixel (b,240,14);
           putpixel (b+1,240,14);
           end;
    if (a<266) or (a>442) then begin
       putpixel (b,180,1);
       putpixel (b+1,180,1);
       end else begin
           putpixel (b,180,14);
           putpixel (b+1,180,14);
           end;
    delay (1);
    end;
ellipse (200,218-34,270,90,70,35);
ellipse (200,218+71-34,270,90,70,35);
line (300,189,300,288);
ellipse (360,207,90,270,35,27);
ellipse (440,221+27,0,360,30,40);
line (484,209,484,287);
line (544,181,544,287);
{   if (a<208) or (a>288) then putpixel (484,a,9) else putpixel (484,a,14);
    if (a<180) or (a>288) then putpixel (544,a,9) else putpixel (544,a,14);}

for a:=0 to 639 do begin
    for b:=0 to 479 do if getpixel (a,b)=14 then begin
        putpixel (a-1,b,14);
        putpixel (a-2,b,14);
        putpixel (a-3,b,14);
        putpixel (a-4,b,14);
        putpixel (a-5,b,14);
        putpixel (a-6,b+1,14-8);
        putpixel (a-7,b+1,14-8);
        end;
    end;
delay (1000);
{for a:=0 to 240 do begin
    for b:=0 to 639 do if getpixel (b,a)=9 then putpixel (b,a,0);
    for b:=0 to 639 do if getpixel (b,479-a)=9 then putpixel (b,479-a,0);
    end;}
for a:=63 downto 0 do setrgbpalette (1,a div 3,a div 3,a);
while keypressed do readkey;
repeat
a:=a+1;
write ('');
write ('');
until (a=32000) or (keypressed);

end.