



from __future__ import annotations

from collections import namedtuple
from dataclasses import dataclass



@dataclass
class 			__lowerCAmelCase  :
 lowerCAmelCase__							       =	42
 lowerCAmelCase__							       =	None
 lowerCAmelCase__							       =	None



a_								=       namedtuple("""CoinsDistribResult""", """moves excess""")





def 		a__      (		_UpperCamelCase      :			TreeNode | None				):

   if root is None:
      return 0

   # Validation
   def count_nodes(_UpperCamelCase      :			TreeNode | None				) -> int:
      if node is None:
         return 0

      return count_nodes(node.left				) + count_nodes(node.right				) + 1

   def count_coins(_UpperCamelCase      :			TreeNode | None				) -> int:
      if node is None:
         return 0

      return count_coins(node.left				) + count_coins(node.right				) + node.data

   if count_nodes(_UpperCamelCase				) != count_coins(_UpperCamelCase				):
      raise ValueError('''The nodes number should be same as the number of coins'''				)

   # Main calculation
   def get_distrib(_UpperCamelCase      :			TreeNode | None				) -> CoinsDistribResult:

      if node is None:
         return CoinsDistribResult(0			,1				)

      __lowerCamelCase				,__lowerCamelCase    				=     get_distrib(node.left				)
      __lowerCamelCase				,__lowerCamelCase    				=     get_distrib(node.right				)

      __lowerCamelCase    				=     1 - left_distrib_excess
      __lowerCamelCase    				=     1 - right_distrib_excess

      __lowerCamelCase    				=     (
          left_distrib_moves
          + right_distrib_moves
          + abs(_UpperCamelCase				)
          + abs(_UpperCamelCase				)
      )
      __lowerCamelCase    				=     node.data - coins_to_left - coins_to_right

      return CoinsDistribResult(_UpperCamelCase			,_UpperCamelCase				)

   return get_distrib(_UpperCamelCase				)[0]


if __name__ == "__main__":
  import doctest

  doctest.testmod()











def 		a__      (		_UpperCamelCase      :			str				):
   if not all(x.isalpha() for x in string				):
      raise ValueError('''String must only contain alphabetic characters.'''				)

   __lowerCamelCase    				=     sorted(string.lower()				)
   return len(_UpperCamelCase				) == len(set(_UpperCamelCase				)				)


if __name__ == "__main__":
  a_								=       input("""Enter a string """).strip()

  a_								=       is_isogram(input_str)
  print(f"{input_str} is {'an' if isogram else 'not an'} isogram.")






