


'''simple docstring'''






class 						a__							:





							'''simple docstring'''






							def __init__(						self   ,       lowerCamelCase_  )			->				None:
														lowerCAmelCase__			  =      set_counts
														lowerCAmelCase__			  =      max(lowerCamelCase_  )
														lowerCAmelCase__			  =      len(lowerCamelCase_  )
														lowerCAmelCase__			  =      [1] * num_sets
														lowerCAmelCase__			  =      list(range(lowerCamelCase_  )  )







							def     __SCREAMING_SNAKE_CASE				(						self   ,       lowerCamelCase_   ,       lowerCamelCase_  )			->				bool:
														lowerCAmelCase__			  =      self.get_parent(lowerCamelCase_  )
														lowerCAmelCase__			  =      self.get_parent(lowerCamelCase_  )

														if src_parent == dst_parent:
																					return False

														if self.ranks[dst_parent] >= self.ranks[src_parent]:
																					self.set_counts[dst_parent] += self.set_counts[src_parent]
																					lowerCAmelCase__			  =      0
																					lowerCAmelCase__			  =      dst_parent
																					if self.ranks[dst_parent] == self.ranks[src_parent]:
																												self.ranks[dst_parent] += 1
																					lowerCAmelCase__			  =      self.set_counts[dst_parent]
														else:
																					self.set_counts[src_parent] += self.set_counts[dst_parent]
																					lowerCAmelCase__			  =      0
																					lowerCAmelCase__			  =      src_parent
																					lowerCAmelCase__			  =      self.set_counts[src_parent]

														lowerCAmelCase__			  =      max(self.max_set   ,       lowerCamelCase_  )
														return True







							def     __SCREAMING_SNAKE_CASE				(						self   ,       lowerCamelCase_  )			->				int:
														if self.parents[disj_set] == disj_set:
																					return disj_set
														lowerCAmelCase__			  =      self.get_parent(self.parents[disj_set]  )
														return self.parents[disj_set]




'''simple docstring'''



def        UpperCAmelCase (    A	:					int					):
							if not isinstance(A       ,		A					):
														SCREAMING_SNAKE_CASE       :   List[str]         =      F"""Input value of [number={number}] must be an integer"""
														raise TypeError(A					)
							if number < 0:
														return False
							SCREAMING_SNAKE_CASE       :   List[str]         =      number * number
							while number > 0:
														if number % 10 != number_square % 10:
																					return False
														number //= 10
														number_square //= 10
							return True


if __name__ == "__main__":
							import doctest

							doctest.testmod()




