



'''simple docstring'''




import math


def 				lowerCAmelCase_   (	_lowerCamelCase:   int					):

		if 1 < number < 4:
				# 2 and 3 are primes
				return True
		elif number < 2 or number % 2 == 0 or number % 3 == 0:
				# Negatives, 0, 1, all even numbers, all multiples of 3 are not primes
				return False

		# All primes number are in format of 6k +/- 1
		for i in range(5       ,      int(math.sqrt(_lowerCamelCase					) + 1					)       ,      6					):
				if number % i == 0 or number % (i + 2) == 0:
						return False
		return True


def 				lowerCAmelCase_   (	_lowerCamelCase:   int = 1_00_01					):

		try:
				__SCREAMING_SNAKE_CASE       :		List[str]           =		int(_lowerCamelCase					)
		except (TypeError, ValueError):
				raise TypeError("""Parameter nth must be int or castable to int."""					) from None
		if nth <= 0:
				raise ValueError("""Parameter nth must be greater than or equal to one."""					)
		__SCREAMING_SNAKE_CASE       :		list[int]           =		[]
		__SCREAMING_SNAKE_CASE       :		List[Any]           =		2
		while len(_lowerCamelCase					) < nth:
				if is_prime(_lowerCamelCase					):
						primes.append(_lowerCamelCase					)
						num += 1
				else:
						num += 1
		return primes[len(_lowerCamelCase					) - 1]


if __name__ == "__main__":
						print(f"{solution() = }")




'''simple docstring'''




def 				lowerCAmelCase_   (	_lowerCamelCase:   list					):
		if any(not isinstance(_lowerCamelCase       ,      _lowerCamelCase					) or x < 0 for x in sequence					):
				raise TypeError("""Sequence must be list of non-negative integers"""					)
		for _ in range(len(_lowerCamelCase					)					):
				for i, (rod_upper, rod_lower) in enumerate(zip(_lowerCamelCase       ,      sequence[1:]					)					):
						if rod_upper > rod_lower:
								sequence[i] -= rod_upper - rod_lower
								sequence[i + 1] += rod_upper - rod_lower
		return sequence


if __name__ == "__main__":
						assert bead_sort([5, 4, 3, 2, 1]) == [1, 2, 3, 4, 5]
						assert bead_sort([7, 9, 4, 3, 5]) == [3, 4, 5, 7, 9]