#!/usr/bin/env python3
"""Auto-generated by AGI Loop cycle #1145
Task: </think>

Write a Python function that takes a list of integers and returns the maximum product of any three integers in the list.
Generated: 2026-02-12T21:57:20.505798
"""

def maximum_product_of_three(nums):
    # Sort the list
    nums.sort()
    n = len(nums)
    
    # The maximum product can be either:
    # 1. Product of the three largest numbers
    # 2. Product of the two smallest (possibly negative) and the largest number
    return max(nums[-1] * nums[-2] * nums[-3], nums[0] * nums[1] * nums[-1])

if __name__ == '__main__':
    test_data = [1, 10, 2, 4, 5, 3, -1, -2]
    result = maximum_product_of_three(test_data)
    print("Maximum product of three integers:", result)