import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.Arrays; import java.util.Iterator; import java.util.LinkedHashSet; public class Main { static class WORD implements Comparable { String word; int length; public WORD(String word, int length){ this.word=word; this.length=length; } public int compareTo(WORD w){ if(this.length>w.length) return 1; else if(this.length==..