public void SCC() {
        boolean[] visited = new boolean[graph.length];
        int[] labels = new int[graph.length];

        topologicalSeq();
        while (!TS.empty()) {
            int curId = TS.pop();
            Node curNode = graph[curId];

            if (!visited[curId])
                dfs(curNode, visited, labels);

            count++;
        }

        // statistics
        HashMap<Integer, Integer> statistics = new HashMap<Integer, Integer>();
        for (int value : labels) {
            if (!statistics.containsKey(value))
                statistics.put(value, 0);

            int temp = statistics.get(value);
            statistics.put(value, temp + 1);
        }


        ArrayList<Integer> values = new ArrayList<Integer>();
        for (Integer m : statistics.keySet())
            values.add(statistics.get(m));

        Integer[] vArr = values.toArray(new Integer[values.size()]);
        Arrays.sort(vArr);

        for(int i = 0; i < 10; i ++)
            System.out.println(i+": "+vArr[vArr.length - 1 - i]);

    }