




'''simple docstring'''



from itertools import permutations







def       _UpperCamelCase			(_lowerCamelCase				:  tuple						)-> bool:




     '''simple docstring'''





     if num[3] % 2 != 0:
          return False

     if (num[2] + num[3] + num[4]) % 3 != 0:
          return False

     if num[5] % 5 != 0:
          return False

     __snake_case            =	[7, 11, 13, 17]
     for i, test in enumerate(_lowerCamelCase						):
          if (num[i + 4] * 1_00 + num[i + 5] * 10 + num[i + 6]) % test != 0:
               return False
     return True







def       _UpperCamelCase			(_lowerCamelCase				:  int = 10						)-> int:




     '''simple docstring'''





     return sum(
         int(''''''.join(map(_lowerCamelCase ,						_lowerCamelCase						)						)						)
         for num in permutations(range(_lowerCamelCase						)						)
         if is_substring_divisible(_lowerCamelCase						)						)


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









'''simple docstring'''



from typing import Optional, Union

import torch
from torch import nn

from ...configuration_utils import ConfigMixin, register_to_config
from ...models.modeling_utils import ModelMixin







class 		lowerCAmelCase__  ( a					,   a   ):



 """simple docstring"""



 @register_to_config
 def __init__(						self   :			int   ,				__SCREAMING_SNAKE_CASE   :			int = 768   ,				)    ->					int:


      """simple docstring"""




      super().__init__()

      __SCREAMING_SNAKE_CASE      = nn.Parameter(torch.zeros(1   ,				__SCREAMING_SNAKE_CASE     )     )
      __SCREAMING_SNAKE_CASE      = nn.Parameter(torch.ones(1   ,				__SCREAMING_SNAKE_CASE     )     )
 def  UpperCAmelCase__						(						self   :			Any   ,				__SCREAMING_SNAKE_CASE   :			Optional[Union[str, torch.device]] = None   ,				__SCREAMING_SNAKE_CASE   :			Optional[torch.dtype] = None   ,				)    ->					List[str]:


      """simple docstring"""




      __SCREAMING_SNAKE_CASE      = nn.Parameter(self.mean.to(__SCREAMING_SNAKE_CASE     ).to(__SCREAMING_SNAKE_CASE     )     )
      __SCREAMING_SNAKE_CASE      = nn.Parameter(self.std.to(__SCREAMING_SNAKE_CASE     ).to(__SCREAMING_SNAKE_CASE     )     )
      return self
 def  UpperCAmelCase__						(						self   :			Optional[Any]   ,				__SCREAMING_SNAKE_CASE   :			Optional[int]     )    ->					Optional[int]:


      """simple docstring"""




      __SCREAMING_SNAKE_CASE      = (embeds - self.mean) * 1.0 / self.std
      return embeds


 def  UpperCAmelCase__						(						self   :			Tuple   ,				__SCREAMING_SNAKE_CASE   :			Any     )    ->					Optional[int]:


      """simple docstring"""




      __SCREAMING_SNAKE_CASE      = (embeds * self.std) + self.mean
      return embeds






