"""simple docstring"""







def 					a__ (						UpperCAmelCase__    :     int     )->		list:
						UpperCAmelCase__   		=						[True for i in range(n + 1     )]
						UpperCAmelCase__   		=						[i - 1 for i in range(n + 1     )]
						UpperCAmelCase__   		=						[]
						for i in range(2						,     n + 1     ):
												if is_prime[i]:
																		primes.append(UpperCAmelCase__     )
												for j in range(0						,     len(UpperCAmelCase__     )     ):
																		if i * primes[j] >= n:
																								break
																		UpperCAmelCase__   		=						False

																		if i % primes[j] == 0:
																								UpperCAmelCase__   		=						totients[i] * primes[j]
																								break

																		UpperCAmelCase__   		=						totients[i] * (primes[j] - 1)

						return totients


if __name__ == "__main__":
						import doctest

						doctest.testmod()


"""simple docstring"""







from __future__ import annotations


def 					a__ (						UpperCAmelCase__    :     int     )->		list[int]:
						assert (
						    isinstance(UpperCAmelCase__						,     UpperCAmelCase__     ) and mask > 0
						), f'mask needs to be positive integer, your input {mask}'
						UpperCAmelCase__   		=						[]
						UpperCAmelCase__   		=						mask

						while submask:
												all_submasks.append(UpperCAmelCase__     )
												UpperCAmelCase__   		=						(submask - 1) & mask

						return all_submasks


if __name__ == "__main__":
						import doctest

						doctest.testmod()

