program xxx;
uses dos;

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

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

  z : text;

begin

  j := 1;

  assign(z,'X.DAT');
  reset(z);
  while not eof(z) do
    begin

      readln(z,d);

      t := copy(d,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);
          rename(f,t);

          j := j + 1;

        end;

    end;

end.
