


"""simple docstring"""




from itertools import permutations



def     __a   (	a       ):





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

       _a							 =					[7, 1_1, 1_3, 1_7]
       for i, test in enumerate(_SCREAMING_SNAKE_CASE       ):
              if (num[i + 4] * 1_0_0 + num[i + 5] * 1_0 + num[i + 6]) % test != 0:
                     return False
       return True



def     __a   (	a = 1_0       ):





       """simple docstring"""







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


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







def 				__lowerCAmelCase(       _SCREAMING_SNAKE_CASE							,     _SCREAMING_SNAKE_CASE				)							-> int:




    """simple docstring"""




    return int((input_a, input_a).count(0				) != 0				)





def 				__lowerCAmelCase(       )							-> None:




    """simple docstring"""




    assert nand_gate(0							,     0				) == 1
    assert nand_gate(0							,     1				) == 1
    assert nand_gate(1							,     0				) == 1
    assert nand_gate(1							,     1				) == 0


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





