def find_highest_powered_square(sa_table, n=3):
    """
    Given a serial number, find the n x n square with the highest power level.
    :param sa_table: the summed-area table
    :param n: the dimensions of the square
    :return: the upper left coordinates of the n x n square with maximum power

    >>> find_highest_powered_square(SummedAreaTable(create_power_level_table(18)))
    (29, (33, 45))
    >>> find_highest_powered_square(SummedAreaTable(create_power_level_table(42)))
    (30, (21, 61))
    """
    return max([(sa_table.sum_of(x, y, n, n), (x, y))
                for x in range(sa_table.rows - n + 1)
                for y in range(sa_table.cols - n + 1)])