



'''simple docstring'''






import itertools




def        snake_case_   (	lowerCAmelCase_						)->						Dict:





       '''simple docstring'''


       return (
           int("""""".join(combination[0:2]						)						) * int("""""".join(combination[2:5]						)						)
           == int("""""".join(combination[5:9]						)						)
       ) or (
           int("""""".join(combination[0]						)						) * int("""""".join(combination[1:5]						)						)
           == int("""""".join(combination[5:9]						)						)
       )




def        snake_case_   (	)->						str:





       '''simple docstring'''


       return sum(
           {
               int("""""".join(pandigital[5:9]						)						)
               for pandigital in itertools.permutations("""123456789"""						)
               if is_combination_valid(lowerCAmelCase_						)
           }						)


if __name__ == "__main__":
   print(solution())








'''simple docstring'''






class 	_lowerCAmelCase     :






		'''simple docstring'''
		def __init__(						self							:       int      ,		UpperCamelCase_							:       int		)      ->			None:







									'''simple docstring'''





									_lowercase							:		Optional[Any]				=   data
									_lowercase							:		int
									_lowercase							:		Node





def 				_SCREAMING_SNAKE_CASE(					snake_case_    :     Node  )		->None:






							'''simple docstring'''
							_lowercase							:		str				=   0
							_lowercase							:		List[Any]				=   x





def 				_SCREAMING_SNAKE_CASE(					snake_case_    :     Node ,       snake_case_    :     Node  )		->None:






							'''simple docstring'''
							_lowercase			, _lowercase							:		Union[str, Any]				=   find_set(snake_case_  ), find_set(snake_case_  )
							if x == y:
														return

							elif x.rank > y.rank:
														_lowercase							:		Optional[Any]				=   x
							else:
														_lowercase							:		Optional[int]				=   y
														if x.rank == y.rank:
																					y.rank += 1





def 				_SCREAMING_SNAKE_CASE(					snake_case_    :     Node  )		->Node:






							'''simple docstring'''
							if x != x.parent:
														_lowercase							:		str				=   find_set(x.parent  )
							return x.parent





def 				_SCREAMING_SNAKE_CASE(					snake_case_    :     Node  )		->set:






							'''simple docstring'''
							_lowercase							:		str				=   ({0, 1, 2}, {3, 4, 5})
							for s in sets:
														if node.data in s:
																					return s
							_lowercase							:		Optional[Any]				=   F"{node.data} is not in {sets}"
							raise ValueError(snake_case_  )





def 				_SCREAMING_SNAKE_CASE(					)		->None:






							'''simple docstring'''
							_lowercase							:		Any				=   [Node(snake_case_  ) for i in range(6  )]
							for v in vertex:
														make_set(snake_case_  )

							union_set(vertex[0] ,       vertex[1]  )
							union_set(vertex[1] ,       vertex[2]  )
							union_set(vertex[3] ,       vertex[4]  )
							union_set(vertex[3] ,       vertex[5]  )

							for nodea in vertex:
														for nodea in vertex:
																					if find_python_set(snake_case_  ).isdisjoint(find_python_set(snake_case_  )  ):
																												assert find_set(snake_case_  ) != find_set(snake_case_  )
																					else:
																												assert find_set(snake_case_  ) == find_set(snake_case_  )


if __name__ == "__main__":
						test_disjoint_set()



