public static void main(String[] args) {
        WordBreakII w = new WordBreakII();
        Set<String> wordDict = new HashSet<String>();
        wordDict.add("cat");
        wordDict.add("cats");
        wordDict.add("and");
        wordDict.add("sand");
        wordDict.add("dog");
        wordDict.add("aaa");
        wordDict.add("aaaa");

        for (String s : w.wordBreak("aaaaaaa", wordDict)) {
            System.out.println(s);
        }
    }