





from __future__ import annotations







def      A__				(       SCREAMING_SNAKE_CASE__)  ->       int | None:
  for r in range(1   ,   SCREAMING_SNAKE_CASE__):
    __snake_case:		List[str]					    =		[]
    for x in range(n - 1):
      __snake_case:		Optional[int]					    =		pow(SCREAMING_SNAKE_CASE__   ,   SCREAMING_SNAKE_CASE__   ,   SCREAMING_SNAKE_CASE__)
      if val in li:
        break
      li.append(SCREAMING_SNAKE_CASE__)
    else:
      return r
  return None


if __name__ == "__main__":
      __UpperCAmelCase			:  Any										=				int(input("Enter a prime number q: "))
      __UpperCAmelCase			:  str										=				find_primitive(q)
      if a is None:
            print(f'Cannot find the primitive for the value: {a!r}')
      else:
            __UpperCAmelCase			:  str										=				int(input("Enter private key of A: "))
            __UpperCAmelCase			:  List[str]										=				pow(a, a_private, q)
            __UpperCAmelCase			:  Dict										=				int(input("Enter private key of B: "))
            __UpperCAmelCase			:  Union[str, Any]										=				pow(a, b_private, q)

            __UpperCAmelCase			:  Any										=				pow(b_public, a_private, q)
            __UpperCAmelCase			:  Any										=				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)













from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


__UpperCAmelCase			:  Optional[Any]										=				{"configuration_sew_d": ["SEW_D_PRETRAINED_CONFIG_ARCHIVE_MAP", "SEWDConfig"]}

try:
      if not is_torch_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      __UpperCAmelCase			:  str										=				[
          "SEW_D_PRETRAINED_MODEL_ARCHIVE_LIST",
          "SEWDForCTC",
          "SEWDForSequenceClassification",
          "SEWDModel",
          "SEWDPreTrainedModel",
      ]

if TYPE_CHECKING:
      from .configuration_sew_d import SEW_D_PRETRAINED_CONFIG_ARCHIVE_MAP, SEWDConfig

      try:
            if not is_torch_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_sew_d import (
                SEW_D_PRETRAINED_MODEL_ARCHIVE_LIST,
                SEWDForCTC,
                SEWDForSequenceClassification,
                SEWDModel,
                SEWDPreTrainedModel,
            )


else:
      import sys

      __UpperCAmelCase			:  Union[str, Any]										=				_LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)






