


'''simple docstring'''



A__						:   List[str]				=    [0, 2, 4, 6, 8]
A__						:   Union[str, Any]				=    [1, 3, 5, 7, 9]



def      UpperCAmelCase__   (      UpperCAmelCase_       :							int ,       UpperCAmelCase_       :							int ,       UpperCAmelCase_       :							list[int] ,       UpperCAmelCase_       :							int				)	->						int:
     if remaining_length == 0:
          if digits[0] == 0 or digits[-1] == 0:
               return 0

          for i in range(length // 2 - 1 ,       -1 ,       -1				):
               remainder += digits[i] + digits[length - i - 1]

               if remainder % 2 == 0:
                    return 0

               remainder //= 10

          return 1

     if remaining_length == 1:
          if remainder % 2 == 0:
               return 0

          __lowerCamelCase  :      Optional[Any]														=						0
          for digit in range(10				):
               __lowerCamelCase  :      Optional[int]														=						digit
               result += reversible_numbers(
                   0 ,       (remainder + 2 * digit) // 10 ,       UpperCAmelCase_ ,       UpperCAmelCase_				)
          return result

     __lowerCamelCase  :      Optional[int]														=						0
     for digita in range(10				):
          __lowerCamelCase  :      List[Any]														=						digita

          if (remainder + digita) % 2 == 0:
               __lowerCamelCase  :      int														=						ODD_DIGITS
          else:
               __lowerCamelCase  :      Union[str, Any]														=						EVEN_DIGITS

          for digita in other_parity_digits:
               __lowerCamelCase  :      Optional[int]														=						digita
               result += reversible_numbers(
                   remaining_length - 2 ,       (remainder + digita + digita) // 10 ,       UpperCAmelCase_ ,       UpperCAmelCase_ ,       )
     return result



def      UpperCAmelCase__   (      UpperCAmelCase_       :							int = 9				)	->						int:
     __lowerCamelCase  :      List[Any]														=						0
     for length in range(1 ,       max_power + 1				):
          result += reversible_numbers(UpperCAmelCase_ ,       0 ,       [0] * length ,       UpperCAmelCase_				)
     return result


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









# Copyright 2023 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from typing import TYPE_CHECKING

# rely on isort to merge the imports
from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tokenizers_available, is_torch_available


A									=  {'configuration_mra': ['MRA_PRETRAINED_CONFIG_ARCHIVE_MAP', 'MraConfig']}

try:
		if not is_torch_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		A									=  [
		    'MRA_PRETRAINED_MODEL_ARCHIVE_LIST',
		    'MraForMaskedLM',
		    'MraForMultipleChoice',
		    'MraForQuestionAnswering',
		    'MraForSequenceClassification',
		    'MraForTokenClassification',
		    'MraLayer',
		    'MraModel',
		    'MraPreTrainedModel',
		]


if TYPE_CHECKING:
		from .configuration_mra import MRA_PRETRAINED_CONFIG_ARCHIVE_MAP, MraConfig

		try:
				if not is_torch_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_mra import (
				    MRA_PRETRAINED_MODEL_ARCHIVE_LIST,
				    MraForMaskedLM,
				    MraForMultipleChoice,
				    MraForQuestionAnswering,
				    MraForSequenceClassification,
				    MraForTokenClassification,
				    MraLayer,
				    MraModel,
				    MraPreTrainedModel,
				)
else:
		import sys

		A									=  _LazyModule(__name__, globals()['__file__'], _import_structure)
