

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





def  __lowerCamelCase     (			UpperCamelCase__       ,							UpperCamelCase__       ,							UpperCamelCase__       ,							UpperCamelCase__				):







							'''simple docstring'''






							snake_case_          =   sum(a_i[j] for j in range(a__       ,							len(a__				)				)				)
							snake_case_          =   sum(a_i[j] * base[j] for j in range(min(len(a__				)       ,							a__				)				)				)

							snake_case_    ,   snake_case_          =   0, 0
							snake_case_          =   n - i

							snake_case_          =   memo.get(a__				)

							if sub_memo is not None:
														snake_case_          =   sub_memo.get(a__				)

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

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

														else:
																					snake_case_          =   []
							else:
														snake_case_          =   {c: []}
														snake_case_          =   sub_memo

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

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

							snake_case_          =   sub_memo[c]

							# keep jumps sorted by # of terms skipped
							snake_case_          =   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     (			UpperCamelCase__       ,							UpperCamelCase__       ,							UpperCamelCase__       ,							UpperCamelCase__				):







							'''simple docstring'''






							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)
							snake_case_          =   i
							snake_case_    ,   snake_case_    ,   snake_case_          =   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
														snake_case_          =   ds_c + ds_b
														diff += addend
														snake_case_          =   0
														for j in range(a__				):
																					snake_case_          =   a_i[j] + addend
																					snake_case_    ,   snake_case_          =   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     (			UpperCamelCase__       ,							UpperCamelCase__       ,							UpperCamelCase__				):







							'''simple docstring'''






							for j in range(a__       ,							len(a__				)				):
														snake_case_          =   digits[j] + addend
														if s >= 10:
																					snake_case_    ,   snake_case_          =   divmod(a__       ,							10				)
																					snake_case_          =   addend // 10 + quotient
														else:
																					snake_case_          =   s
																					snake_case_          =   addend // 10

														if addend == 0:
																					break

							while addend > 0:
														snake_case_    ,   snake_case_          =   divmod(a__       ,							10				)
														digits.append(a__				)





def  __lowerCamelCase     (			UpperCamelCase__ = 10**15				):







							'''simple docstring'''






							snake_case_          =   [1]
							snake_case_          =   1
							snake_case_          =   0
							while True:
														snake_case_    ,   snake_case_          =   next_term(a__       ,							20       ,							i + dn       ,							a__				)
														dn += terms_jumped
														if dn == n - i:
																					break

							snake_case_          =   0
							for j in range(len(a__				)				):
														a_n += digits[j] * 10**j
							return a_n


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







from __future__ import annotations

import os
from typing import Any

import requests

_UpperCAmelCase		:       int						    =	"""https://api.github.com"""

# https://docs.github.com/en/free-pro-team@latest/rest/reference/users#get-the-authenticated-user
_UpperCAmelCase		:       Dict						    =	BASE_URL + """/user"""

# https://github.com/settings/tokens
_UpperCAmelCase		:       Optional[Any]						    =	os.environ.get("""USER_TOKEN""", """""")





def  __lowerCamelCase     (			UpperCamelCase__				):







							'''simple docstring'''






							snake_case_          =   {
							    'Authorization': F'''token {auth_token}''',
							    'Accept': 'application/vnd.github.v3+json',
							}
							return requests.get(UpperCamelCase__       ,							headers=UpperCamelCase__				).json()


if __name__ == "__main__":  # pragma: no cover
					if USER_TOKEN:
										for key, value in fetch_github_info(USER_TOKEN).items():
															print(F'''{key}: {value}''')
					else:
										raise ValueError("""'USER_TOKEN' field cannot be empty.""")




