// Path: src/main/java/io/aif/language/word/IWord.java
// public interface IWord {
// 
//   public String getRootToken();
// 
//   public Set<String> getAllTokens();
// 
//   public Long getCount();
// 
//   public int getTokenCount(String token);
// 
//   public static interface IWordPlaceholder {
// 
//     public IWord getWord();
// 
//     public String getToken();
// 
//   }
// 
// }


import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.OptionalInt;
import java.util.Set;
import java.util.stream.Collectors;
import io.aif.graph.DFS;
import io.aif.graph.simple.ISimpleGraph;
import io.aif.language.word.IWord;
package io.aif.language.fact;



class FactQuery implements IFactQuery {

  private final ISimpleGraph<IFact> graph;
  private final Set<IFact> facts;
  private final DFS<IFact> traverser;

  public FactQuery(final ISimpleGraph<IFact> g) {
    this.graph = g;
    facts = graph.getVertices();
    traverser = new DFS<>(graph);
  }

// Path: src/main/java/io/aif/language/word/IWord.java
// public interface IWord {
// 
//   public String getRootToken();
// 
//   public Set<String> getAllTokens();
// 
//   public Long getCount();
// 
//   public int getTokenCount(String token);
// 
//   public static interface IWordPlaceholder {
// 
//     public IWord getWord();
// 
//     public String getToken();
// 
//   }
// 
// }


// Path: src/main/java/io/aif/language/fact/FactQuery.java
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.OptionalInt;
import java.util.Set;
import java.util.stream.Collectors;
import io.aif.graph.DFS;
import io.aif.graph.simple.ISimpleGraph;
import io.aif.language.word.IWord;

package io.aif.language.fact;



class FactQuery implements IFactQuery {

  private final ISimpleGraph<IFact> graph;
  private final Set<IFact> facts;
  private final DFS<IFact> traverser;

  public FactQuery(final ISimpleGraph<IFact> g) {
    this.graph = g;
    facts = graph.getVertices();
    traverser = new DFS<>(graph);
  }

  public List<List<IFact>> findPath(final IWord properNoun1,