





'''simple docstring'''


from __future__ import annotations


def 						__a(SCREAMING_SNAKE_CASE_	:       int		,							SCREAMING_SNAKE_CASE_	:       int     ):



    '''simple docstring'''





    _lowerCAmelCase						      =   []
    create_all_state(1		,							SCREAMING_SNAKE_CASE_		,							SCREAMING_SNAKE_CASE_		,							[]		,							SCREAMING_SNAKE_CASE_     )
    return result


def 						__a(SCREAMING_SNAKE_CASE_	:       int		,							SCREAMING_SNAKE_CASE_	:       int		,							SCREAMING_SNAKE_CASE_	:       int		,							SCREAMING_SNAKE_CASE_	:       list[int]		,							SCREAMING_SNAKE_CASE_	:       list[list[int]]		,							):



    '''simple docstring'''





    if level == 0:
        total_list.append(current_list[:]     )
        return

    for i in range(SCREAMING_SNAKE_CASE_		,							total_number - level + 2     ):
        current_list.append(SCREAMING_SNAKE_CASE_     )
        create_all_state(i + 1		,							SCREAMING_SNAKE_CASE_		,							level - 1		,							SCREAMING_SNAKE_CASE_		,							SCREAMING_SNAKE_CASE_     )
        current_list.pop()


def 						__a(SCREAMING_SNAKE_CASE_	:       list[list[int]]     ):



    '''simple docstring'''





    for i in total_list:
        print(*SCREAMING_SNAKE_CASE_     )


if __name__ == "__main__":
       _SCREAMING_SNAKE_CASE									=				4
       _SCREAMING_SNAKE_CASE									=				2
       _SCREAMING_SNAKE_CASE									=				generate_all_combinations(n, k)
       print_all_state(total_list)










'''simple docstring'''





_UpperCamelCase						:						List[str]  =					[sum(int(c, 10) ** 2 for c in i.__str__()) for i in range(100_000)]
def __UpperCAmelCase   (					A					:			int		)    ->   int:
			UpperCAmelCase_      :       str          =       0
			while number:
						# Increased Speed Slightly by checking every 5 digits together.
						sum_of_digits_squared += DIGITS_SQUARED[number % 1_0_0_0_0_0]
						number //= 1_0_0_0_0_0

			return sum_of_digits_squared


# There are 2 Chains made,
# One ends with 89 with the chain member 58 being the one which when declared first,
# there will be the least number of iterations for all the members to be checked.

# The other one ends with 1 and has only one element 1.

# So 58 and 1 are chosen to be declared at the starting.

# Changed dictionary to an array to quicken the solution
_UpperCamelCase						:						list[bool | None]  =					[None] * 10_000_000
_UpperCamelCase						:						List[str]  =					True
_UpperCamelCase						:						Tuple  =					False
def __UpperCAmelCase   (					A					:			int		)    ->   bool:

			if CHAINS[number - 1] is not None:
						return CHAINS[number - 1]  # type: ignore

			UpperCAmelCase_      :       Dict          =       chain(next_number(A		)		)
			UpperCAmelCase_      :       int          =       number_chain

			while number < 1_0_0_0_0_0_0_0:
						UpperCAmelCase_      :       Optional[Any]          =       number_chain
						number *= 1_0

			return number_chain
def __UpperCAmelCase   (					A					:			int = 1_0_0_0_0_0_0_0		)    ->   int:
			for i in range(1			,       A		):
						if CHAINS[i] is None:
									chain(i + 1		)

			return CHAINS[:number].count(A		)


if __name__ == "__main__":
						import doctest

						doctest.testmod()
						print(f'''{solution() = }''')


