





'''simple docstring'''

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







def  a__    (    lowercase :					int, lowercase :					int, lowercase :					list[int], lowercase :					int				)		->		int:





     """simple docstring"""

     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

          _UpperCamelCase       =	0
          for digit in range(10				):
               _UpperCamelCase       =	digit
               result += reversible_numbers(
                   0, (remainder + 2 * digit) // 10, lowercase, lowercase				)
          return result

     _UpperCamelCase       =	0
     for digita in range(10				):
          _UpperCamelCase       =	digita

          if (remainder + digita) % 2 == 0:
               _UpperCamelCase       =	ODD_DIGITS
          else:
               _UpperCamelCase       =	EVEN_DIGITS

          for digita in other_parity_digits:
               _UpperCamelCase       =	digita
               result += reversible_numbers(
                   remaining_length - 2, (remainder + digita + digita) // 10, lowercase, lowercase, )
     return result







def  a__    (    lowercase :					int = 9				)		->		int:





     """simple docstring"""

     _UpperCamelCase       =	0
     for length in range(1, max_power + 1				):
          result += reversible_numbers(lowercase, 0, [0] * length, lowercase				)
     return result


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










'''simple docstring'''

import unittest

from transformers.utils.backbone_utils import (
    BackboneMixin,
    get_aligned_output_features_output_indices,
    verify_out_features_out_indices,
)
class     __lowerCAmelCase					(   unittest.TestCase			):






       """simple docstring"""





       def snake_case__						(							self       :		Optional[Any]					)   ->					List[str]:

            '''simple docstring'''




            _UpperCamelCase       =	['''a''', '''b''', '''c''']

            # Defaults to last layer if both are None
            _UpperCamelCase   ,    _UpperCamelCase       =	get_aligned_output_features_output_indices(lowerCAmelCase__	,			lowerCAmelCase__	,			lowerCAmelCase__					)
            self.assertEqual(lowerCAmelCase__	,			['''c''']					)
            self.assertEqual(lowerCAmelCase__	,			[2]					)

            # Out indices set to match out features
            _UpperCamelCase   ,    _UpperCamelCase       =	get_aligned_output_features_output_indices(['''a''', '''c''']	,			lowerCAmelCase__	,			lowerCAmelCase__					)
            self.assertEqual(lowerCAmelCase__	,			['''a''', '''c''']					)
            self.assertEqual(lowerCAmelCase__	,			[0, 2]					)

            # Out features set to match out indices
            _UpperCamelCase   ,    _UpperCamelCase       =	get_aligned_output_features_output_indices(lowerCAmelCase__	,			[0, 2]	,			lowerCAmelCase__					)
            self.assertEqual(lowerCAmelCase__	,			['''a''', '''c''']					)
            self.assertEqual(lowerCAmelCase__	,			[0, 2]					)

            # Out features selected from negative indices
            _UpperCamelCase   ,    _UpperCamelCase       =	get_aligned_output_features_output_indices(lowerCAmelCase__	,			[-3, -1]	,			lowerCAmelCase__					)
            self.assertEqual(lowerCAmelCase__	,			['''a''', '''c''']					)
            self.assertEqual(lowerCAmelCase__	,			[-3, -1]					)





       def snake_case__						(							self       :		Any					)   ->					Union[str, Any]:

            '''simple docstring'''




            with self.assertRaises(lowerCAmelCase__					):
                 verify_out_features_out_indices(['''a''', '''b''']	,			(0, 1)	,			lowerCAmelCase__					)

            # Out features must be a list
            with self.assertRaises(lowerCAmelCase__					):
                 verify_out_features_out_indices(('''a''', '''b''')	,			(0, 1)	,			['''a''', '''b''']					)

            # Out features must be a subset of stage names
            with self.assertRaises(lowerCAmelCase__					):
                 verify_out_features_out_indices(['''a''', '''b''']	,			(0, 1)	,			['''a''']					)

            # Out indices must be a list or tuple
            with self.assertRaises(lowerCAmelCase__					):
                 verify_out_features_out_indices(lowerCAmelCase__	,			0	,			['''a''', '''b''']					)

            # Out indices must be a subset of stage names
            with self.assertRaises(lowerCAmelCase__					):
                 verify_out_features_out_indices(lowerCAmelCase__	,			(0, 1)	,			['''a''']					)

            # Out features and out indices must be the same length
            with self.assertRaises(lowerCAmelCase__					):
                 verify_out_features_out_indices(['''a''', '''b''']	,			(0,)	,			['''a''', '''b''', '''c''']					)

            # Out features should match out indices
            with self.assertRaises(lowerCAmelCase__					):
                 verify_out_features_out_indices(['''a''', '''b''']	,			(0, 2)	,			['''a''', '''b''', '''c''']					)

            # Out features and out indices should be in order
            with self.assertRaises(lowerCAmelCase__					):
                 verify_out_features_out_indices(['''b''', '''a''']	,			(0, 1)	,			['''a''', '''b''']					)

            # Check passes with valid inputs
            verify_out_features_out_indices(['''a''', '''b''', '''d''']	,			(0, 1, -1)	,			['''a''', '''b''', '''c''', '''d''']					)







       def snake_case__						(							self       :		Any					)   ->					str:

            '''simple docstring'''




            _UpperCamelCase       =	BackboneMixin()

            _UpperCamelCase       =	['''a''', '''b''', '''c''']
            _UpperCamelCase       =	['''a''', '''c''']
            _UpperCamelCase       =	[0, 2]

            # Check that the output features and indices are set correctly
            self.assertEqual(backbone.out_features	,			['''a''', '''c''']					)
            self.assertEqual(backbone.out_indices	,			[0, 2]					)

            # Check out features and indices are updated correctly
            _UpperCamelCase       =	['''a''', '''b''']
            self.assertEqual(backbone.out_features	,			['''a''', '''b''']					)
            self.assertEqual(backbone.out_indices	,			[0, 1]					)

            _UpperCamelCase       =	[-3, -1]
            self.assertEqual(backbone.out_features	,			['''a''', '''c''']					)
            self.assertEqual(backbone.out_indices	,			[-3, -1]					)



