



from __future__ import annotations

def 			a		( _UpperCAmelCase				:   int		):







		'''simple docstring'''





		for r in range(1					,  _UpperCAmelCase		):
				__UpperCAmelCase       :	List[str]						=      []
				for x in range(n - 1		):
						__UpperCAmelCase       :	Tuple						=      pow(_UpperCAmelCase					,  _UpperCAmelCase					,  _UpperCAmelCase		)
						if val in li:
								break
						li.append(_UpperCAmelCase		)
				else:
						return r
		return None


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

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










import json
import logging
import os
import subprocess
from argparse import ArgumentParser


__A       =logging.getLogger(__name__)

def 			a		( ):







		'''simple docstring'''





		__UpperCAmelCase       :	Dict						=      ArgumentParser()
		__UpperCAmelCase				,   __UpperCAmelCase       :	int						=      parser.parse_known_args()
		for arg in unknown:
				if arg.startswith(('''-''', '''--''')		):
						parser.add_argument(arg.split('''='''		)[0]		)

		return parser.parse_args()

def 			a		( ):







		'''simple docstring'''





		__UpperCAmelCase       :	List[Any]						=      parse_args()
		__UpperCAmelCase       :	Tuple						=      88_88
		__UpperCAmelCase       :	Any						=      int(os.environ['''SM_NUM_GPUS''']		)
		__UpperCAmelCase       :	Optional[int]						=      json.loads(os.environ['''SM_HOSTS''']		)
		__UpperCAmelCase       :	int						=      len(_UpperCAmelCase		)
		__UpperCAmelCase       :	Optional[Any]						=      os.environ['''SM_CURRENT_HOST''']
		__UpperCAmelCase       :	List[str]						=      hosts.index(_UpperCAmelCase		)
		__UpperCAmelCase       :	Dict						=      '''INFO'''

		if num_nodes > 1:
				__UpperCAmelCase       :	Tuple						=      f'python -m torch.distributed.launch \\n                --nnodes={num_nodes}  \\n                --node_rank={rank}  \\n                --nproc_per_node={num_gpus}  \\n                --master_addr={hosts[0]}  \\n                --master_port={port} \\n                ./run_glue.py \\n                {"".join(["nested fstring" for parameter,value in args.__dict__.items()]		)}'
		else:
				__UpperCAmelCase       :	Dict						=      f'python -m torch.distributed.launch \\n            --nproc_per_node={num_gpus}  \\n            ./run_glue.py \\n            {"".join(["nested fstring" for parameter,value in args.__dict__.items()]		)}'
		try:
				subprocess.run(_UpperCAmelCase					,  shell=_UpperCAmelCase		)
		except Exception as e:
				logger.info(_UpperCAmelCase		)


if __name__ == "__main__":
				main()





