





from __future__ import annotations

from collections.abc import MutableSequence

class 							__SCREAMING_SNAKE_CASE       :






							def __init__(    self	,			__lowerCAmelCase	,			__lowerCAmelCase	):
														if len(a_	) != degree + 1:
																					raise ValueError(
																					    """The number of coefficients should be equal to the degree + 1."""	)

														UpperCamelCase__					  =      list(a_	)
														UpperCamelCase__					  =      degree






							def __add__(    self	,			__lowerCAmelCase	):

														if self.degree > polynomial_a.degree:
																					UpperCamelCase__					  =      self.coefficients[:]
																					for i in range(polynomial_a.degree + 1	):
																												coefficients[i] += polynomial_a.coefficients[i]
																					return Polynomial(self.degree	,			a_	)
														else:
																					UpperCamelCase__					  =      polynomial_a.coefficients[:]
																					for i in range(self.degree + 1	):
																												coefficients[i] += self.coefficients[i]
																					return Polynomial(polynomial_a.degree	,			a_	)






							def __sub__(    self	,			__lowerCAmelCase	):
														return self + polynomial_a * Polynomial(0	,			[-1]	)






							def __neg__(    self	):
														return Polynomial(self.degree	,			[-c for c in self.coefficients]	)






							def __mul__(    self	,			__lowerCAmelCase	):
														UpperCamelCase__					  =      [0] * (self.degree + polynomial_a.degree + 1)
														for i in range(self.degree + 1	):
																					for j in range(polynomial_a.degree + 1	):
																												coefficients[i + j] += (
																												    self.coefficients[i] * polynomial_a.coefficients[j]
																												)

														return Polynomial(self.degree + polynomial_a.degree	,			a_	)






							def 					_lowerCamelCase		(    self	,			__lowerCAmelCase	):
														UpperCamelCase__					  =      0
														for i in range(self.degree + 1	):
																					result += self.coefficients[i] * (substitution**i)
														return result






							def __str__(    self	):
														UpperCamelCase__					  =      ""
														for i in range(self.degree	,			-1	,			-1	):
																					if self.coefficients[i] == 0:
																												continue
																					elif self.coefficients[i] > 0:
																												if polynomial:
																																			polynomial += " + "
																					else:
																												polynomial += " - "

																					if i == 0:
																												polynomial += str(abs(self.coefficients[i]	)	)
																					elif i == 1:
																												polynomial += str(abs(self.coefficients[i]	)	) + "x"
																					else:
																												polynomial += str(abs(self.coefficients[i]	)	) + "x^" + str(a_	)

														return polynomial






							def __repr__(    self	):
														return self.__str__()






							def 					_lowerCamelCase		(    self	):
														UpperCamelCase__					  =      [0] * self.degree
														for i in range(self.degree	):
																					UpperCamelCase__					  =      self.coefficients[i + 1] * (i + 1)
														return Polynomial(self.degree - 1	,			a_	)






							def 					_lowerCamelCase		(    self	,			__lowerCAmelCase = 0	):
														UpperCamelCase__					  =      [0] * (self.degree + 2)
														UpperCamelCase__					  =      constant
														for i in range(self.degree + 1	):
																					UpperCamelCase__					  =      self.coefficients[i] / (i + 1)
														return Polynomial(self.degree + 1	,			a_	)






							def __eq__(    self	,			__lowerCAmelCase	):
														if not isinstance(a_	,			a_	):
																					return False

														if self.degree != polynomial_a.degree:
																					return False

														for i in range(self.degree + 1	):
																					if self.coefficients[i] != polynomial_a.coefficients[i]:
																												return False

														return True







							def __ne__(    self	,			__lowerCAmelCase	):
														return not self.__eq__(a_	)








'''simple docstring'''
def 	_A  (       A							)  ->				list:
	lowercase						:		str   					=		int(A							)
	if n_element < 1:
		lowercase						:		List[Any]   					=		ValueError("a should be a positive number"							)
		raise my_error

	lowercase						:		List[Any]   					=		[1]
	lowercase					,		lowercase					,		lowercase						:		Tuple   					=		(0, 0, 0)
	lowercase						:		Dict   					=		1
	while index < n_element:
		while hamming_list[i] * 2 <= hamming_list[-1]:
			i += 1
		while hamming_list[j] * 3 <= hamming_list[-1]:
			j += 1
		while hamming_list[k] * 5 <= hamming_list[-1]:
			k += 1
		hamming_list.append(
		    min(hamming_list[i] * 2							,hamming_list[j] * 3							,hamming_list[k] * 5							)							)
		index += 1
	return hamming_list


if __name__ == "__main__":
					lowerCAmelCase   : Union[str, Any]             =				input("""Enter the last number (nth term) of the Hamming Number Series: """)
					print("""Formula of Hamming Number Series => 2^i * 3^j * 5^k""")
					lowerCAmelCase   : Tuple             =				hamming(int(n))
					print("""-----------------------------------------------------""")
					print(F'''The list with nth numbers is: {hamming_numbers}''')
					print("""-----------------------------------------------------""")


