Almost an Anagram

No attempts yetTime limit2sMemory limit256 MB

Problem

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.

  • One word is shorter than the other by exactly one letter, and deleting one letter from the longer word leaves the same letters as the shorter word, in any order.
  • The two words have the same length, and their letter multisets differ in exactly one letter. The pair aaa and aab is such a case.

You are given two words. Decide whether they are identical, anagrams, almost anagrams, or nothing like each other.

Input

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.

Output

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.

  • If the two words are exactly the same, print A is identical to B.
  • If the two words have the same letters, print A is an anagram of B.
  • If the two words are almost anagrams, print A is almost an anagram of B.
  • Otherwise, print A is nothing like B.

Write the words given in the input in place of A and B.