



def       lowerCamelCase_  (    _a       :						list[int]    ):



    '''simple docstring'''




    if len(_a    ) > 1:
        UpperCAmelCase_     :       Any  		=					len(_a    ) // 2  # Finds the middle of the array
        UpperCAmelCase_     :       Tuple  		=					arr[
            :middle_length
        ]  # Creates an array of the elements in the first half.
        UpperCAmelCase_     :       int  		=					arr[
            middle_length:
        ]  # Creates an array of the elements in the second half.
        UpperCAmelCase_     :       Dict  		=					len(_a    )
        UpperCAmelCase_     :       str  		=					len(_a    )
        merge(_a    )  # Starts sorting the left.
        merge(_a    )  # Starts sorting the right
        UpperCAmelCase_     :       List[str]  		=					0  # Left Counter
        UpperCAmelCase_     :       Tuple  		=					0  # Right Counter
        UpperCAmelCase_     :       str  		=					0  # Position Counter
        while (
            left_index < left_size and right_index < right_size
        ):  # Runs until the lowers size of the left and right are sorted.
            if left_array[left_index] < right_array[right_index]:
                UpperCAmelCase_     :       Tuple  		=					left_array[left_index]
                left_index += 1
            else:
                UpperCAmelCase_     :       int  		=					right_array[right_index]
                right_index += 1
            index += 1
        while (
            left_index < left_size
        ):  # Adds the left over elements in the left half of the array
            UpperCAmelCase_     :       Union[str, Any]  		=					left_array[left_index]
            left_index += 1
            index += 1
        while (
            right_index < right_size
        ):  # Adds the left over elements in the right half of the array
            UpperCAmelCase_     :       Tuple  		=					right_array[right_index]
            right_index += 1
            index += 1
    return arr


if __name__ == "__main__":
      import doctest

      doctest.testmod()



from __future__ import annotations





def  _snake_case		(snake_case_					:     int  )							->		int | None:
  for r in range(1    ,       snake_case_  ):
    __UpperCAmelCase	:  List[str]		=     []
    for x in range(n - 1  ):
      __UpperCAmelCase	:  Union[str, Any]		=     pow(snake_case_    ,       snake_case_    ,       snake_case_  )
      if val in li:
        break
      li.append(snake_case_  )
    else:
      return r
  return None


if __name__ == "__main__":
      _SCREAMING_SNAKE_CASE							 =			int(input('''Enter a prime number q: '''))
      _SCREAMING_SNAKE_CASE							 =			find_primitive(q)
      if a is None:
            print(F'''Cannot find the primitive for the value: {a!r}''')
      else:
            _SCREAMING_SNAKE_CASE							 =			int(input('''Enter private key of A: '''))
            _SCREAMING_SNAKE_CASE							 =			pow(a, a_private, q)
            _SCREAMING_SNAKE_CASE							 =			int(input('''Enter private key of B: '''))
            _SCREAMING_SNAKE_CASE							 =			pow(a, b_private, q)

            _SCREAMING_SNAKE_CASE							 =			pow(b_public, a_private, q)
            _SCREAMING_SNAKE_CASE							 =			pow(a_public, b_private, q)

            print('''The key value generated by A is: ''', a_secret)
            print('''The key value generated by B is: ''', b_secret)





