

from __future__ import annotations

from typing import Generic, TypeVar

snake_case_        =			TypeVar('''T''')


class 				SCREAMING_SNAKE_CASE__ (Generic[T]					):





    def __init__(				self						,       a):
         lowercase__   :       int				=	data
         lowercase__   :       List[Any]				=	self
         lowercase__   :       Optional[Any]				=	0



class 				SCREAMING_SNAKE_CASE__ (Generic[T]					):





    def __init__(				self):
         # map from node name to the node object
         lowercase__   :       dict[T, DisjointSetTreeNode[T]]				=	{}





    def 				snake_case_    (				self						,       a):
         # create a new set with x as its member
         lowercase__   :       Optional[int]				=	DisjointSetTreeNode(a)





    def 				snake_case_    (				self						,       a):
         # find the set x belongs to (with path-compression)
         lowercase__   :       Optional[Any]				=	self.map[data]
         if elem_ref != elem_ref.parent:
              lowercase__   :       int				=	self.find_set(elem_ref.parent.data)
         return elem_ref.parent





    def 				snake_case_    (				self						,       a						,       a):
         # helper function for union operation
         if nodea.rank > nodea.rank:
              lowercase__   :       List[Any]				=	nodea
         else:
              lowercase__   :       Tuple				=	nodea
              if nodea.rank == nodea.rank:
                   nodea.rank += 1





    def 				snake_case_    (				self						,       a						,       a):
         # merge 2 disjoint sets
         self.link(self.find_set(a)						,       self.find_set(a))



class 				SCREAMING_SNAKE_CASE__ (Generic[T]					):





    def __init__(				self):
         # connections: map from the node to the neighbouring nodes (with weights)
         lowercase__   :       dict[T, dict[T, int]]				=	{}





    def 				snake_case_    (				self						,       a):
         # add a node ONLY if its not present in the graph
         if node not in self.connections:
              lowercase__   :       List[str]				=	{}





    def 				snake_case_    (				self						,       a						,       a						,       a):
         # add an edge with the given weight
         self.add_node(a)
         self.add_node(a)
         lowercase__   :       Optional[Any]				=	weight
         lowercase__   :       List[str]				=	weight





    def 				snake_case_    (				self):
         lowercase__   :       Union[str, Any]				=	[]
         lowercase__   :       Dict				=	set()
         for start in self.connections:
              for end in self.connections[start]:
                   if (start, end) not in seen:
                        seen.add((end, start))
                        edges.append((start, end, self.connections[start][end]))
         edges.sort(key=lambda a: x[2])

         # creating the disjoint set
         lowercase__   :       str				=	DisjointSetTree[T]()
         for node in self.connections:
              disjoint_set.make_set(a)

         # MST generation
         lowercase__   :       List[str]				=	0
         lowercase__   :       Tuple				=	0
         lowercase__   :       List[Any]				=	GraphUndirectedWeighted[T]()
         while num_edges < len(self.connections) - 1:
              lowercase__				,			lowercase__				,			lowercase__   :       Optional[int]				=	edges[index]
              index += 1
              lowercase__   :       List[str]				=	disjoint_set.find_set(a)
              lowercase__   :       Tuple				=	disjoint_set.find_set(a)
              if parent_u != parent_v:
                   num_edges += 1
                   graph.add_edge(a						,       a						,       a)
                   disjoint_set.union(a						,       a)
         return graph




def      snake_case__      (   SCREAMING_SNAKE_CASE_		:   int      ):



     '''simple docstring'''





     return 1 if digit in (0, 1) else (digit * factorial(digit - 1      ))

def      snake_case__      (   SCREAMING_SNAKE_CASE_		:   int      ):



     '''simple docstring'''





     lowercase__   :       List[str]				=	0
     lowercase__   :       Optional[int]				=	number
     while duplicate > 0:
          lowercase__				,			lowercase__   :       Tuple				=	divmod(SCREAMING_SNAKE_CASE_     ,					10      )
          fact_sum += factorial(SCREAMING_SNAKE_CASE_      )
     return fact_sum == number


if __name__ == "__main__":
       print('''Program to check whether a number is a Krisnamurthy Number or not.''')
       snake_case_        =			int(input('''Enter number: ''').strip())
       print(
           F'''{number} is {'' if krishnamurthy(number) else 'not '}a Krishnamurthy Number.'''
       )

