anchor.diff:      function ForwardFF(): Boolean;
     public
       //D_INIT_FLOOD, D_FF_INIT_ARR, D_FF_INIT_FLOOD: TKMWordArray;
  -    BestDefLines: TKMDefenceLines;
  -    FirstLine: Word;
   
       constructor Create(aSorted: Boolean = False); reintroduce;
       destructor Destroy(); override;
   
  +    property FirstLine: Word read fFirstLine;
  +    property BestDefLines: TKMDefenceLines read fBestDefLines;
  +
       function FindDefenceLines(aOwner: TKMHandIndex; var aDefLines: TKMDefenceLines): Boolean;
       function FindDefensivePolygons(aOwner: TKMHandIndex; var aBaseCnt: Word; var aDefPosArr: TKMDefencePosArr; aMinDefeces: Boolean = True): Boolean;
  -
  +    function FindTeamDefences(var aOwners: TKMHndIdxArray; var aDefPosReq: TKMWordArray; var aTeamDefPos: TKMTeamDefPos): Boolean;
       //procedure DEBUG();
     end;
   
  
positive.code:     Nodes: array[0..1] of Word;
    end;
    TKMDefenceLines = record
      Count: Word;
      Lines: array of TKMDefenceLine;
    end;
  
    // Defence position for army defence
    TKMDefencePosition = record
      Polygon, Weight: Word;
      DirPoint: TKMPointDir;
    end;
    TKMDefencePosArr = array of TKMDefencePosition;
  
    TForwardFF = class;
    TBackwardFF = class;
  
negative.code:   end;
  
    // Execute FF
    SetLength(fDefPosArr, aBaseCnt);
    Cnt := 0;
    ScannedCnt := 0;
    NextLine := fQueueCnt;
    ActLineIdx := 0;
    while RemoveFromQueue(Idx) AND (Cnt < aBaseCnt) do
    begin
      Inc(ScannedCnt);
      if (ScannedCnt > NextLine) then
      begin
        Inc(NextLine, fQueueCnt);
        Inc(ActLineIdx);
      end;
      // Add only defence points with specicific distance
      Check := True;
      for I := 0 to Cnt - 1 do
        if (KMDistanceSqr(fQueueArray[Idx].DistPoint, fDefPosArr[I].DirPoint.Loc) < SQR_MIN_DEF_POINT_DISTANCE) then
        begin
          Check := False;
          break;
        end;
      if Check then
      begin
        with fDefPosArr[Cnt] do
        begin
          Line := ActLineIdx;
          Polygon := Idx;
          Direction := KMGetDirection( fQueueArray[Idx].DistPoint, fDefInfo[Idx].PointInDir );
          DirPoint := KMPointDir( fQueueArray[Idx].DistPoint, Direction );
          Weight := Max( 0, (High(Word) shr 1) // Init value
                             + (fDefInfo[Idx].Influence shl 1) // Increase weight of owner's city
                             - (ActLineIdx * 100) // Penalize back lines
                             - fDefInfo[Idx].AllyInfluence // Penalize allied influence
                             + fDefInfo[Idx].EnemyInfluence // Add more soldiers closer to enemy influence
                       );
  