




def 		A_	(							snake_case							:				Any	) ->      Union[str, Any]:



						'''simple docstring'''

						__UpperCamelCase       					=     []
						__UpperCamelCase       					=     1

						for i in range(len(__A	)	):
												if i + 1 < len(__A	) and text[i] == text[i + 1]:
																		count += 1
												else:
																		encoded.append((text[i], count)	)
																		__UpperCamelCase       					=     1

						return encoded




def 		A_	(							snake_case							:				Dict	) ->      Tuple:



						'''simple docstring'''

						return "".join(char * length for char, length in encoded	)


if __name__ == "__main__":
				from doctest import testmod

				testmod(name="run_length_encode", verbose=True)
				testmod(name="run_length_decode", verbose=True)






def 		A_	(							snake_case							:				Union[str, Any]	, snake_case							:				Tuple	, snake_case							:				Optional[Any]	) ->      Union[str, Any]:



						'''simple docstring'''

						assert b != 0, "This cannot accept modulo that is == 0"
						if n == 0:
												return 1

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

						__UpperCamelCase       					=     bin_exp_mod(snake_case	, n / 2	, snake_case	)
						return (r * r) % b


if __name__ == "__main__":
				try:
								lowercase__							:							Dict													=     int(input("Enter Base : ").strip())
								lowercase__							:							Dict													=     int(input("Enter Power : ").strip())
								lowercase__							:							Dict													=     int(input("Enter Modulo : ").strip())
				except ValueError:
								print("Invalid literal for integer")

				print(bin_exp_mod(BASE, POWER, MODULO))




