





"""simple docstring"""
class       _SCREAMING_SNAKE_CASE:




       def __init__(		self	,SCREAMING_SNAKE_CASE__							)    ->   None:





             """simple docstring"""






             __SCREAMING_SNAKE_CASE     :Tuple	       =						data
             __SCREAMING_SNAKE_CASE     :int
             __SCREAMING_SNAKE_CASE     :Node




def   __lowerCamelCase     (							a_  :	Node							)    ->   None:
      __SCREAMING_SNAKE_CASE     :Optional[int]	       =						0
      __SCREAMING_SNAKE_CASE     :List[str]	       =						x



def   __lowerCamelCase     (							a_  :	Node				,     a_  :	Node							)    ->   None:
      __SCREAMING_SNAKE_CASE       ,__SCREAMING_SNAKE_CASE     :Dict	       =						find_set(a_							), find_set(a_							)
      if x == y:
            return

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



def   __lowerCamelCase     (							a_  :	Node							)    ->   Node:
      if x != x.parent:
            __SCREAMING_SNAKE_CASE     :Optional[Any]	       =						find_set(x.parent							)
      return x.parent



def   __lowerCamelCase     (							a_  :	Node							)    ->   set:
      __SCREAMING_SNAKE_CASE     :Optional[Any]	       =						({0, 1, 2}, {3, 4, 5})
      for s in sets:
            if node.data in s:
                  return s
      __SCREAMING_SNAKE_CASE     :List[str]	       =						f'''{node.data} is not in {sets}'''
      raise ValueError(a_							)



def   __lowerCamelCase     (							)    ->   None:
      __SCREAMING_SNAKE_CASE     :List[str]	       =						[Node(a_							) for i in range(6							)]
      for v in vertex:
            make_set(a_							)

      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(a_							).isdisjoint(find_python_set(a_							)							):
                        assert find_set(a_							) != find_set(a_							)
                  else:
                        assert find_set(a_							) == find_set(a_							)


if __name__ == "__main__":
  test_disjoint_set()






"""simple docstring"""
def   __lowerCamelCase     (							a_  :	int = 10**6							)    ->   int:

      if n <= 0:
            raise ValueError('''Please enter an integer greater than 0'''							)

      __SCREAMING_SNAKE_CASE     :Tuple	       =						list(range(n + 1							)							)
      for number in range(2				,     n + 1							):
            if phi[number] == number:
                  phi[number] -= 1
                  for multiple in range(number * 2				,     n + 1				,     a_							):
                        __SCREAMING_SNAKE_CASE     :List[Any]	       =						(phi[multiple] // number) * (number - 1)

      __SCREAMING_SNAKE_CASE     :Optional[Any]	       =						1
      for number in range(1				,     n + 1							):
            if (answer / phi[answer]) < (number / phi[number]):
                  __SCREAMING_SNAKE_CASE     :str	       =						number

      return answer


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