
import copy
import os

import cva
import numpy as np
from matplotlib import pyplot as plt







class  UpperCamelCase__		:







	'''simple docstring'''





	def __init__(			self		):
					A__  :	List[str]         =							''''''
					A__  :	int         =							''''''
					A__  :	Any         =							[]
					A__  :	Any         =							0
					A__  :	Optional[int]         =							256
					A__  :	str         =							0
					A__  :	Dict         =							0
					A__  :	List[Any]         =							0
					A__  :	Dict         =							0





	def   __snake_case				(			self				,       UpperCamelCase__		):
					A__  :	List[str]         =							cva.imread(UpperCamelCase__				,       0		)
					A__  :	List[Any]         =							copy.deepcopy(self.img		)
					A__       ,							A__       ,							A__  :	List[str]         =							plt.hist(self.img.ravel()				,       256				,       [0, 256]				,       label='''x'''		)
					A__  :	List[Any]         =							np.sum(UpperCamelCase__		)
					for i in range(len(UpperCamelCase__		)		):
									A__  :	Union[str, Any]         =							x[i] / self.k
									self.sk += prk
									A__  :	Any         =							(self.L - 1) * self.sk
									if self.rem != 0:
													A__  :	str         =							int(last % last		)
									A__  :	Any         =							int(last + 1 if self.rem >= 0.5 else last		)
									self.last_list.append(UpperCamelCase__		)
									A__  :	Optional[int]         =							int(np.ma.count(self.img		) / self.img[1].size		)
									A__  :	Dict         =							self.img[1].size
					for i in range(self.number_of_cols		):
									for j in range(self.number_of_rows		):
													A__  :	Optional[Any]         =							self.img[j][i]
													if num != self.last_list[num]:
																	A__  :	List[str]         =							self.last_list[num]
					cva.imwrite('''output_data/output.jpg'''				,       self.img		)





	def   __snake_case				(			self		):
					plt.hist(self.img.ravel()				,       256				,       [0, 256]		)





	def   __snake_case				(			self		):
					cva.imshow('''Output-Image'''				,       self.img		)
					cva.imshow('''Input-Image'''				,       self.original_image		)
					cva.waitKey(5000		)
					cva.destroyAllWindows()


if __name__ == "__main__":
					_SCREAMING_SNAKE_CASE    :      Union[str, Any]          =			os.path.join(os.path.basename(__file__), 'image_data/input.jpg')
					_SCREAMING_SNAKE_CASE    :      List[Any]          =			ConstantStretch()
					stretcher.stretch(file_path)
					stretcher.plot_histogram()
					stretcher.show_image()

def 				SCREAMING_SNAKE_CASE     (      ) ->       Optional[int]:

				"""simple docstring"""







				A__  :	Optional[Any]         =							0
				for i in range(1							,						10_01       ):
								total += i**i
				return str(__UpperCamelCase       )[-10:]


if __name__ == "__main__":
					print(solution())