





'''simple docstring'''






class 					UpperCAmelCase	:




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




      def 							lowercase__       (     self     :					Dict     ,     __snake_case     :					int     ,     __snake_case     :					int    )							-> bool:
            _lowerCAmelCase					=				self.get_parent(__snake_case    )
            _lowerCAmelCase					=				self.get_parent(__snake_case    )

            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     ,     __snake_case    )
            return True




      def 							lowercase__       (     self     :					int     ,     __snake_case     :					int    )							-> 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__ (						lowerCAmelCase    ):





      """simple docstring"""


      if divisor % 5 == 0 or divisor % 2 == 0:
            return 0
      _lowerCAmelCase					=				1
      _lowerCAmelCase					=				1
      while repunit:
            _lowerCAmelCase					=				(10 * repunit + 1) % divisor
            repunit_index += 1
      return repunit_index
def   UpperCamelCase__ (						lowerCAmelCase = 1_00_00_00    ):





      """simple docstring"""


      _lowerCAmelCase					=				limit - 1
      if divisor % 2 == 0:
            divisor += 1
      while least_divisible_repunit(lowerCAmelCase    ) <= limit:
            divisor += 2
      return divisor


if __name__ == "__main__":
      print(F"""{solution() = }""")






