






from __future__ import annotations
def 		_a					(   a				:int				)							->    int | None:
 for r in range(1			,							a				):
  a							=   []
  for x in range(n - 1				):
   a							=   pow(a			,							a			,							a				)
   if val in li:
    break
   li.append(a				)
  else:
   return r
 return None


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

          UpperCAmelCase__            =	pow(b_public, a_private, q)
          UpperCAmelCase__            =	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__            =	{"configuration_visual_bert": ["VISUAL_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "VisualBertConfig"]}

try:
     if not is_torch_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     UpperCAmelCase__            =	[
         "VISUAL_BERT_PRETRAINED_MODEL_ARCHIVE_LIST",
         "VisualBertForMultipleChoice",
         "VisualBertForPreTraining",
         "VisualBertForQuestionAnswering",
         "VisualBertForRegionToPhraseAlignment",
         "VisualBertForVisualReasoning",
         "VisualBertLayer",
         "VisualBertModel",
         "VisualBertPreTrainedModel",
     ]


if TYPE_CHECKING:
     from .configuration_visual_bert import VISUAL_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP, VisualBertConfig

     try:
          if not is_torch_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .modeling_visual_bert import (
              VISUAL_BERT_PRETRAINED_MODEL_ARCHIVE_LIST,
              VisualBertForMultipleChoice,
              VisualBertForPreTraining,
              VisualBertForQuestionAnswering,
              VisualBertForRegionToPhraseAlignment,
              VisualBertForVisualReasoning,
              VisualBertLayer,
              VisualBertModel,
              VisualBertPreTrainedModel,
          )


else:
     import sys

     UpperCAmelCase__            =	_LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)


