def solution(A):
    A.sort()
    return max(A[0] * A[1] * A[-1], A[-1] * A[-2] * A[-3])


print(solution([-3, 1, 2, -2, 5, 6]))

9231bd28a7417f844551ad7c2473695cb0fd3163
<mask token>

def solution(A):
    A.sort()
    return max(A[0] * A[1] * A[-1], A[-1] * A[-2] * A[-3])


<mask token>

def solution(A):
    A.sort()
    return max(A[0] * A[1] * A[-1], A[-1] * A[-2] * A[-3])


print(solution([-3, 1, 2, -2, 5, 6]))
