'''simple docstring'''

class 				_lowercase	:
      '''simple docstring'''


      def __init__(				self					,lowerCamelCase_							)			->			None:



         '''simple docstring'''



         UpperCAmelCase__							:				List[Any]   				=  set_counts
         UpperCAmelCase__							:				List[str]   				=  max(lowerCamelCase_							)
         UpperCAmelCase__							:				int   				=  len(lowerCamelCase_							)
         UpperCAmelCase__							:				int   				=  [1] * num_sets
         UpperCAmelCase__							:				Dict   				=  list(range(lowerCamelCase_							)							)




      def 		lowerCAmelCase__					(				self					,lowerCamelCase_					,lowerCamelCase_							)			->			bool:



         '''simple docstring'''



         UpperCAmelCase__							:				Union[str, Any]   				=  self.get_parent(lowerCamelCase_							)
         UpperCAmelCase__							:				Optional[int]   				=  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]
            UpperCAmelCase__							:				Tuple   				=  0
            UpperCAmelCase__							:				Union[str, Any]   				=  dst_parent
            if self.ranks[dst_parent] == self.ranks[src_parent]:
               self.ranks[dst_parent] += 1
            UpperCAmelCase__							:				Union[str, Any]   				=  self.set_counts[dst_parent]
         else:
            self.set_counts[src_parent] += self.set_counts[dst_parent]
            UpperCAmelCase__							:				Optional[int]   				=  0
            UpperCAmelCase__							:				Optional[Any]   				=  src_parent
            UpperCAmelCase__							:				Any   				=  self.set_counts[src_parent]

         UpperCAmelCase__							:				Optional[Any]   				=  max(self.max_set					,lowerCamelCase_							)
         return True




      def 		lowerCAmelCase__					(				self					,lowerCamelCase_							)			->			int:



         '''simple docstring'''



         if self.parents[disj_set] == disj_set:
            return disj_set
         UpperCAmelCase__							:				Optional[int]   				=  self.get_parent(self.parents[disj_set]							)
         return self.parents[disj_set]





'''simple docstring'''

import re







def __UpperCamelCase(   _A					:				str    ):
   '''simple docstring'''

   if len(re.findall('''[ATCG]'''  ,			_A    )    ) != len(_A    ):
      raise ValueError('''Invalid Strand'''    )

   return dna.translate(dna.maketrans('''ATCG'''  ,			'''TAGC'''    )    )


if __name__ == "__main__":
  import doctest

  doctest.testmod()




