        // Find the longest word on the input.
        // Input is terminated by the word: "END", which is not
        // counted.
class LongestWord {
    public static void main(String[] args){
        SimpleInput keyboard = new SimpleInput();
        String longestWord = "";
        int longestLength = 0;
        final String terminatingWord = "END";

        // Read the first word.
        String word = keyboard.nextWord();
        while(!word.equals(terminatingWord)){
            final int nextLength = word.length();
            if(nextLength > longestLength){
                longestWord = word;
                longestLength = nextLength;
            }
            word = keyboard.nextWord();
        }

        if(longestLength > 0){
            System.out.println("The longest word was: "+longestWord);
        }
    }
}
