public static <T extends DC> Set<Pair<Pair<T,PT<Integer>>,
                                   Pair<T,PT<Integer>>>> getPhiMax(Set<Set<Pair<Pair<T,PT<Integer>>,Pair<T,PT<Integer>>>>> allPhis)
  { if(allPhis!=null)
    { Set<Pair<Pair<T,PT<Integer>>,Pair<T,PT<Integer>>>> phiMax=allPhis.getFst();
      Similarity simMax=getPhiSim(allPhis.getFst());
      for(Set<Set<Pair<Pair<T,PT<Integer>>,Pair<T,PT<Integer>>>>> p=allPhis;p!=null;p=p.getNext())
      { Similarity sim=getPhiSim(p.getFst()); 
        if(sim.greater(simMax))//here if sim=simMax the result will not be replaced
        { simMax=sim;
          phiMax=p.getFst();
        } 
        else
        { continue;
        }
      }
      if(phiMax!=null)
      {return phiMax;}
      else
      { throw new RuntimeException("Silly codes: allSets: "+allPhis+"\n simMax: "+simMax+"\n phiMax: "+phiMax);
      } 
    }
    else
    { throw new RuntimeException("One-to-one mappings between two sets "+allPhis+" is null?");
    }
  }