


'''simple docstring'''





from __future__ import annotations

from collections.abc import MutableSequence
class 						a__					:





			'''simple docstring'''

			def __init__(  self							:			List[Any]			,    lowerCAmelCase_							:			int			,    lowerCAmelCase_							:			MutableSequence[float]	)      ->		None:
						if len(lowerCAmelCase_	) != degree + 1:
									raise ValueError(
									    'The number of coefficients should be equal to the degree + 1.'	)

						__A=	list(lowerCAmelCase_	)
						__A=	degree
			def __add__(  self							:			List[str]			,    lowerCAmelCase_							:			Polynomial	)      ->		Polynomial:

						if self.degree > polynomial_a.degree:
									__A=	self.coefficients[:]
									for i in range(polynomial_a.degree + 1	):
												coefficients[i] += polynomial_a.coefficients[i]
									return Polynomial(self.degree			,    lowerCAmelCase_	)
						else:
									__A=	polynomial_a.coefficients[:]
									for i in range(self.degree + 1	):
												coefficients[i] += self.coefficients[i]
									return Polynomial(polynomial_a.degree			,    lowerCAmelCase_	)
			def __sub__(  self							:			Optional[int]			,    lowerCAmelCase_							:			Polynomial	)      ->		Polynomial:
						return self + polynomial_a * Polynomial(0			,    [-1]	)
			def __neg__(  self							:			Optional[Any]	)      ->		Polynomial:
						return Polynomial(self.degree			,    [-c for c in self.coefficients]	)
			def __mul__(  self							:			Any			,    lowerCAmelCase_							:			Polynomial	)      ->		Polynomial:
						__A=	[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			,    lowerCAmelCase_	)
			def 					lowerCAmelCase     (  self							:			int			,    lowerCAmelCase_							:			int | float	)      ->		int | float:
						__A=	0
						for i in range(self.degree + 1	):
									result += self.coefficients[i] * (substitution**i)
						return result
			def __str__(  self							:			List[str]	)      ->		str:
						__A=	''
						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(lowerCAmelCase_	)

						return polynomial
			def __repr__(  self							:			int	)      ->		str:
						return self.__str__()
			def 					lowerCAmelCase     (  self							:			str	)      ->		Polynomial:
						__A=	[0] * self.degree
						for i in range(self.degree	):
									__A=	self.coefficients[i + 1] * (i + 1)
						return Polynomial(self.degree - 1			,    lowerCAmelCase_	)
			def 					lowerCAmelCase     (  self							:			Optional[int]			,    lowerCAmelCase_							:			int | float = 0	)      ->		Polynomial:
						__A=	[0] * (self.degree + 2)
						__A=	constant
						for i in range(self.degree + 1	):
									__A=	self.coefficients[i] / (i + 1)
						return Polynomial(self.degree + 1			,    lowerCAmelCase_	)
			def __eq__(  self							:			str			,    lowerCAmelCase_							:			object	)      ->		bool:
						if not isinstance(lowerCAmelCase_			,    lowerCAmelCase_	):
									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							:			List[str]			,    lowerCAmelCase_							:			object	)      ->		bool:
						return not self.__eq__(lowerCAmelCase_	)







'''simple docstring'''





def 						UpperCAmelCase__(				_SCREAMING_SNAKE_CASE					: int,_SCREAMING_SNAKE_CASE					: int ):






			"""simple docstring"""




			return int((input_a, input_a).count(1 ) != 0 )






def 						UpperCAmelCase__(				):






			"""simple docstring"""




			assert or_gate(0,0 ) == 0
			assert or_gate(0,1 ) == 1
			assert or_gate(1,0 ) == 1
			assert or_gate(1,1 ) == 1


if __name__ == "__main__":
					print(or_gate(0, 1))
					print(or_gate(1, 0))
					print(or_gate(0, 0))
					print(or_gate(1, 1))



