




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


def 		lowerCamelCase__       (						_A	,      _A	,      _A	,      _A				):







	'''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

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

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

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

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


def 		lowerCamelCase__       (						_A = 9				):







	'''simple docstring'''





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


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






import torch
import torch.nn as nn
from transformers.modeling_utils import ModuleUtilsMixin
from transformers.models.ta.modeling_ta import TaBlock, TaConfig, TaLayerNorm

from ...configuration_utils import ConfigMixin, register_to_config
from ...models import ModelMixin
class 						UpperCAmelCase  (							UpperCAmelCase__			,  UpperCAmelCase__			,  UpperCAmelCase__     ):







						'''simple docstring'''





						@register_to_config
						def __init__(		self				:	Tuple			,      __lowercase				:	int			,      __lowercase				:	int			,      __lowercase				:	int			,      __lowercase				:	float			,      __lowercase				:	int			,      __lowercase				:	int			,      __lowercase				:	int			,      __lowercase				:	int			,      __lowercase				:	str			,      __lowercase				:	bool = False			,      ):






							"""simple docstring"""






							super().__init__()

							snake_case_						       =	nn.Embedding(__lowercase			,      __lowercase		)

							snake_case_						       =	nn.Embedding(__lowercase			,      __lowercase		)
							snake_case_						       =	False

							snake_case_						       =	nn.Dropout(p=__lowercase		)

							snake_case_						       =	TaConfig(
							    vocab_size=__lowercase			,      d_model=__lowercase			,      num_heads=__lowercase			,      d_kv=__lowercase			,      d_ff=__lowercase			,      dropout_rate=__lowercase			,      feed_forward_proj=__lowercase			,      is_decoder=__lowercase			,      is_encoder_decoder=__lowercase			,      )

							snake_case_						       =	nn.ModuleList()
							for lyr_num in range(__lowercase		):
								snake_case_						       =	TaBlock(__lowercase		)
								self.encoders.append(__lowercase		)

							snake_case_						       =	TaLayerNorm(__lowercase		)
							snake_case_						       =	nn.Dropout(p=__lowercase		)






						def 			snake_case__		(		self				:	str			,      __lowercase				:	Dict			,      __lowercase				:	str		):






							"""simple docstring"""






							snake_case_						       =	self.token_embedder(__lowercase		)

							snake_case_						       =	encoder_input_tokens.shape[1]
							snake_case_						       =	torch.arange(__lowercase			,      device=encoder_input_tokens.device		)
							x += self.position_encoding(__lowercase		)

							snake_case_						       =	self.dropout_pre(__lowercase		)

							# inverted the attention mask
							snake_case_						       =	encoder_input_tokens.size()
							snake_case_						       =	self.get_extended_attention_mask(__lowercase			,      __lowercase		)

							for lyr in self.encoders:
								snake_case_						       =	lyr(__lowercase			,      __lowercase		)[0]
							snake_case_						       =	self.layer_norm(__lowercase		)

							return self.dropout_post(__lowercase		), encoder_inputs_mask
