시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 256 MB137343333.000%

문제

Andy loves anagrams. For the uninitiated, an anagram is a word formed by rearranging the letters of another word, for example rasp can be rearranged to form spar. Andy is interested to know if two words are almost anagrams. A word is almost an anagram of another word if:

  • one word is shorter than the other by one letter but otherwise contains the same letters in any order; or
  • the two words are the same length and their character multisets differ by one character only e.g. “aaa” and “aab”

Your job is to help Andy to determine if two words are identical, anagrams, almost anagrams or nothing like each other.

입력

The input contains a single test case.

The input will be a single line of text containing a pair of words separated by a single space. The words will be in lower case and will contain alphabetic characters only. Words will contain between 1 and 1000 letters inclusive.

출력

Your program should produce one line of output as follows:

If the words are identical, output: worda is identical to wordb
If the words are anagrams, output: worda is an anagram of wordb
If the words are almost anagrams, output: worda is almost an anagram of wordb
Otherwise, output: worda is nothing like wordb

In all cases the first word in the output sentence must be the shorter word or if the words are the same length the first word must be the lexicographically least.

예제 입력 1

rasp spar

예제 출력 1

rasp is an anagram of spar

예제 입력 2

table able

예제 출력 2

able is almost an anagram of table

예제 입력 3

sable table

예제 출력 3

sable is almost an anagram of table