program xxx;
uses dos;

var
  f: file;
  d: searchrec;
  t: string;

  i   : integer;
  j   : integer;
  x   : integer;
  c   : integer;


begin

  j := 1;

  findfirst('*.PCX',anyfile,d);
  while doserror=0 do
    begin

      t := copy(d.name,3,4);

      while t[1]='0' do
        delete(t,1,1);

      val(t,x,c);

      if (x=1) or (x mod 2<>0) then
        begin
          str(j,t);

          while length(t) < 4 do
            t := '0'+t;

          t := t +'.PCX';
          assign(f,d.name);
          rename(f,t);

          j := j + 1;

        end;

      findnext(d);

    end;

end.
