
"""simple docstring"""




a		:       str     						=       [sum(int(c, 10) ** 2 for c in i.__str__()) for i in range(10_00_00)]



def     __magic_name__		(					UpperCamelCase     :		Optional[Any]     )     ->						Any:
    a__		=			0
    while number:
        # Increased Speed Slightly by checking every 5 digits together.
        sum_of_digits_squared += DIGITS_SQUARED[number % 100000]
        number //= 100000

    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
a		:       int     						=       [None] * 10_00_00_00
a		:       Tuple     						=       True
a		:       Union[str, Any]     						=       False



def     __magic_name__		(					UpperCamelCase     :		Optional[Any]     )     ->						Optional[Any]:

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

    a__		=			chain(next_number(UpperCamelCase     )     )
    a__		=			number_chain

    while number < 10000000:
        a__		=			number_chain
        number *= 10

    return number_chain



def     __magic_name__		(					UpperCamelCase     :		Tuple = 10000000     )     ->						Optional[int]:
    for i in range(1							,		UpperCamelCase     ):
        if CHAINS[i] is None:
            chain(i + 1     )

    return CHAINS[:number].count(UpperCamelCase     )


if __name__ == "__main__":
    import doctest

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








'''simple docstring'''


def 						lowerCamelCase__   (				a							):
						__snake_case						 =   [0] * len(a							)
						__snake_case						 =   []
						__snake_case						 =   []
						__snake_case						 =   0

						for values in graph.values():
												for i in values:
																		indegree[i] += 1

						for i in range(len(a							)							):
												if indegree[i] == 0:
																		queue.append(a							)

						while queue:
												__snake_case						 =   queue.pop(0							)
												cnt += 1
												topo.append(a							)
												for x in graph[vertex]:
																		indegree[x] -= 1
																		if indegree[x] == 0:
																								queue.append(a							)

						if cnt != len(a							):
												print('Cycle exists'							)
						else:
												print(a							)


# Adjacency List of Graph
_lowercase  =			{0: [1, 2], 1: [3], 2: [3], 3: [4, 5], 4: [], 5: []}






topological_sort(graph)

