
'''simple docstring'''


__lowercase				: str											=  range(2, 20 + 1)
__lowercase				: Tuple											=  [10**k for k in range(ks[-1] + 1)]
__lowercase				: Dict											=  {}




def lowercase_						( _lowercase      ,							_lowercase      ,							_lowercase      ,							_lowercase					)  ->				List[Any]:
					'''simple docstring'''

					lowerCamelCase_       :   Optional[int]  =		sum(a_i[j] for j in range(lowerCamelCase__      ,							len(lowerCamelCase__					)					)					)
					lowerCamelCase_       :   Tuple  =		sum(a_i[j] * base[j] for j in range(min(len(lowerCamelCase__					)      ,							lowerCamelCase__					)					)					)

					lowerCamelCase_       :   Dict  =		0, 0
					lowerCamelCase_       :   Tuple  =		n - i

					lowerCamelCase_       :   List[Any]  =		memo.get(lowerCamelCase__					)

					if sub_memo is not None:
										lowerCamelCase_       :   List[str]  =		sub_memo.get(lowerCamelCase__					)

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

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

										else:
															lowerCamelCase_       :   Optional[Any]  =		[]
					else:
										lowerCamelCase_       :   List[str]  =		{c: []}
										lowerCamelCase_       :   int  =		sub_memo

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

					if k > ks[0]:
										while True:
															# keep doing smaller jumps
															lowerCamelCase_       :   int  =		next_term(lowerCamelCase__      ,							k - 1      ,							i + dn      ,							lowerCamelCase__					)
															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
										lowerCamelCase_       :   int  =		compute(lowerCamelCase__      ,							lowerCamelCase__      ,							i + dn      ,							lowerCamelCase__					)
										diff += _diff
										dn += terms_jumped

					lowerCamelCase_       :   Tuple  =		sub_memo[c]

					# keep jumps sorted by # of terms skipped
					lowerCamelCase_       :   Optional[Any]  =		0
					while j < len(lowerCamelCase__					):
										if jumps[j][1] > dn:
															break
										j += 1

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




def lowercase_						( _lowercase      ,							_lowercase      ,							_lowercase      ,							_lowercase					)  ->				int:
					'''simple docstring'''

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

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

					while i < n:
										i += 1
										lowerCamelCase_       :   Optional[Any]  =		ds_c + ds_b
										diff += addend
										lowerCamelCase_       :   List[Any]  =		0
										for j in range(lowerCamelCase__					):
															lowerCamelCase_       :   Dict  =		a_i[j] + addend
															lowerCamelCase_       :   int  =		divmod(lowerCamelCase__      ,							10					)

															ds_c += a_i[j]

										if addend > 0:
															break

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




def lowercase_						( _lowercase      ,							_lowercase      ,							_lowercase					)  ->				Optional[int]:
					'''simple docstring'''

					for j in range(lowerCamelCase__      ,							len(lowerCamelCase__					)					):
										lowerCamelCase_       :   List[Any]  =		digits[j] + addend
										if s >= 10:
															lowerCamelCase_       :   Any  =		divmod(lowerCamelCase__      ,							10					)
															lowerCamelCase_       :   Tuple  =		addend // 10 + quotient
										else:
															lowerCamelCase_       :   Any  =		s
															lowerCamelCase_       :   Optional[Any]  =		addend // 10

										if addend == 0:
															break

					while addend > 0:
										lowerCamelCase_       :   Tuple  =		divmod(lowerCamelCase__      ,							10					)
										digits.append(lowerCamelCase__					)




def lowercase_						( _lowercase = 10**15					)  ->				Union[str, Any]:
					'''simple docstring'''

					lowerCamelCase_       :   int  =		[1]
					lowerCamelCase_       :   List[str]  =		1
					lowerCamelCase_       :   Any  =		0
					while True:
										lowerCamelCase_       :   int  =		next_term(lowerCamelCase__      ,							20      ,							i + dn      ,							lowerCamelCase__					)
										dn += terms_jumped
										if dn == n - i:
															break

					lowerCamelCase_       :   Dict  =		0
					for j in range(len(lowerCamelCase__					)					):
										a_n += digits[j] * 10**j
					return a_n


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






"""simple docstring"""


import random


def    _lowerCamelCase   (     lowerCamelCase__	:							Tuple       ,		lowerCamelCase__	:							Dict       ,		lowerCamelCase__	:							str  ):
 lowercase__       :       List[Any]				=						a[left_index]
 lowercase__       :       List[Any]				=						left_index + 1
 for j in range(left_index + 1       ,		lowerCamelCase__  ):
  if a[j] < pivot:
   lowercase__	,       lowercase__       :       Dict				=						a[i], a[j]
   i += 1
 lowercase__	,       lowercase__       :       Any				=						a[i - 1], a[left_index]
 return i - 1


def    _lowerCamelCase   (     lowerCamelCase__	:							int       ,		lowerCamelCase__	:							Tuple       ,		lowerCamelCase__	:							Optional[int]  ):
 if left < right:
  lowercase__       :       str				=						random.randint(lowerCamelCase__       ,		right - 1  )
  lowercase__	,       lowercase__       :       Any				=						(
      a[left],
      a[pivot],
  )  # switches the pivot with the left most bound
  lowercase__       :       str				=						partition(lowerCamelCase__       ,		lowerCamelCase__       ,		lowerCamelCase__  )
  quick_sort_random(
      lowerCamelCase__       ,		lowerCamelCase__       ,		lowerCamelCase__  )  # recursive quicksort to the left of the pivot point
  quick_sort_random(
      lowerCamelCase__       ,		pivot_index + 1       ,		lowerCamelCase__  )  # recursive quicksort to the right of the pivot point


def    _lowerCamelCase   (     ):
 lowercase__       :       List[Any]				=						input("""Enter numbers separated by a comma:\n"""  ).strip()
 lowercase__       :       int				=						[int(lowerCamelCase__  ) for item in user_input.split(""","""  )]

 quick_sort_random(lowerCamelCase__       ,		0       ,		len(lowerCamelCase__  )  )

 print(lowerCamelCase__  )


if __name__ == "__main__":
   main()