An anagram is a word formed by rearranging all the letters of another word. Rearranging the letters of rasp gives spar.
Two words are almost anagrams if one of the following holds.
You are given two words. Decide whether they are identical, anagrams, almost anagrams, or nothing like each other.
The input is a single line. It contains two words separated by a single space.
Both words consist of lowercase English letters only, and each word is between 1 and 1000 letters long.
Print one line.
First decide which word goes first. If the lengths differ, the shorter word goes first. If the lengths are equal, the lexicographically smaller word goes first. Call that word A and the other word B.
Check the conditions below in order and print only the first sentence that applies.
A is identical to B.A is an anagram of B.A is almost an anagram of B.A is nothing like B.Write the words given in the input in place of A and B.