




lowerCamelCase	:	Optional[Any]				=   range(2, 2_0 + 1)
lowerCamelCase	:	Optional[Any]				=   [1_0**k for k in range(ks[-1] + 1)]
lowerCamelCase	:	dict[int, dict[int, list[list[int]]]]				=   {}




def 						SCREAMING_SNAKE_CASE__ (   lowercase						,lowercase						,lowercase						,lowercase					)  ->       List[str]:
   snake_case				:    Tuple           =	sum(a_i[j] for j in range(lowercase						,len(lowercase					)					)					)
   snake_case				:    Tuple           =	sum(a_i[j] * base[j] for j in range(min(len(lowercase					)						,lowercase					)					)					)

   snake_case     , snake_case				:    int           =	0, 0
   snake_case				:    int           =	n - i

   snake_case				:    str           =	memo.get(lowercase					)

   if sub_memo is not None:
      snake_case				:    Optional[int]           =	sub_memo.get(lowercase					)

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

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

      else:
         snake_case				:    Optional[Any]           =	[]
   else:
      snake_case				:    Dict           =	{c: []}
      snake_case				:    List[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
         snake_case     , snake_case				:    List[str]           =	next_term(lowercase						,k - 1						,i + dn						,lowercase					)
         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				:    int           =	compute(lowercase						,lowercase						,i + dn						,lowercase					)
      diff += _diff
      dn += terms_jumped

   snake_case				:    Optional[int]           =	sub_memo[c]

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

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




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

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

   while i < n:
      i += 1
      snake_case				:    Tuple           =	ds_c + ds_b
      diff += addend
      snake_case				:    int           =	0
      for j in range(lowercase					):
         snake_case				:    Optional[int]           =	a_i[j] + addend
         snake_case     , snake_case				:    Optional[int]           =	divmod(lowercase						,10					)

         ds_c += a_i[j]

      if addend > 0:
         break

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




def 						SCREAMING_SNAKE_CASE__ (   lowercase						,lowercase						,lowercase					)  ->       int:
   for j in range(lowercase						,len(lowercase					)					):
      snake_case				:    List[Any]           =	digits[j] + addend
      if s >= 10:
         snake_case     , snake_case				:    Union[str, Any]           =	divmod(lowercase						,10					)
         snake_case				:    Dict           =	addend // 10 + quotient
      else:
         snake_case				:    Tuple           =	s
         snake_case				:    List[Any]           =	addend // 10

      if addend == 0:
         break

   while addend > 0:
      snake_case     , snake_case				:    List[Any]           =	divmod(lowercase						,10					)
      digits.append(lowercase					)




def 						SCREAMING_SNAKE_CASE__ (   lowercase = 10**15					)  ->       int:
   snake_case				:    Tuple           =	[1]
   snake_case				:    Dict           =	1
   snake_case				:    Tuple           =	0
   while True:
      snake_case     , snake_case				:    Tuple           =	next_term(lowercase						,20						,i + dn						,lowercase					)
      dn += terms_jumped
      if dn == n - i:
         break

   snake_case				:    List[Any]           =	0
   for j in range(len(lowercase					)					):
      a_n += digits[j] * 10**j
   return a_n


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











def 						SCREAMING_SNAKE_CASE__ (   lowercase						,lowercase					)  ->       int:
   return int((input_a, input_a).count(1					) != 0					)




def 						SCREAMING_SNAKE_CASE__ (   )  ->       None:
   assert or_gate(0						,0					) == 0
   assert or_gate(0						,1					) == 1
   assert or_gate(1						,0					) == 1
   assert or_gate(1						,1					) == 1


if __name__ == "__main__":
       print(or_gate(0, 1))
       print(or_gate(1, 0))
       print(or_gate(0, 0))
       print(or_gate(1, 1))





