



'''simple docstring'''



import itertools



def 	__lowerCAmelCase       (				lowerCamelCase :    int = 1_00_00_00       ):






	'''simple docstring'''




	__lowerCAmelCase       				=	[1]

	for i in itertools.count(len(lowerCamelCase       )       ):
		__lowerCAmelCase       				=	0
		for j in itertools.count(1       ):
			__lowerCAmelCase       				=	-1 if j % 2 == 0 else +1
			__lowerCAmelCase       				=	(j * j * 3 - j) // 2
			if index > i:
				break
			item += partitions[i - index] * sign
			item %= number
			index += j
			if index > i:
				break
			item += partitions[i - index] * sign
			item %= number

		if item == 0:
			return i
		partitions.append(lowerCamelCase       )

	return 0


if __name__ == "__main__":
	import doctest

	doctest.testmod()

	print(f'{solution() = }')




'''simple docstring'''



import math



def 	__lowerCAmelCase       (				lowerCamelCase :    int       ):






	'''simple docstring'''




	if not isinstance(lowerCamelCase					,		lowerCamelCase       ):
		__lowerCAmelCase       				=	f'''Input value of [number={number}] must be an integer'''
		raise TypeError(lowerCamelCase       )
	if number < 1:
		__lowerCAmelCase       				=	f'''Input value of [number={number}] must be a positive integer'''
		raise ValueError(lowerCamelCase       )
	__lowerCAmelCase       				=	[number]
	while number != 1:
		if number % 2 == 0:
			__lowerCAmelCase       				=	math.floor(math.sqrt(lowerCamelCase       )       )
		else:
			__lowerCAmelCase       				=	math.floor(
			    math.sqrt(lowerCamelCase       ) * math.sqrt(lowerCamelCase       ) * math.sqrt(lowerCamelCase       )       )
		sequence.append(lowerCamelCase       )
	return sequence


if __name__ == "__main__":
	import doctest

	doctest.testmod()