Vitaly has an array of *n* distinct integers. Vitaly wants to divide this array into three non-empty sets so as the following conditions hold: 
 1.  The product of all numbers in the first set is less than zero ( &lt; 0). 1.  The product of all numbers in the second set is greater than zero ( &gt; 0). 1.  The product of all numbers in the third set is equal to zero. 1.  Each number from the initial array must occur in exactly one set. 
Help Vitaly. Divide the given array.
The first line of the input contains integer *n* (3 ≤ *n* ≤ 100). The second line contains *n* space-separated distinct integers *a*<sub class="lower-index">1</sub>, *a*<sub class="lower-index">2</sub>, ..., *a*<sub class="lower-index">*n*</sub> (|*a*<sub class="lower-index">*i*</sub>| ≤ 10<sup class="upper-index">3</sup>) — the array elements.
import itertools

leng = input()
leng = int(leng)
arr = input().split(" ")
for i in range(0,leng):
    arr[i] = int(arr[i])

def get_all_subsets(n,s):
    return list(itertools.combinations(s, n))

equal0 = []
equalp = []
equaln =  []
onef = False
twof = False
threef = False
print(set(arr))
i = 1
while i <= len(arr):
    subsets = get_all_subsets(i,set(arr))
    for subset in subsets:
        total = 1
        print(subset)
        for item in subset:
            total = total * item
        if total == 0 and onef == False:
            equal0 = subset
            onef = True
            for it in subset:
                arr.remove(it)
            i = 0
            break
        elif total > 0 and threef == False:
            equalp = subset
            threef = True
            for it in subset:
                arr.remove(it)
            i = 0
            break

        elif total < 0 and twof == False:
            equaln = subset
            twof = True
            for it in subset:
                arr.remove(it)

            i = 0
            break
    
    i+=1   
    if onef == True and twof ==True and threef == True:
        break



print(len(equaln), " ",equaln)
print(len(equalp), " ",equalp)
print(len(equal0), " ",equal0)

    


    
