private ArrayList<ArrayList<String>> backtrace(String end,
                                                   HashMap<String, HashSet<String>> visited, ArrayList<String> path) {
        ArrayList<ArrayList<String>> result = new ArrayList<ArrayList<String>>();
        ArrayList<String> entry = new ArrayList<String>(path);
        entry.add(0,end);
        if(visited.get(end).size()<1){
            result.add(entry);
            return result;
        }

        for(String str : visited.get(end)){
            result.addAll(backtrace(str,visited,entry));
        }
        return result;
    }