def max_square(size, grid):
    """Find square (with size side length) with highest power total."""
    grid_size = len(grid)
    max_power, max_coord = 0, None
    for row in range(1, grid_size - size + 1):
        for col in range(1, grid_size - size + 1):
            a = grid[row - 1][col - 1]
            b = grid[row - 1][col + size - 1]
            c = grid[row + size - 1][col - 1]
            d = grid[row + size - 1][col + size - 1]
            power_sum = a + d - b - c
            if power_sum > max_power:
                max_power = power_sum
                max_coord = (col, row)

    return (max_power, (max_coord))