import gc
import threading
import time

import psutil
import torch





class 					lowercase__						:


						def __init__(       self	:				Optional[int]						):





												'''simple docstring'''





												SCREAMING_SNAKE_CASE							:    Optional[int]							=							psutil.Process()
												SCREAMING_SNAKE_CASE							:    Dict							=							False


						def        __A       (       self	:				int						):





												'''simple docstring'''





												SCREAMING_SNAKE_CASE							:    List[str]							=							-1

												while True:
																		SCREAMING_SNAKE_CASE							:    Union[str, Any]							=							max(self.process.memory_info().rss    ,		self.cpu_memory_peak						)

																		# can't sleep or will not catch the peak right (this comment is here on purpose)
																		if not self.peak_monitoring:
																								break


						def        __A       (       self	:				List[Any]						):





												'''simple docstring'''





												SCREAMING_SNAKE_CASE							:    Any							=							True
												SCREAMING_SNAKE_CASE							:    Tuple							=							threading.Thread(target=self.peak_monitor						)
												SCREAMING_SNAKE_CASE							:    Optional[int]							=							True
												self.thread.start()



						def        __A       (       self	:				Dict						):





												'''simple docstring'''





												SCREAMING_SNAKE_CASE							:    Dict							=							False
												self.thread.join()
												return self.cpu_memory_peak






__UpperCamelCase		:       Any									=     PeakCPUMemory()
def       A	(    ):
						# Time
						SCREAMING_SNAKE_CASE							:    Dict							=							{'''time''': time.time()}

						gc.collect()
						torch.cuda.empty_cache()

						# CPU mem
						SCREAMING_SNAKE_CASE							:    Optional[Any]							=							psutil.Process().memory_info().rss
						cpu_peak_tracker.start()

						# GPU mem
						for i in range(torch.cuda.device_count()						):
												SCREAMING_SNAKE_CASE							:    str							=							torch.cuda.memory_allocated(SCREAMING_SNAKE_CASE__						)
						torch.cuda.reset_peak_memory_stats()

						return measures
def       A	(    _lowercase						):
						# Time
						SCREAMING_SNAKE_CASE							:    Dict							=							{'''time''': time.time() - start_measures['''time''']}

						gc.collect()
						torch.cuda.empty_cache()

						# CPU mem
						SCREAMING_SNAKE_CASE							:    Tuple							=							(psutil.Process().memory_info().rss - start_measures['''cpu''']) / 2**20
						SCREAMING_SNAKE_CASE							:    int							=							(cpu_peak_tracker.stop() - start_measures['''cpu''']) / 2**20

						# GPU mem
						for i in range(torch.cuda.device_count()						):
												SCREAMING_SNAKE_CASE							:    Any							=							(torch.cuda.memory_allocated(SCREAMING_SNAKE_CASE__						) - start_measures[str(SCREAMING_SNAKE_CASE__						)]) / 2**20
												SCREAMING_SNAKE_CASE							:    List[str]							=							(torch.cuda.max_memory_allocated(SCREAMING_SNAKE_CASE__						) - start_measures[str(SCREAMING_SNAKE_CASE__						)]) / 2**20

						return measures



def       A	(    _lowercase		,  _lowercase						):
						print(f"""{description}:"""						)
						print(f"""- Time: {measures['time']:.2f}s"""						)
						for i in range(torch.cuda.device_count()						):
												print(f"""- GPU {i} allocated: {measures[str(SCREAMING_SNAKE_CASE__						)]:.2f}MiB"""						)
												SCREAMING_SNAKE_CASE							:    List[Any]							=							measures[f"""{i}-peak"""]
												print(f"""- GPU {i} peak: {peak:.2f}MiB"""						)
						print(f"""- CPU RAM allocated: {measures['cpu']:.2f}MiB"""						)
						print(f"""- CPU RAM peak: {measures['cpu-peak']:.2f}MiB"""						)








import math


def   __SCREAMING_SNAKE_CASE					(SCREAMING_SNAKE_CASE__  ,		SCREAMING_SNAKE_CASE__       ):
						if 0 not in (x, y):
												# We use the relation x^y = y*log10(x), where 10 is the base.
												return y * math.logaa(SCREAMING_SNAKE_CASE__       )
						else:
												if x == 0:  # 0 raised to any number is 0
																		return 0
												elif y == 0:
																		return 1  # any number raised to 0 is 1
						raise AssertionError('''This should never happen'''       )


if __name__ == "__main__":  # Main function
					# Read two numbers from input and typecast them to int using map function.
					# Here x is the base and y is the power.
					lowerCAmelCase_       	=	'''Enter the base and the power separated by a comma: '''
					lowerCAmelCase_	,      lowerCAmelCase_       	=	map(int, input(prompt).split(''','''))
					lowerCAmelCase_	,      lowerCAmelCase_       	=	map(int, input(prompt).split(''','''))

					# We find the log of each number, using the function res(), which takes two
					# arguments.
					lowerCAmelCase_       	=	res(xa, ya)
					lowerCAmelCase_       	=	res(xa, ya)

					# We check for the largest number
					if resa > resa:
										print('''Largest number is''', xa, '''^''', ya)
					elif resa > resa:
										print('''Largest number is''', xa, '''^''', ya)
					else:
										print('''Both are equal''')