class WordCount {
    public static void main(String[] args) {

        String s = "hello world hello";

        String[] words = s.split(" ");

        for (String w : words) {
            System.out.println(w);
        }
    }
}