

a_      =     range(2, 20 + 1)
a_      =     [10**k for k in range(ks[-1] + 1)]
a_      =     {}

def 			lowerCamelCase__			(       _a				,      _a				,      _a				,      _a):
	SCREAMING_SNAKE_CASE :   Dict					  =							sum(a_i[j] for j in range(_a				,      len(_a)))
	SCREAMING_SNAKE_CASE :   str					  =							sum(a_i[j] * base[j] for j in range(min(len(_a)				,      _a)))

	SCREAMING_SNAKE_CASE  ,SCREAMING_SNAKE_CASE :   Any					  =							0, 0
	SCREAMING_SNAKE_CASE :   List[Any]					  =							n - i

	SCREAMING_SNAKE_CASE :   List[Any]					  =							memo.get(_a)

	if sub_memo is not None:
		SCREAMING_SNAKE_CASE :   Dict					  =							sub_memo.get(_a)

		if jumps is not None and len(_a) > 0:
			# find and make the largest jump without going over
			SCREAMING_SNAKE_CASE :   Dict					  =							-1
			for _k in range(len(_a) - 1				,      -1				,      -1):
				if jumps[_k][2] <= k and jumps[_k][1] <= max_dn:
					SCREAMING_SNAKE_CASE :   str					  =							_k
					break

			if max_jump >= 0:
				SCREAMING_SNAKE_CASE  ,SCREAMING_SNAKE_CASE  ,SCREAMING_SNAKE_CASE :   Dict					  =							jumps[max_jump]
				# since the difference between jumps is cached, add c
				SCREAMING_SNAKE_CASE :   List[str]					  =							diff + c
				for j in range(min(_a				,      len(_a))):
					SCREAMING_SNAKE_CASE  ,SCREAMING_SNAKE_CASE :   Optional[Any]					  =							divmod(_a				,      10)
				if new_c > 0:
					add(_a				,      _a				,      _a)

		else:
			SCREAMING_SNAKE_CASE :   Optional[Any]					  =							[]
	else:
		SCREAMING_SNAKE_CASE :   str					  =							{c: []}
		SCREAMING_SNAKE_CASE :   Optional[Any]					  =							sub_memo

	if dn >= max_dn or c + diff >= base[k]:
		return diff, dn

	if k > ks[0]:
		while True:
			# keep doing smaller jumps
			SCREAMING_SNAKE_CASE  ,SCREAMING_SNAKE_CASE :   List[Any]					  =							next_term(_a				,      k - 1				,      i + dn				,      _a)
			diff += _diff
			dn += terms_jumped

			if dn >= max_dn or c + diff >= base[k]:
				break
	else:
		# would be too small a jump, just compute sequential terms instead
		SCREAMING_SNAKE_CASE  ,SCREAMING_SNAKE_CASE :   int					  =							compute(_a				,      _a				,      i + dn				,      _a)
		diff += _diff
		dn += terms_jumped

	SCREAMING_SNAKE_CASE :   Union[str, Any]					  =							sub_memo[c]

	# keep jumps sorted by # of terms skipped
	SCREAMING_SNAKE_CASE :   int					  =							0
	while j < len(_a):
		if jumps[j][1] > dn:
			break
		j += 1

	# cache the jump for this value digitsum(b) and c
	sub_memo[c].insert(_a				,      (diff, dn, k))
	return (diff, dn)

def 			lowerCamelCase__			(       _a				,      _a				,      _a				,      _a):
	if i >= n:
		return 0, i
	if k > len(_a):
		a_i.extend([0 for _ in range(k - len(_a))])

	# note: a_i -> b * 10^k + c
	# ds_b -> digitsum(b)
	# ds_c -> digitsum(c)
	SCREAMING_SNAKE_CASE :   Tuple					  =							i
	SCREAMING_SNAKE_CASE  ,SCREAMING_SNAKE_CASE  ,SCREAMING_SNAKE_CASE :   Any					  =							0, 0, 0
	for j in range(len(_a)):
		if j >= k:
			ds_b += a_i[j]
		else:
			ds_c += a_i[j]

	while i < n:
		i += 1
		SCREAMING_SNAKE_CASE :   str					  =							ds_c + ds_b
		diff += addend
		SCREAMING_SNAKE_CASE :   str					  =							0
		for j in range(_a):
			SCREAMING_SNAKE_CASE :   str					  =							a_i[j] + addend
			SCREAMING_SNAKE_CASE  ,SCREAMING_SNAKE_CASE :   Union[str, Any]					  =							divmod(_a				,      10)

			ds_c += a_i[j]

		if addend > 0:
			break

	if addend > 0:
		add(_a				,      _a				,      _a)
	return diff, i - start_i

def 			lowerCamelCase__			(       _a				,      _a				,      _a):
	for j in range(_a				,      len(_a)):
		SCREAMING_SNAKE_CASE :   Tuple					  =							digits[j] + addend
		if s >= 10:
			SCREAMING_SNAKE_CASE  ,SCREAMING_SNAKE_CASE :   List[Any]					  =							divmod(_a				,      10)
			SCREAMING_SNAKE_CASE :   int					  =							addend // 10 + quotient
		else:
			SCREAMING_SNAKE_CASE :   Union[str, Any]					  =							s
			SCREAMING_SNAKE_CASE :   List[Any]					  =							addend // 10

		if addend == 0:
			break

	while addend > 0:
		SCREAMING_SNAKE_CASE  ,SCREAMING_SNAKE_CASE :   str					  =							divmod(_a				,      10)
		digits.append(_a)

def 			lowerCamelCase__			(       _a = 10**15):
	SCREAMING_SNAKE_CASE :   List[str]					  =							[1]
	SCREAMING_SNAKE_CASE :   Any					  =							1
	SCREAMING_SNAKE_CASE :   List[Any]					  =							0
	while True:
		SCREAMING_SNAKE_CASE  ,SCREAMING_SNAKE_CASE :   Optional[Any]					  =							next_term(_a				,      20				,      i + dn				,      _a)
		dn += terms_jumped
		if dn == n - i:
			break

	SCREAMING_SNAKE_CASE :   int					  =							0
	for j in range(len(_a)):
		a_n += digits[j] * 10**j
	return a_n


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


a_      =     frozenset(
    [
        'prompt',
        'height',
        'width',
        'guidance_scale',
        'negative_prompt',
        'prompt_embeds',
        'negative_prompt_embeds',
        'cross_attention_kwargs',
    ]
)

a_      =     frozenset(['prompt', 'negative_prompt'])

a_      =     frozenset([])

a_      =     frozenset(['image'])

a_      =     frozenset(
    [
        'image',
        'height',
        'width',
        'guidance_scale',
    ]
)

a_      =     frozenset(['image'])

a_      =     frozenset(
    [
        'prompt',
        'image',
        'height',
        'width',
        'guidance_scale',
        'negative_prompt',
        'prompt_embeds',
        'negative_prompt_embeds',
    ]
)

a_      =     frozenset(['prompt', 'image', 'negative_prompt'])

a_      =     frozenset(
    [
        # Text guided image variation with an image mask
        'prompt',
        'image',
        'mask_image',
        'height',
        'width',
        'guidance_scale',
        'negative_prompt',
        'prompt_embeds',
        'negative_prompt_embeds',
    ]
)

a_      =     frozenset(['prompt', 'image', 'mask_image', 'negative_prompt'])

a_      =     frozenset(
    [
        # image variation with an image mask
        'image',
        'mask_image',
        'height',
        'width',
        'guidance_scale',
    ]
)

a_      =     frozenset(['image', 'mask_image'])

a_      =     frozenset(
    [
        'example_image',
        'image',
        'mask_image',
        'height',
        'width',
        'guidance_scale',
    ]
)

a_      =     frozenset(['example_image', 'image', 'mask_image'])

a_      =     frozenset(['class_labels'])

a_      =     frozenset(['class_labels'])

a_      =     frozenset(['batch_size'])

a_      =     frozenset([])

a_      =     frozenset(['batch_size'])

a_      =     frozenset([])

a_      =     frozenset(
    [
        'prompt',
        'audio_length_in_s',
        'guidance_scale',
        'negative_prompt',
        'prompt_embeds',
        'negative_prompt_embeds',
        'cross_attention_kwargs',
    ]
)

a_      =     frozenset(['prompt', 'negative_prompt'])
a_      =     frozenset(['input_tokens'])

a_      =     frozenset(['input_tokens'])