{"trustable":false,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003e\r\n\tMost crossword puzzle fans are used to \u003cem\u003eanagrams\u003c/em\u003e--groups of words with the same letters in different orders--for example OPTS, SPOT, STOP, POTS and POST. Some words however do not have this attribute, no matter how you rearrange their letters, you cannot form another word. Such words are called \u003cem\u003e\u003cspan data-scayt_word\u003d\"ananagrams\" data-scaytid\u003d\"1\"\u003eananagrams\u003c/span\u003e\u003c/em\u003e, an example is QUIZ.\u003c/p\u003e\r\n\u003cp\u003e\r\n\tObviously such definitions depend on the domain within which we are working; you might think that \u003cspan data-scayt_word\u003d\"ATHENE\" data-scaytid\u003d\"4\"\u003eATHENE\u003c/span\u003e is an \u003cspan data-scayt_word\u003d\"ananagram\" data-scaytid\u003d\"5\"\u003eananagram\u003c/span\u003e, whereas any chemist would quickly produce ETHANE. One possible domain would be the entire English language, but this could lead to some problems. One could restrict the domain to, say, Music, in which case SCALE becomes a \u003cem\u003erelative \u003cspan data-scayt_word\u003d\"ananagram\" data-scaytid\u003d\"6\"\u003eananagram\u003c/span\u003e\u003c/em\u003e (LACES is not in the same domain) but NOTE is not since it can produce TONE.\u003c/p\u003e\r\n\u003cp\u003e\r\n\tWrite a program that will read in the dictionary of a restricted domain and determine the relative \u003cspan data-scayt_word\u003d\"ananagrams\" data-scaytid\u003d\"2\"\u003eananagrams\u003c/span\u003e. Note that single letter words are, ipso facto, relative \u003cspan data-scayt_word\u003d\"ananagrams\" data-scaytid\u003d\"3\"\u003eananagrams\u003c/span\u003e since they cannot be ``rearranged\u0026#39;\u0026#39; at all. The dictionary will contain no more than 1000 words.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003e\r\n\tInput will consist of a series of lines. No line will be more than 80 characters long, but may contain any number of words. Words consist of up to 20 upper and/or lower case letters, and will not be broken across lines. Spaces may appear freely around words, and at least one space separates multiple words on the same line. Note that words that contain the same letters but of differing case are considered to be anagrams of each other, thus\u0026nbsp;\u003cspan data-scayt_word\u003d\"tIeD\" data-scaytid\u003d\"11\" style\u003d\"background-color: rgb(255, 255, 255);\"\u003etIeD\u003c/span\u003e\u0026nbsp;and\u0026nbsp;\u003cspan data-scayt_word\u003d\"EdiT\" data-scaytid\u003d\"12\" style\u003d\"background-color: rgb(255, 255, 255);\"\u003eEdiT\u003c/span\u003e\u0026nbsp;are anagrams. The file will be terminated by a line consisting of a single\u0026nbsp;\u003ctt\u003e#\u003c/tt\u003e.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003e\r\n\tOutput will consist of a series of lines. Each line will consist of a single word that is a relative\u0026nbsp;\u003cspan data-scayt_word\u003d\"ananagram\" data-scaytid\u003d\"9\" style\u003d\"background-color: rgb(255, 255, 255);\"\u003eananagram\u003c/span\u003e\u0026nbsp;in the input dictionary. Words must be output in lexicographic (case-sensitive) order. There will always be at least one relative\u0026nbsp;\u003cspan data-scayt_word\u003d\"ananagram\" data-scaytid\u003d\"10\" style\u003d\"background-color: rgb(255, 255, 255);\"\u003eananagram\u003c/span\u003e.\u003c/p\u003e"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre\u003e\r\nladder came tape soon leader acme RIDE lone \u003cspan data-scayt_word\u003d\"Dreis\" data-scaytid\u003d\"15\"\u003eDreis\u003c/span\u003e peat\r\n \u003cspan data-scayt_word\u003d\"ScAlE\" data-scaytid\u003d\"16\"\u003eScAlE\u003c/span\u003e orb eye Rides dealer \u003cspan data-scayt_word\u003d\"NotE\" data-scaytid\u003d\"17\"\u003eNotE\u003c/span\u003e derail \u003cspan data-scayt_word\u003d\"LaCeS\" data-scaytid\u003d\"18\"\u003eLaCeS\u003c/span\u003e \u003cspan data-scayt_word\u003d\"drIed\" data-scaytid\u003d\"19\"\u003edrIed\u003c/span\u003e\r\nnoel dire Disk mace Rob dries\r\n#\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre\u003e\r\nDisk\r\n\u003cspan data-scayt_word\u003d\"NotE\" data-scaytid\u003d\"20\"\u003eNotE\u003c/span\u003e\r\nderail\r\n\u003cspan data-scayt_word\u003d\"drIed\" data-scaytid\u003d\"21\"\u003edrIed\u003c/span\u003e\r\neye\r\nladder\r\nsoon\u003c/pre\u003e"}}]}