


"""simple docstring"""
from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


SCREAMING_SNAKE_CASE					:       int							   =							{"""configuration_visual_bert""": ["""VISUAL_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP""", """VisualBertConfig"""]}

try:
			if not is_torch_available():
						raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
			pass
else:
			SCREAMING_SNAKE_CASE					:       Union[str, Any]							   =							[
			    """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

			SCREAMING_SNAKE_CASE					:       Optional[Any]							   =							_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)










'''simple docstring'''







def  SCREAMING_SNAKE_CASE__ (				SCREAMING_SNAKE_CASE ,		SCREAMING_SNAKE_CASE ,		SCREAMING_SNAKE_CASE     ):
		assert b != 0, "This cannot accept modulo that is == 0"
		if n == 0:
				return 1

		if n % 2 == 1:
				return (bin_exp_mod(SCREAMING_SNAKE_CASE ,		n - 1 ,		SCREAMING_SNAKE_CASE     ) * a) % b

		SCREAMING_SNAKE_CASE_						:List[str]										=      bin_exp_mod(SCREAMING_SNAKE_CASE ,		n / 2 ,		SCREAMING_SNAKE_CASE     )
		return (r * r) % b


if __name__ == "__main__":
							try:
														SCREAMING_SNAKE_CASE__     : Any				=   int(input("""Enter Base : """).strip())
														SCREAMING_SNAKE_CASE__     : str				=   int(input("""Enter Power : """).strip())
														SCREAMING_SNAKE_CASE__     : List[Any]				=   int(input("""Enter Modulo : """).strip())
							except ValueError:
														print("""Invalid literal for integer""")

							print(bin_exp_mod(BASE, POWER, MODULO))
