'''simple docstring'''

from collections import defaultdict


def 					UpperCAmelCase__      (							_lowerCAmelCase						: int = 5)						->		int:



						"""simple docstring"""

						snake_case   :					int							=						defaultdict(_lowerCAmelCase)
						snake_case   :					List[Any]							=						0

						while True:
												snake_case   :					Union[str, Any]							=						get_digits(_lowerCAmelCase)
												freqs[digits].append(_lowerCAmelCase)

												if len(freqs[digits]) == max_base:
																		snake_case   :					Dict							=						freqs[digits][0] ** 3
																		return base

												num += 1


def 					UpperCAmelCase__      (							_lowerCAmelCase						: int)						->		str:



						"""simple docstring"""

						return "".join(sorted(str(num**3)))


if __name__ == "__main__":
						print(f"{solution() = }")






'''simple docstring'''

from __future__ import annotations


def 					UpperCAmelCase__      (							_lowerCAmelCase						: int)						->		int | None:



						"""simple docstring"""

						for r in range(1,			_lowerCAmelCase):
												snake_case   :					Optional[Any]							=						[]
												for x in range(n - 1):
																		snake_case   :					int							=						pow(_lowerCAmelCase,			_lowerCAmelCase,			_lowerCAmelCase)
																		if val in li:
																								break
																		li.append(_lowerCAmelCase)
												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)





