



from __future__ import annotations

import math

class        snake_case__    :







						"""simple docstring"""




						def __init__(       self ,       __lowercase  ) ->				None:
									"""simple docstring"""




									a__       :						List[Any]							=  size
									# approximate the overall size of segment tree with given value
									a__       :						List[Any]							=  [0 for i in range(0 ,       4 * size  )]
									# create array to store lazy update
									a__       :						Tuple							=  [0 for i in range(0 ,       4 * size  )]
									a__       :						Optional[Any]							=  [0 for i in range(0 ,       4 * size  )]  # flag for lazy update

						def 							SCREAMING_SNAKE_CASE__(       self ,       __lowercase  ) ->				int:
									"""simple docstring"""




									return idx * 2

						def 							SCREAMING_SNAKE_CASE__(       self ,       __lowercase  ) ->				int:
									"""simple docstring"""




									return idx * 2 + 1

						def 							SCREAMING_SNAKE_CASE__(       self ,       __lowercase ,       __lowercase ,       __lowercase ,       __lowercase  ) ->				None:
									"""simple docstring"""




									if left_element == right_element:
												a__       :						Any							=  a[left_element - 1]
									else:
												a__       :						List[Any]							=  (left_element + right_element) // 2
												self.build(self.left(__lowercase  ) ,       __lowercase ,       __lowercase ,       __lowercase  )
												self.build(self.right(__lowercase  ) ,       mid + 1 ,       __lowercase ,       __lowercase  )
												a__       :						Dict							=  max(
												    self.segment_tree[self.left(__lowercase  )] ,       self.segment_tree[self.right(__lowercase  )]  )

						def 							SCREAMING_SNAKE_CASE__(       self ,       __lowercase ,       __lowercase ,       __lowercase ,       __lowercase ,       __lowercase ,       __lowercase  ) ->				bool:
									"""simple docstring"""




									if self.flag[idx] is True:
												a__       :						Dict							=  self.lazy[idx]
												a__       :						Dict							=  False
												if left_element != right_element:
															a__       :						Tuple							=  self.lazy[idx]
															a__       :						Optional[int]							=  self.lazy[idx]
															a__       :						Optional[Any]							=  True
															a__       :						Optional[int]							=  True

									if right_element < a or left_element > b:
												return True
									if left_element >= a and right_element <= b:
												a__       :						Dict							=  val
												if left_element != right_element:
															a__       :						Union[str, Any]							=  val
															a__       :						Tuple							=  val
															a__       :						str							=  True
															a__       :						Union[str, Any]							=  True
												return True
									a__       :						Any							=  (left_element + right_element) // 2
									self.update(self.left(__lowercase  ) ,       __lowercase ,       __lowercase ,       __lowercase ,       __lowercase ,       __lowercase  )
									self.update(self.right(__lowercase  ) ,       mid + 1 ,       __lowercase ,       __lowercase ,       __lowercase ,       __lowercase  )
									a__       :						List[Any]							=  max(
									    self.segment_tree[self.left(__lowercase  )] ,       self.segment_tree[self.right(__lowercase  )]  )
									return True

						def 							SCREAMING_SNAKE_CASE__(       self ,       __lowercase ,       __lowercase ,       __lowercase ,       __lowercase ,       __lowercase  ) ->				int | float:
									"""simple docstring"""




									if self.flag[idx] is True:
												a__       :						List[str]							=  self.lazy[idx]
												a__       :						int							=  False
												if left_element != right_element:
															a__       :						List[Any]							=  self.lazy[idx]
															a__       :						Optional[int]							=  self.lazy[idx]
															a__       :						List[Any]							=  True
															a__       :						Union[str, Any]							=  True
									if right_element < a or left_element > b:
												return -math.inf
									if left_element >= a and right_element <= b:
												return self.segment_tree[idx]
									a__       :						List[str]							=  (left_element + right_element) // 2
									a__       :						Union[str, Any]							=  self.query(self.left(__lowercase  ) ,       __lowercase ,       __lowercase ,       __lowercase ,       __lowercase  )
									a__       :						str							=  self.query(self.right(__lowercase  ) ,       mid + 1 ,       __lowercase ,       __lowercase ,       __lowercase  )
									return max(__lowercase ,       __lowercase  )

						def __str__(       self  ) ->				str:
									"""simple docstring"""




									return str([self.query(1 ,       1 ,       self.size ,       __lowercase ,       __lowercase  ) for i in range(1 ,       self.size + 1  )]  )


if __name__ == "__main__":
		_lowercase		:				Optional[int]      		=[1, 2, -4, 7, 3, -5, 6, 11, -20, 9, 14, 15, 5, 2, -8]
		_lowercase		:				Union[str, Any]      		=15
		_lowercase		:				Union[str, Any]      		=SegmentTree(size)
		segt.build(1, 1, size, A)
		print(segt.query(1, 1, size, 4, 6))
		print(segt.query(1, 1, size, 7, 11))
		print(segt.query(1, 1, size, 7, 12))
		segt.update(1, 1, size, 1, 3, 111)
		print(segt.query(1, 1, size, 1, 15))
		segt.update(1, 1, size, 7, 8, 235)
		print(segt)









from __future__ import annotations

import math

def      lowerCAmelCase_					(  _lowercase    :       int)							->	list[int]:







			"""simple docstring"""

			if num <= 0:
						a__       :						Tuple							=  F'''{num}: Invalid input, please enter a positive integer.'''
						raise ValueError(_lowercase)

			a__       :						List[Any]							=  [True] * (num + 1)
			a__       :						List[str]							=  []
			a__       :						List[Any]							=  2
			a__       :						Optional[int]							=  int(math.sqrt(_lowercase))

			while start <= end:
						# If start is a prime
						if sieve[start] is True:
									prime.append(_lowercase)

									# Set multiples of start be False
									for i in range(start * start						,       num + 1						,       _lowercase):
												if sieve[i] is True:
															a__       :						Optional[int]							=  False

						start += 1

			for j in range(end + 1						,       num + 1):
						if sieve[j] is True:
									prime.append(_lowercase)

			return prime


if __name__ == "__main__":
		print(prime_sieve(int(input("Enter a positive integer: ").strip())))




