






import os







def 			A__							(      _a  :					Dict	):





 '''simple docstring'''







 snake_case__  :    int							       =len(grid[0]	)
 snake_case__  :    int							       =len(_a	)

 snake_case__  :    Dict							       =0
 snake_case__  :    Optional[Any]							       =0
 snake_case__  :    List[Any]							       =0

 # Check vertically, horizontally, diagonally at the same time (only works
 # for nxn grid)
 for i in range(_a	):
  for j in range(n_rows - 3	):
   snake_case__  :    Optional[Any]							       =grid[j][i] * grid[j + 1][i] * grid[j + 2][i] * grid[j + 3][i]
   snake_case__  :    int							       =grid[i][j] * grid[i][j + 1] * grid[i][j + 2] * grid[i][j + 3]

   # Left-to-right diagonal (\) product
   if i < n_columns - 3:
    snake_case__  :    Tuple							       =(
        grid[i][j]
        * grid[i + 1][j + 1]
        * grid[i + 2][j + 2]
        * grid[i + 3][j + 3]
    )

   # Right-to-left diagonal(/) product
   if i > 2:
    snake_case__  :    Optional[Any]							       =(
        grid[i][j]
        * grid[i - 1][j + 1]
        * grid[i - 2][j + 2]
        * grid[i - 3][j + 3]
    )

   snake_case__  :    Union[str, Any]							       =max(
       _a		,  _a		,  _a		,  _a	)
   if max_product > largest:
    snake_case__  :    str							       =max_product

 return largest







def 			A__							(      ):





 '''simple docstring'''







 snake_case__  :    List[Any]							       =[]
 with open(os.path.dirname(_a	) + """/grid.txt"""	) as file:
  for line in file:
   grid.append(line.strip("""\n"""	).split(""" """	)	)

 snake_case__  :    Dict							       =[[int(_a	) for i in grid[j]] for j in range(len(_a	)	)]

 return largest_product(_a	)


if __name__ == "__main__":
       print(solution())













from string import ascii_uppercase

__lowerCamelCase	:		List[Any]										=   {str(ord(c) - 55): c for c in ascii_uppercase}







def 			A__							(      _a  :					int		,  _a  :					int	):





 '''simple docstring'''







 if isinstance(_a		,  _a	):
  raise TypeError("""int() can't convert non-string with explicit base"""	)
 if num < 0:
  raise ValueError("""parameter must be positive int"""	)
 if isinstance(_a		,  _a	):
  raise TypeError("""'str' object cannot be interpreted as an integer"""	)
 if isinstance(_a		,  _a	):
  raise TypeError("""'float' object cannot be interpreted as an integer"""	)
 if base in (0, 1):
  raise ValueError("""base must be >= 2"""	)
 if base > 36:
  raise ValueError("""base must be <= 36"""	)
 snake_case__  :    Union[str, Any]							       =""""""
 snake_case__  :    List[str]							       =0
 snake_case__  :    List[Any]							       =0
 while div != 1:
  snake_case__       ,   snake_case__  :    Union[str, Any]							       =divmod(_a		,  _a	)
  if base >= 11 and 9 < mod < 36:
   snake_case__  :    Dict							       =ALPHABET_VALUES[str(_a	)]
  else:
   snake_case__  :    Optional[Any]							       =str(_a	)
  new_value += actual_value
  snake_case__  :    Dict							       =num // base
  snake_case__  :    Tuple							       =div
  if div == 0:
   return str(new_value[::-1]	)
  elif div == 1:
   new_value += str(_a	)
   return str(new_value[::-1]	)

 return new_value[::-1]


if __name__ == "__main__":
       import doctest

       doctest.testmod()

       for base in range(2, 37):
              for num in range(10_00):
                     assert int(decimal_to_any(num, base), base) == num, (
                         num,
                         base,
                         decimal_to_any(num, base),
                         int(decimal_to_any(num, base), base),
                     )





