r = input
n = int(int(r()))
a = []
zero = []
nega = []
normal = []
MaxNega = -10**9
IdMaxNega = -1
cnt = 0
res =""
def Printall(arr):
    str=""
    for i in range(1,len(arr)):
        str+="1 %d %d\n"%(arr[i-1]+1,arr[i]+1)
    return str
for i in r().split():
    t = int(i)
    a.append(t)
    if(t < 0 and MaxNega < t):
        MaxNega = t
        IdMaxNega = cnt
    if(t == 0):
        zero.append(cnt)
    if(t > 0):
        normal.append(cnt)
    if(t < 0):
        nega.append(cnt)
    cnt+=1
if(len(nega) == 0 and len(zero) == 0):
    res += Printall(normal)
elif(len(zero) == 0):
    if(len(nega)&1):
        res+="2 %d\n"%(IdMaxNega+1)
        if(len(nega)>1):
            nega.remove(IdMaxNega)
        else:
            nega = []
        normal = normal+nega
        res+=Printall(normal)
    else:
        normal = normal+nega
        res+=Printall(normal)
elif(len(zero)>0):
    for i in range(1,len(zero)):
        res+="1 %d %d\n"%(zero[i-1]+1,zero[i]+1)
    zero = zero[-1]
    if(len(nega) == 0):
        if(len(normal)>0):
            res+="2 %d\n"%(zero+1)
        res+=Printall(normal)
    if(len(nega)>0):
        if(len(nega)&1):
            if(len(normal)>0):
                res+="1 %d %d\n"%(zero+1,IdMaxNega+1)
                res+="2 %d\n"%(IdMaxNega+1)
            else:
                res+="2 %d\n"%(IdMaxNega+1)
            if(len(nega)>1):
                nega.remove(IdMaxNega)
            else:
                nega = []
            res+=Printall(normal)
        else:
            res+="2 %d\n"%(zero+1)
            normal = normal+nega
            res+=Printall(normal)
print(res)


# -*- coding:utf-8 -*-

"""

created by shuangquan.huang at 11/21/18

"""

N = int(input())
A = [int(x) for x in input().split()]

B = [abs(x) for x in A]

zeros = [i for i in range(N) if A[i] == 0]
positives = [i for i in range(N) if A[i] > 0]
negs = [(abs(A[i]), i) for i in range(N) if A[i] < 0]
idx = []

if len(negs) % 2 == 0:
    if len(zeros) > 1:
        print('\n'.join(['1 {} {}'.format(i+1, zeros[0] + 1) for i in zeros[1:]]))
        if len(zeros) < N:
            print('2 {}'.format(zeros[0] + 1))
    elif len(zeros) == 1:
        print('2 {}'.format(zeros[0] + 1))
    else:
        pass
    idx = [i for v, i in negs] + positives

else:
    negs.sort()
    negs = [i for v, i in negs]

    if len(zeros) > 0:
        print('\n'.join(['1 {} {}'.format(i + 1, zeros[0] + 1) for i in zeros[1:]]))
        print('1 {} {}'.format(zeros[0]+1, negs[0]+1))
        if len(zeros) + 1 < N:
            print('2 {}'.format(negs[0] + 1))
    else:
        print('2 {}'.format(negs[0] + 1))

    idx = positives + negs[1:]

if idx:
    mx = -1
    mxVal = float('-inf')
    for i in idx:
        if B[i] > mxVal:
            mxVal = B[i]
            mx = i

    print('\n'.join(['1 {} {}'.format(u + 1, mx + 1) for u in idx if u != mx]))


# -*- coding:utf-8 -*-

"""

created by shuangquan.huang at 11/21/18

"""

N = int(input())
A = [int(x) for x in input().split()]

B = [abs(x) for x in A]

zeros = [i for i in range(N) if A[i] == 0]
positives = [i for i in range(N) if A[i] > 0]
negs = [(abs(A[i]), i) for i in range(N) if A[i] < 0]
idx = []

if len(negs) % 2 == 0:
    if len(zeros) > 1:
        print('\n'.join(['1 {} {}'.format(i+1, zeros[0] + 1) for i in zeros[1:]]))
        print('2 {}'.format(zeros[0]+1))
    elif len(zeros) == 1:
        print('2 {}'.format(zeros[0] + 1))
    else:
        pass
    idx = [i for v, i in negs] + positives

else:
    if len(zeros) > 0:
        print('\n'.join(['1 {} {}'.format(i+1, zeros[0]+1) for i in range(N) if i != zeros[0]]))
    else:
        negs.sort()
        negs = [i for v, i in negs]
        idx = positives + negs[1:]
        print('2 {}'.format(negs[0] + 1))

if idx:
    mx = -1
    mxVal = float('-inf')
    for i in idx:
        if B[i] > mxVal:
            mxVal = B[i]
            mx = i

    print('\n'.join(['1 {} {}'.format(u + 1, mx + 1) for u in idx if u != mx]))


# -*- coding:utf-8 -*-

"""

created by shuangquan.huang at 11/21/18

"""

N = int(input())
A = [int(x) for x in input().split()]

B = [abs(x) for x in A]

zeros = [i for i in range(N) if A[i] == 0]
positives = [i for i in range(N) if A[i] > 0]
negs = [(abs(A[i]), i) for i in range(N) if A[i] < 0]
idx = []

if len(negs) % 2 == 0:
    if len(zeros) > 1:
        print('\n'.join(['1 {} {}'.format(i+1, zeros[0] + 1) for i in zeros[1:]]))
        if len(zeros) < N:
            print('2 {}'.format(zeros[0] + 1))
    elif len(zeros) == 1:
        print('2 {}'.format(zeros[0] + 1))
    else:
        pass
    idx = [i for v, i in negs] + positives

else:
    negs.sort()
    negs = [i for v, i in negs]

    if len(zeros) > 0:
        print('\n'.join(['1 {} {}'.format(i + 1, zeros[0] + 1) for i in zeros[1:]]))
        print('1 {} {}'.format(zeros[0]+1, negs[0]+1))
        print('2 {}'.format(negs[0] + 1))
    else:
        print('2 {}'.format(negs[0] + 1))

    idx = positives + negs[1:]

if idx:
    mx = -1
    mxVal = float('-inf')
    for i in idx:
        if B[i] > mxVal:
            mxVal = B[i]
            mx = i

    print('\n'.join(['1 {} {}'.format(u + 1, mx + 1) for u in idx if u != mx]))


# -*- coding:utf-8 -*-

"""

created by shuangquan.huang at 11/21/18

"""

N = int(input())
A = [int(x) for x in input().split()]

B = [abs(x) for x in A]

zeros = [i for i in range(N) if A[i] == 0]
positives = [i for i in range(N) if A[i] > 0]
negs = [(abs(A[i]), i) for i in range(N) if A[i] < 0]
idx = []
if len(zeros) > 1:
    print('\n'.join(['1 {} {}'.format(i+1, zeros[0]+1) for i in range(N) if i != zeros[0]]))
    exit(0)
elif len(zeros) == 1:
    if len(negs) % 2 == 0:
        print('2 {}'.format(zeros[0]+1))
        idx = [i for v, i in negs] + positives
    else:
        print('\n'.join(['1 {} {}'.format(i + 1, zeros[0]+1) for i in range(N) if i != zeros[0]]))
        exit(0)

else:
    negs.sort()
    negs = [i for v, i in negs]
    if len(negs) % 2 == 0:
        idx = positives + negs
    else:
        idx = positives + negs[1:]

    print('2 {}'.format(negs[0]+1))

mx = -1
mxVal = float('-inf')
for i in idx:
    if B[i] > mxVal:
        mxVal = B[i]
        mx = i

print('\n'.join(['1 {} {}'.format(u + 1, mx + 1) for u in idx if u != mx]))


# -*- coding:utf-8 -*-

"""

created by shuangquan.huang at 11/21/18

"""

N = int(input())
A = [int(x) for x in input().split()]

B = [abs(x) for x in A]

zeros = [i for i in range(N) if A[i] == 0]
positives = [i for i in range(N) if A[i] > 0]
negs = [(abs(A[i]), i) for i in range(N) if A[i] < 0]
if len(zeros) == N:
    print('\n'.join(['2 {}'.format(i+1) for i in range(N-1)]))
else:
    if zeros:
        print('\n'.join(['2 {}'.format(i + 1) for i in zeros]))
    negs.sort()
    negs = [i for v, i in negs]
    idx = []
    if len(negs) % 2 == 0:
        idx = positives + negs
    else:
        idx = positives + negs[1:]
        print('2 {}'.format(negs[0]+1))

    mx = -1
    mxVal = float('-inf')
    for i in idx:
        if B[i] > mxVal:
            mxVal = B[i]
            mx = i

    print('\n'.join(['1 {} {}'.format(u+1, mx+1) for u in idx if u != mx]))


# -*- coding:utf-8 -*-

"""

created by shuangquan.huang at 11/21/18

"""

N = int(input())
A = [int(x) for x in input().split()]

B = [abs(x) for x in A]

target = -1
v = float('-inf')
negcount = 0
for i in range(N):
    if B[i] > v:
        v = B[i]
        target = i
    elif B[i] == v and A[i] > 0:
        target = i
    if A[i] < 0:
        negcount += 1

if negcount % 2 == 0:
    ans = [(i, target) for i in range(N) if i != target]
    print('\n'.join(['1 {} {}'.format(i, j) for i, j in ans]))
else:
    minVal = float('inf')
    minIdx = -1
    for i in range(N):
        if i != target and A[i] < 0 and B[i] < minVal:
            minVal = B[i]
            minIdx = i
    ans = [(i, target) for i in range(N) if i != target and i != minIdx]
    if ans:
        print('\n'.join(['1 {} {}'.format(i, j) for i, j in ans]))
    print('2 {}'.format(minIdx))


# -*- coding:utf-8 -*-

"""

created by shuangquan.huang at 11/21/18

"""

N = int(input())
A = [int(x) for x in input().split()]

B = [abs(x) for x in A]

zeros = [i for i in range(N) if A[i] == 0]
positives = [i for i in range(N) if A[i] > 0]
negs = [(abs(A[i]), i) for i in range(N) if A[i] < 0]
idx = []

if len(negs) % 2 == 0:
    if len(zeros) > 1:
        print('\n'.join(['1 {} {}'.format(i+1, zeros[0] + 1) for i in zeros[1:]]))
        print('2 {}'.format(zeros[0]+1))
    elif len(zeros) == 1:
        print('2 {}'.format(zeros[0] + 1))
    else:
        pass
    idx = [i for v, i in negs] + positives

else:
    if len(zeros) > 0:
        print('\n'.join(['1 {} {}'.format(i+1, zeros[0]+1) for i in range(N) if i != zeros[0]]))
    else:
        negs.sort()
        negs = [i for v, i in negs]
        idx = positives + negs[1:]
        print('2 {}'.format(negs[0] + 1))

mx = -1
mxVal = float('-inf')
for i in idx:
    if B[i] > mxVal:
        mxVal = B[i]
        mx = i

print('\n'.join(['1 {} {}'.format(u + 1, mx + 1) for u in idx if u != mx]))


# -*- coding:utf-8 -*-

"""

created by shuangquan.huang at 11/21/18

"""

N = int(input())
A = [int(x) for x in input().split()]

B = [abs(x) for x in A]

zeros = [i for i in range(N) if A[i] == 0]
positives = [i for i in range(N) if A[i] > 0]
negs = [(abs(A[i]), i) for i in range(N) if A[i] < 0]
idx = []

if len(negs) % 2 == 0:
    if len(zeros) > 1:
        print('\n'.join(['1 {} {}'.format(i+1, zeros[0] + 1) for i in zeros[1:]]))
        if len(zeros) < N:
            print('2 {}'.format(zeros[0] + 1))
    elif len(zeros) == 1:
        print('2 {}'.format(zeros[0] + 1))
    else:
        pass
    idx = [i for v, i in negs] + positives

else:
    if len(zeros) > 0:
        print('\n'.join(['1 {} {}'.format(i+1, zeros[0]+1) for i in range(N) if i != zeros[0]]))
    else:
        negs.sort()
        negs = [i for v, i in negs]
        idx = positives + negs[1:]
        print('2 {}'.format(negs[0] + 1))

if idx:
    mx = -1
    mxVal = float('-inf')
    for i in idx:
        if B[i] > mxVal:
            mxVal = B[i]
            mx = i

    print('\n'.join(['1 {} {}'.format(u + 1, mx + 1) for u in idx if u != mx]))


n = int(input())
a = list(map(int, input().split()))

commands = []
pending_neg_index = None
pending_zero_index = None
last_used = None

for i in range(n):
    value = a[i]
    if value < 0:
        if pending_neg_index:
            if last_used:
                commands.append(f'1 {last_used} {pending_neg_index}')
            commands.append(f'1 {pending_neg_index} {i+1}')
            pending_neg_index = None
            last_used = i + 1
        else:
            pending_neg_index = i + 1
    elif value == 0:
        if pending_zero_index:
            commands.append(f'1 {pending_zero_index} {i+1}')
        pending_zero_index = i + 1
    else:
        if last_used:
            commands.append(f'1 {last_used} {i+1}')
        last_used = i + 1

if pending_neg_index:
    commands.append(f'2 {pending_neg_index}')
    if pending_zero_index and last_used:
        commands.append(f'1 {last_used} {pending_zero_index}')
else:
    if pending_zero_index:
        commands.append(f'2 {pending_zero_index}')

print('\n'.join(commands))


try:
    n = int(input())
    a = list(map(int, input().split()))

    commands = []
    max_neg_index = None
    neg_count = 0
    last_zero = None
    last_positive = None

    def add_command_1(pos1, pos2):
        commands.append(f'1 {pos1} {pos2}')

    def add_command_2(position):
        commands.append(f'2 {position}')

    for i in range(n):
        value = a[i]
        if value is None:
            continue
        if value < 0:
            neg_count += 1
            if max_neg_index is None or value > a[max_neg_index]:
                max_neg_index = i + 1
        elif value == 0:
            if last_zero:
                add_command_1(last_zero, i+1)
            last_zero = i + 1
        else:
            if last_positive is not None:
                add_command_1(last_positive, i+1)
                a[last_positive-1] = None
            last_positive = i + 1

    if not neg_count % 2:
        max_neg_index = None

    last_negative = None

    for i in range(n):
        value = a[i]
        if value is None or value >= 0:
            continue
        if max_neg_index is not None and i == max_neg_index-1:
            continue

        if last_negative is not None:
            add_command_1(last_negative, i+1)
            value = a[last_negative-1] * value
            a[last_negative-1] = None
        last_negative = i + 1

    if max_neg_index is not None and last_zero is not None:
        add_command_1(max_neg_index, last_zero)
    elif max_neg_index is not None:
        if len(commands) < n-1:
            add_command_2(max_neg_index)

    if last_negative is not None and last_positive is not None:
        add_command_1(last_negative, last_positive)
    if last_zero is not None:
        if len(commands) < n-1:
            add_command_2(last_zero)

    print('\n'.join(commands))
except Exception as exc:
    import traceback
    print(traceback.format_exc())


n = int(input())
a = list(map(int, input().split()))

commands = []
max_neg_index = None
pending_neg_index = None
pending_zero_index = None
neg_count = 0

for i in range(n):
    value = a[i]
    if value < 0:
        neg_count += 1
        if max_neg_index is None or value > a[max_neg_index]:
            max_neg_index = i + 1

if not neg_count % 2:
    max_neg_index = None

last_negative = None
for i in range(n):
    if a[i] >= 0 or (max_neg_index is not None and i == max_neg_index-1):
        continue

    if last_negative is not None:
        commands.append(f'1 {last_negative} {i+1}')
        a[i] = a[last_negative-1] * a[i]
        a[last_negative-1] = None
        last_negative = None
    else:
        last_negative = i + 1

last_used = None
for i in range(n):
    value = a[i]
    if value is None:
        continue
    if value == 0:
        if pending_zero_index is not None:
            commands.append(f'1 {pending_zero_index} {i+1}')
        pending_zero_index = i + 1
    elif value > 0:
        if last_used is not None:
            commands.append(f'1 {last_used} {i+1}')
        last_used = i + 1

if max_neg_index is not None and pending_zero_index is not None:
    commands.append(f'1 {max_neg_index} {pending_zero_index}')
    if len(commands) < n-1:
        commands.append(f'2 {pending_zero_index}')
elif max_neg_index is not None:
    if len(commands) < n-1:
        commands.append(f'2 {max_neg_index}')
elif pending_zero_index is not None:
    if len(commands) < n-1:
        commands.append(f'2 {pending_zero_index}')

print('\n'.join(commands))


n = int(input())
a = list(map(int, input().split()))

commands = []
max_neg_index = None
pending_neg_index = None
pending_zero_index = None
last_used = None
neg_count = 0

for i in range(n):
    value = a[i]
    if value < 0:
        neg_count += 1
        if max_neg_index is None or value > a[max_neg_index]:
            max_neg_index = i + 1

if not neg_count % 2:
    max_neg_index = None

for i in range(n):
    if max_neg_index is not None and i == max_neg_index-1:
        continue
    value = a[i]
    if value == 0:
        if pending_zero_index is not None:
            commands.append(f'1 {pending_zero_index} {i+1}')
        pending_zero_index = i + 1
    elif value < 0:
        if pending_neg_index is not None:
            commands.append(f'1 {pending_neg_index} {i+1}')
            pending_neg_index = None
            if last_used is not None:
                commands.append(f'1 {last_used} {i+1}')
            last_used = i + 1
        else:
            pending_neg_index = i + 1
    else:
        if last_used is not None:
            commands.append(f'1 {last_used} {i+1}')
        last_used = i + 1

if max_neg_index is not None:
    if pending_neg_index is not None:
        commands.append(f'1 {pending_neg_index} {max_neg_index}')
        if last_used is not None:
            commands.append(f'1 {last_used} {max_neg_index}')
            last_used = max_neg_index
    elif pending_zero_index is not None:
        commands.append(f'1 {max_neg_index} {pending_zero_index}')
    else:
        commands.append(f'2 {max_neg_index}')

if pending_zero_index is not None and len(commands) < n-1:
    commands.append(f'2 {pending_zero_index}')

print('\n'.join(commands))


try:
    n = int(input())
    a = list(map(int, input().split()))

    commands = []
    max_neg_index = None
    neg_count = 0
    last_zero = None
    last_positive = None

    def add_command_1(pos1, pos2):
        commands.append(f'1 {pos1} {pos2}')

    def add_command_2(position):
        commands.append(f'2 {position}')

    for i in range(n):
        value = a[i]
        if value is None:
            continue
        if value < 0:
            neg_count += 1
            if max_neg_index is None or value > a[max_neg_index]:
                max_neg_index = i + 1
        elif value == 0:
            if last_zero:
                add_command_1(last_zero, i+1)
            last_zero = i + 1
        else:
            if last_positive is not None:
                add_command_1(last_positive, i+1)
                a[last_positive-1] = None
            last_positive = i + 1

    if not neg_count % 2:
        max_neg_index = None

    last_negative = None

    for i in range(n):
        value = a[i]
        if value is None or value >= 0:
            continue
        if max_neg_index is not None and i == max_neg_index-1:
            continue

        if last_negative is not None:
            add_command_1(last_negative, i+1)
            value = a[last_negative-1] * value
            a[last_negative-1] = None
        last_negative = i + 1

    if max_neg_index is not None and last_zero is not None:
        add_command_1(max_neg_index, last_zero)
    elif max_neg_index is not None:
        if len(commands) < n-1:
            add_command_2(max_neg_index)

    if last_negative is not None and last_positive is not None:
        add_command_1(last_negative, last_positive)
    if last_zero is not None:
        if len(commands) < n-1:
            add_command_2(last_zero)

    print('\n'.join(commands))
except Exception as exc:
    print(exc)


n = int(input())
a = list(map(int, input().split()))

commands = []
pending_neg_index = None
pending_zero_index = None
last_used = None

for i in range(n):
    value = a[i]
    if value < 0:
        if pending_neg_index:
            if last_used:
                commands.append(f'1 {last_used} {pending_neg_index}')
            commands.append(f'1 {pending_neg_index} {i+1}')
            pending_neg_index = None
            last_used = i + 1
        else:
            pending_neg_index = i + 1
    elif value == 0:
        if pending_zero_index:
            commands.append(f'1 {pending_zero_index} {i+1}')
        pending_zero_index = i + 1
    else:
        if last_used:
            commands.append(f'1 {last_used} {i+1}')
        last_used = i + 1

if pending_neg_index:
    commands.append(f'2 {pending_neg_index}')
    if pending_zero_index and last_used:
        commands.append(f'1 {last_used} {pending_zero_index}')
else:
    if pending_zero_index and last_used:
        commands.append(f'2 {pending_zero_index}')

print('\n'.join(commands))


n = int(input())
a = list(map(int, input().split()))

commands = []
max_neg_index = None
neg_count = 0
last_zero = None
last_positive = None

def add_command_1(pos1, pos2):
    commands.append(f'1 {pos1} {pos2}')

def add_command_2(position):
    commands.append(f'2 {position}')

for i in range(n):
    value = a[i]
    if value < 0:
        neg_count += 1
        if max_neg_index is None or value > a[max_neg_index]:
            max_neg_index = i + 1
    elif value == 0:
        if last_zero:
            add_command_1(last_zero, i+1)
        last_zero = i + 1
    else:
        if last_positive is not None:
            add_command_1(last_positive, i+1)
            a[last_positive-1] = None
        last_positive = i + 1

if not neg_count % 2:
    max_neg_index = None

last_negative = None

for i in range(n):
    value = a[i]
    if value is None or value >= 0:
        continue
    if max_neg_index is not None and i == max_neg_index-1:
        continue

    if last_negative is not None:
        add_command_1(last_negative, i+1)
        value = a[last_negative-1] * value
        a[last_negative-1] = None
    last_negative = i + 1

if max_neg_index is not None and last_zero is not None:
    add_command_1(max_neg_index, last_zero)
elif max_neg_index is not None:
    if len(commands) < n-1:
        add_command_2(max_neg_index)

if last_negative is not None and last_positive is not None:
    add_command_1(last_negative, last_positive)
if last_zero is not None:
    if len(commands) < n-1:
        add_command_2(last_zero)

print('\n'.join(commands))


try:
    n = int(input())
    a = list(map(int, input().split()))

    commands = []
    max_neg_index = None
    neg_count = 0
    last_zero = None
    last_positive = None

    def add_command_1(pos1, pos2):
        commands.append(f'1 {pos1} {pos2}')

    def add_command_2(position):
        commands.append(f'2 {position}')

    for i in range(n):
        value = a[i]
        if value < 0:
            neg_count += 1
            if max_neg_index is None or value > a[max_neg_index]:
                max_neg_index = i + 1
        elif value == 0:
            if last_zero:
                add_command_1(last_zero, i+1)
            last_zero = i + 1
        else:
            if last_positive is not None:
                add_command_1(last_positive, i+1)
                a[last_positive-1] = None
            last_positive = i + 1

    if not neg_count % 2:
        max_neg_index = None

    last_negative = None

    for i in range(n):
        value = a[i]
        if value is None or value >= 0:
            continue
        if max_neg_index is not None and i == max_neg_index-1:
            continue

        if last_negative is not None:
            add_command_1(last_negative, i+1)
            value = a[last_negative-1] * value
            a[last_negative-1] = None
        last_negative = i + 1

    if max_neg_index is not None and last_zero is not None:
        add_command_1(max_neg_index, last_zero)
    elif max_neg_index is not None:
        if len(commands) < n-1:
            add_command_2(max_neg_index)

    if last_negative is not None and last_positive is not None:
        add_command_1(last_negative, last_positive)
    if last_zero is not None:
        if len(commands) < n-1:
            add_command_2(last_zero)

    print('\n'.join(commands))
except Exception as exc:
    print(exc)


n = int(input())
a = list(map(int, input().split()))

commands = []
max_neg_index = None
pending_neg_index = None
pending_zero_index = None
last_used = None

for i in range(n):
    value = a[i]
    if value == 0:
        if pending_zero_index:
            commands.append(f'1 {pending_zero_index} {i+1}')
        pending_zero_index = i + 1
    elif value < 0:
        if not max_neg_index or a[max_neg_index-1] < value:
            if pending_neg_index:
                commands.append(f'1 {pending_neg_index} {max_neg_index}')
                pending_neg_index = max_neg_index
            max_neg_index = i + 1
        if pending_neg_index:
            commands.append(f'1 {pending_neg_index} {i+1}')
            pending_neg_index = None
            last_used = i + 1
        else:
            pending_neg_index = i + 1
    else:
        if last_used:
            commands.append(f'1 {last_used} {i+1}')
        last_used = i + 1

if pending_neg_index:
    if pending_neg_index != max_neg_index:
        commands.append(f'1 {max_neg_index} {pending_neg_index}')
        if last_used:
            commands.append(f'1 {last_used} {pending_neg_index}')
            last_used = pending_neg_index
        pending_neg_index = None
        max_neg_index = None
    elif pending_zero_index:
        commands.append(f'1 {max_neg_index} {pending_zero_index}')
    else:
        commands.append(f'2 {max_neg_index}')

if pending_zero_index and len(commands) < n-1:
    commands.append(f'2 {pending_zero_index}')

print('\n'.join(commands))


try:
    n = int(input())
    a = list(map(int, input().split()))

    commands = []
    max_neg_index = None
    neg_count = 0
    last_zero = None
    last_positive = None

    def add_command_1(pos1, pos2):
        commands.append(f'1 {pos1} {pos2}')

    def add_command_2(position):
        commands.append(f'2 {position}')

    for i in range(n):
        value = a[i]
        if value is None:
            continue
        if value < 0:
            neg_count += 1
            if max_neg_index is None or value > a[max_neg_index]:
                max_neg_index = i + 1
        elif value == 0:
            if last_zero:
                add_command_1(last_zero, i+1)
            last_zero = i + 1
        else:
            if last_positive is not None:
                add_command_1(last_positive, i+1)
                a[last_positive-1] = None
            last_positive = i + 1

    if not neg_count % 2:
        max_neg_index = None

    last_negative = None

    for i in range(n):
        value = a[i]
        if value is None or value >= 0:
            continue
        if max_neg_index is not None and i == max_neg_index-1:
            continue

        if last_negative is not None:
            add_command_1(last_negative, i+1)
            value = a[last_negative-1] * value
            a[last_negative-1] = None
        last_negative = i + 1

    if max_neg_index is not None and last_zero is not None:
        add_command_1(max_neg_index, last_zero)
    elif max_neg_index is not None:
        if len(commands) < n-1:
            add_command_2(max_neg_index)

    if last_negative is not None and last_positive is not None:
        add_command_1(last_negative, last_positive)
    if last_zero is not None:
        if len(commands) < n-1:
            add_command_2(last_zero)

    print('\n'.join(commands))
except Exception as exc:
    import traceback
    traceback.print_exc()


try:
    n = int(input())
    a = list(map(int, input().split()))

    commands = []
    max_neg_index = None
    neg_count = 0
    last_zero = None
    last_positive = None

    def add_command_1(pos1, pos2):
        commands.append(f'1 {pos1} {pos2}')

    def add_command_2(position):
        commands.append(f'2 {position}')

    for i in range(n):
        value = a[i]
        if value < 0:
            neg_count += 1
            if max_neg_index is None or value > a[max_neg_index]:
                max_neg_index = i + 1
        elif value == 0:
            if last_zero:
                add_command_1(last_zero, i+1)
            last_zero = i + 1
        else:
            if last_positive is not None:
                add_command_1(last_positive, i+1)
                a[last_positive-1] = None
            last_positive = i + 1

    if not neg_count % 2:
        max_neg_index = None

    last_negative = None

    for i in range(n):
        value = a[i]
        if value is None or value >= 0:
            continue
        if max_neg_index is not None and i == max_neg_index-1:
            continue

        if last_negative is not None:
            add_command_1(last_negative, i+1)
            value = a[last_negative-1] * value
            a[last_negative-1] = None
        last_negative = i + 1

    if max_neg_index is not None and last_zero is not None:
        add_command_1(max_neg_index, last_zero)
    elif max_neg_index is not None:
        if len(commands) < n-1:
            add_command_2(max_neg_index)

    if last_negative is not None and last_positive is not None:
        add_command_1(last_negative, last_positive)
    if last_zero is not None:
        if len(commands) < n-1:
            add_command_2(last_zero)

    print('\n'.join(commands))
except Exception as exc:
    print exc


n = int(input())
a = list(map(int, input().split()))

commands = []
max_neg_index = None
pending_neg_index = None
pending_zero_index = None
last_used = None
neg_count = 0

for i in range(n):
    value = a[i]
    if value < 0:
        neg_count += 1
        if max_neg_index is None or value > a[max_neg_index]:
            max_neg_index = i + 1

if not neg_count % 2:
    max_neg_index = None

for i in range(n):
    if max_neg_index is not None and i == max_neg_index-1:
        continue
    value = a[i]
    if value == 0:
        if pending_zero_index:
            commands.append(f'1 {pending_zero_index} {i+1}')
        pending_zero_index = i + 1
    elif value < 0:
        if pending_neg_index:
            commands.append(f'1 {pending_neg_index} {i+1}')
            pending_neg_index = None
            if last_used:
                commands.append(f'1 {last_used} {i+1}')
                last_used = i + 1
        else:
            pending_neg_index = i + 1
    else:
        if last_used:
            commands.append(f'1 {last_used} {i+1}')
        last_used = i + 1

if max_neg_index:
    if pending_neg_index:
        commands.append(f'1 {pending_neg_index} {max_neg_index}')
        if last_used:
            commands.append(f'1 {last_used} {max_neg_index}')
            last_used = max_neg_index
    elif pending_zero_index:
        commands.append(f'1 {max_neg_index} {pending_zero_index}')
    else:
        commands.append(f'2 {max_neg_index}')

if pending_zero_index and len(commands) < n-1:
    commands.append(f'2 {pending_zero_index}')

print('\n'.join(commands))


try:
    n = int(input())
    a = list(map(int, input().split()))

    commands = []
    max_neg_index = None
    neg_count = 0
    last_zero = None
    last_positive = None

    def add_command_1(pos1, pos2):
        commands.append(f'1 {pos1} {pos2}')

    def add_command_2(position):
        commands.append(f'2 {position}')

    for i in range(n):
        value = a[i]
        if value is None:
            continue
        elif value < 0:
            neg_count += 1
            if max_neg_index is None or value > a[max_neg_index-1]:
                max_neg_index = i + 1
        elif value == 0:
            if last_zero:
                add_command_1(last_zero, i+1)
            last_zero = i + 1
        else:
            if last_positive is not None:
                add_command_1(last_positive, i+1)
                a[last_positive-1] = None
            last_positive = i + 1

    if not neg_count % 2:
        max_neg_index = None

    last_negative = None

    for i in range(n):
        value = a[i]
        if value is None or value >= 0:
            continue
        if max_neg_index is not None and i == max_neg_index-1:
            continue

        if last_negative is not None:
            add_command_1(last_negative, i+1)
            value = a[last_negative-1] * value
            a[last_negative-1] = None
        last_negative = i + 1

    if max_neg_index is not None and last_zero is not None:
        add_command_1(max_neg_index, last_zero)
    elif max_neg_index is not None:
        if len(commands) < n-1:
            add_command_2(max_neg_index)

    if last_negative is not None and last_positive is not None:
        add_command_1(last_negative, last_positive)
    if last_zero is not None:
        if len(commands) < n-1:
            add_command_2(last_zero)

    print('\n'.join(commands))
except Exception as exc:
    import traceback
    print(traceback.format_exc())


n = int(input())
a = list(map(int, input().split()))

commands = []
max_neg_index = None
neg_count = 0
last_zero = None
last_positive = None

def add_command_1(pos1, pos2):
    commands.append(f'1 {pos1} {pos2}')

def add_command_2(position):
    commands.append(f'2 {position}')

for i in range(n):
    value = a[i]
    if value < 0:
        neg_count += 1
        if max_neg_index is None or value > a[max_neg_index]:
            max_neg_index = i + 1
    elif value == 0:
        if last_zero:
            add_command_1(last_zero, i+1)
        last_zero = i + 1
    else:
        if last_positive is not None:
            add_command_1(last_positive, i+1)
            a[last_positive-1] = None
        last_positive = i + 1

if not neg_count % 2:
    max_neg_index = None

last_negative = None

for i in range(n):
    value = a[i]
    if value is None or value >= 0:
        continue
    if max_neg_index is not None and i == max_neg_index-1:
        continue

    if last_negative is not None:
        add_command_1(last_negative, i+1)
        value = a[last_negative-1] * value
        a[last_negative-1] = None
        last_negative = None
    else:
        last_negative = i + 1

if last_negative is not None and max_neg_index is not None:
    add_command_1(max_neg_index, last_negative)
    if last_positive is not None:
        add_command_1(last_negative, last_positive)
    last_positive = last_negative = max_neg_index = None
elif last_negative is not None and last_zero is not None:
    add_command_1(last_negative, last_zero)
    last_negative = None
elif last_negative is not None:
    add_command_2(last_negative)
    last_negative = None
elif max_neg_index is not None:
    if len(commands) < n-1:
        add_command_2(max_neg_index)

if last_zero is not None:
    if len(commands) < n-1:
        add_command_2(last_zero)

print('\n'.join(commands))


n = int(input())
a = list(map(int, input().split()))

commands = []
max_neg_index = None
neg_count = 0
last_zero = None
last_positive = None

def add_command_1(pos1, pos2):
    commands.append(f'1 {pos1} {pos2}')

def add_command_2(position):
    commands.append(f'2 {position}')

for i in range(n):
    value = a[i]
    if value is None:
        continue
    elif value < 0:
        neg_count += 1
        if max_neg_index is None or value > a[max_neg_index-1]:
            max_neg_index = i + 1
    elif value == 0:
        if last_zero:
            add_command_1(last_zero, i+1)
        last_zero = i + 1
    else:
        if last_positive is not None:
            add_command_1(last_positive, i+1)
            a[last_positive-1] = None
        last_positive = i + 1

if not neg_count % 2:
    max_neg_index = None

last_negative = None

for i in range(n):
    value = a[i]
    if value is None or value >= 0:
        continue
    if max_neg_index is not None and i == max_neg_index-1:
        continue

    if last_negative is not None:
        add_command_1(last_negative, i+1)
        value = a[last_negative-1] * value
        a[last_negative-1] = None
    last_negative = i + 1

if max_neg_index is not None and last_zero is not None:
    add_command_1(max_neg_index, last_zero)
elif max_neg_index is not None:
    if len(commands) < n-1:
        add_command_2(max_neg_index)

if last_negative is not None and last_positive is not None:
    add_command_1(last_negative, last_positive)
if last_zero is not None:
    if len(commands) < n-1:
        add_command_2(last_zero)

print('\n'.join(commands))


from bisect import bisect

def main():
    input()
    l = sorted((a, i) for i, a in enumerate(map(int, input().split()), 1))
    i, j = bisect(l, (0, -1)), bisect(l, (1, -1))
    l = [i for _, i in l]
    nn, zz, pp = l[:i], l[i:j], l[j:]
    r, t = [], 0
    if zz:
        t = zz.pop()
        for a in zz:
            r.append(f'1 {a} {t}')
    if len(nn) & 1:
        if t:
            r.append(f'1 {nn.pop()} {t}')
        else:
            t = nn.pop()
    nn+=pp
    if nn:
        if t:
            r.append(f'2 {t}')
        t = nn.pop()
        for a in nn:
            r.append(f'1 {a} {t}')
    print('\n'.join(r))

if __name__ == '__main__':
    main()


n=int(input())
arr=list(map(int,input().split()))

nc=0
zc=0
for i in arr:
	if i<0:
		nc+=1
	elif i==0:
		zc+=1

nc=nc%2
if (nc==1):
	nu=-float('inf')
	ind=-1
	for i in range(n):
		if arr[i]<0 and arr[i]>nu:
			nu=arr[i]
			ind=i
	if zc==0:
		#remove the largest negative
		print(2,(ind+1))
		if ind!=0:
			for i in range(1,n):
				if i!=ind:
					print(1,i+1,1)
		else:
			for i in range(2,n):
				if i!=ind:
					print(1,(i+1),2)

	else:
		#multiply all zeroes with the largest negative remove it
		cnt=0
		for i in range(n):
			if arr[i]==0:
				cnt+=1
				print(1,i+1,ind+1)
		if(cnt<(n-1)):
			print(2,ind+1)
		sp=-1
		for i in range(n):
			if arr[i]!=0 and i!=ind:
				sp=i
				break
		if sp!=-1:
			for i in range(n):
				if arr[i]!=0 and i!=ind and i!=sp:
					print(1,i+1,sp+1)
else:
	if zc!=0:
		#multiply all zeroes with themselves and remove
		ind=-1
		cnt=0
		for i in range(n):
			if arr[i]==0:
				ind=i
				break
		for i in range(n):
			if arr[i]==0 and i!=ind:
				cnt+=1
				print(1,i+1,ind+1)
		if(cnt<(n-1)):
			print(2,ind+1)
		sp=-1
		for i in range(n):
			if arr[i]!=0:
				sp=i
				break
		if sp!=-1:
			for i in range(n):
				if arr[i]!=0 and i!=sp:
					print(1,i+1,sp+1)
	else:
		#multipy all
		for i in range(1,n):
			print(1,i+1,1)


import sys
f=sys.stdin
out=sys.stdout

n=int(f.readline().rstrip('\r\n'))
arr=list(map(int,f.readline().rstrip('\r\n').split()))

nc=0
zc=0
for i in arr:
	if i<0:
		nc+=1
	elif i==0:
		zc+=1

nc=nc%2
if (nc==1):
	nu=-float('inf')
	ind=-1
	for i in range(n):
		if arr[i]<0 and arr[i]>nu:
			nu=arr[i]
			ind=i
	if zc==0:
		#remove the largest negative
		out.write("2 "+str(ind+1)+"\n")
		if ind!=0:
			for i in range(1,n):
				if i!=ind:
					out.write("1 "+str(i+1)+" 1\n")
		else:
			for i in range(2,n):
				if i!=ind:
					out.write("1 "+str(i+1)+" 2\n")

	else:
		#multiply all zeroes with the largest negative remove it
		cnt=0
		for i in range(n):
			if arr[i]==0:
				cnt+=1
				out.write("1 "+str(i+1)+" "+str(ind+1)+"\n")
		if(cnt<(n-1)):
			out.write("2 "+str(ind+1)+"\n")
		sp=-1
		for i in range(n):
			if arr[i]!=0 and i!=ind:
				sp=i
				break
		if sp!=-1:
			for i in range(n):
				if arr[i]!=0 and i!=ind and i!=sp:
					out.write("1 "+str(i+1)+" "+str(sp+1)+"\n")
else:
	if zc!=0:
		#multiply all zeroes with themselves and remove
		ind=-1
		cnt=0
		for i in range(n):
			if arr[i]==0:
				ind=i
				break
		for i in range(n):
			if arr[i]==0 and i!=ind:
				cnt+=1
				out.write("1 "+str(i+1)+" "+str(ind+1)+"\n")
		if(cnt<(n-1)):
			out.write("2 "+str(ind+1)+"\n")
		sp=-1
		for i in range(n):
			if arr[i]!=0:
				sp=i
				break
		if sp!=-1:
			for i in range(n):
				if arr[i]!=0 and i!=sp:
					out.write("1 "+str(i+1)+" "+str(sp+1)+"\n")
	else:
		#multipy all
		for i in range(1,n):
			out.write("1 "+str(i+1)+" 1\n")


import sys
f=sys.stdin

n=int(f.readline())
arr=list(map(int,f.readline().split()))

nc=0
zc=0
for i in arr:
	if i<0:
		nc+=1
	elif i==0:
		zc+=1

nc=nc%2
if (nc==1):
	nu=-float('inf')
	ind=-1
	for i in range(n):
		if arr[i]<0 and arr[i]>nu:
			nu=arr[i]
			ind=i
	if zc==0:
		#remove the largest negative
		print(2,(ind+1))
		if ind!=0:
			for i in range(1,n):
				if i!=ind:
					print(1,i+1,1)
		else:
			for i in range(2,n):
				if i!=ind:
					print(1,(i+1),2)

	else:
		#multiply all zeroes with the largest negative remove it
		cnt=0
		for i in range(n):
			if arr[i]==0:
				cnt+=1
				print(1,i+1,ind+1)
		if(cnt<(n-1)):
			print(2,ind+1)
		sp=-1
		for i in range(n):
			if arr[i]!=0 and i!=ind:
				sp=i
				break
		if sp!=-1:
			for i in range(n):
				if arr[i]!=0 and i!=ind and i!=sp:
					print(1,i+1,sp+1)
else:
	if zc!=0:
		#multiply all zeroes with themselves and remove
		ind=-1
		cnt=0
		for i in range(n):
			if arr[i]==0:
				ind=i
				break
		for i in range(n):
			if arr[i]==0 and i!=ind:
				cnt+=1
				print(1,i+1,ind+1)
		if(cnt<(n-1)):
			print(2,ind+1)
		sp=-1
		for i in range(n):
			if arr[i]!=0:
				sp=i
				break
		if sp!=-1:
			for i in range(n):
				if arr[i]!=0 and i!=sp:
					print(1,i+1,sp+1)
	else:
		#multipy all
		for i in range(1,n):
			print(1,i+1,1)


def main():
    n = int(input())
    l = list(map(int, input().split()))
    z = l.count(0)
    neg = sum(a < 0 for a in l) & 1
    if not (z or neg) or z > 1 or z and neg:
        res = [f'1 {i} 1' for i in range(2, n + 1)]
    elif z and not neg:
        if l[0]:
            res = [f'1 {i} 1' for i in range(2, n + 1)]
            i = l.index(0)
            res[i-1] = f'2 {i+1}'
        else:
            res = [f'1 {i} 2' for i in range(3, n + 1)]
            res.append('2 1')
    else:  # neg
        i = max([i for i in range(n) if l[i] < 0], key=l.__getitem__)
        res = [f'1 {i} 1' for i in range(n, 1, -1)] if i else [f'1 {i} 2' for i in range(2, n + 1)]
        res[i] = f'2 {i+1}'
    print('\n'.join(res))

if __name__ == '__main__':
    main()


from bisect import bisect

def main():
    input()
    l = sorted((a, i) for i, a in enumerate(map(int, input().split()), 1))
    i, j = bisect(l, (0, -1)), bisect(l, (1, -1))
    l = [i for _, i in l]
    nn, zz, pp = l[:i], l[i:j], l[j:]
    r, t = [], 0
    if zz:
        t = zz.pop()
        for a in zz:
            r.append(f'1 {a} {t}')
    if len(nn) & 1:
        if t:
            r.append(f'1 {nn.pop()} {t}')
        else:
            t = nn.pop()
    if t:
        r.append(f'2 {t}')
    t = (nn or pp).pop()
    for l in nn, pp:
        for a in l:
            r.append(f'1 {a} {t}')
    print('\n'.join(r))

if __name__ == '__main__':
    main()


n = gets.to_i
a = gets.split.map(&:to_i)
used = Array.new(n+1,false)
z = []
p = 0
pre = 0
mx = [-1000000010,0]
for i in 0..n-1
  if a[i] == 0
    z.push(i+1)
    next
  end
  if a[i] < 0
    p = 1-p
    if mx[0] < a[i]
      mx = [a[i],i+1]
    end
  end
end
z.push(mx[1]) if p == 1
for i in 0..z.size-2
  puts "1 #{z[i]} #{z[i+1]}"
  used[z[i]-1] = true
end
if (z.size != 0 && z.size != n)
  puts "2 #{z[-1]}"
  used[z[-1]-1] = true
end
for i in 0..n-1
  next if used[i]
  if pre != 0
    puts "1 #{pre} #{i+1}"
  end
  pre = i+1
end


import sys
n = int(raw_input())
inp = map(int, raw_input().split())
z = []
neg = []
pos = []
min_neg_index = None
for i in range(n):
  if inp[i] == 0:
    z.append(i)
  elif inp[i] < 0:
    neg.append(i)
    if not min_neg_index or abs(neg[-1]) < abs(inp[min_neg_index]):
      min_neg_index = i
  else:
    pos.append(i)

if len(neg) % 2 == 1:
  # odd neg, delete the min one
  neg.remove(min_neg_index)
  z.append(min_neg_index)
z.sort()

m = len(z)
for i in range(m-1):
  print "1 %d %d" % (z[i] + 1, z[i+1] + 1)
if m == n:
  sys.exit(0)
if z:
  print "2 %d" % (z[-1] + 1)

last_neg = None
last_pos = None
if neg:
  m = len(neg)
  z = neg
  for i in range(m-1):
    print "1 %d %d" % (z[i] + 1, z[i+1] + 1)
  last_neg = z[-1] + 1

if pos:
  m = len(pos)
  z = pos
  for i in range(m-1):
    print "1 %d %d" % (z[i] + 1, z[i+1] + 1)
  last_pos = z[-1] + 1

if last_neg and last_pos:
  print "1 %d %d" % (last_neg, last_pos)


import sys
n = int(raw_input())
inp = map(int, raw_input().split())
z = []
neg = []
pos = []
min_neg_index = None
for i in range(n):
  if inp[i] == 0:
    z.append(i)
  elif inp[i] < 0:
    neg.append(i)
    if not min_neg_index or abs(neg[-1]) < abs(inp[min_neg_index]):
      min_neg_index = i
  else:
    pos.append(i)

if len(neg) % 2 == 1:
  # odd neg, delete the min one
  neg.remove(min_neg_index)
  z.append(min_neg_index)

m = len(z)
for i in range(m-1):
  print "1 %d %d" % (z[i] + 1, z[i+1] + 1)
if m == n:
  sys.exit(0)
if z:
  print "2 %d" % (z[-1] + 1)

last_neg = None
if neg:
  m = len(neg)
  z = neg
  for i in range(m-1):
    print "1 %d %d" % (z[i] + 1, z[i+1] + 1)
  last_neg = z[-1]

m = len(pos)
z = pos
for i in range(m-1):
  print "1 %d %d" % (z[i] + 1, z[i+1] + 1)
last_pos = z[-1]

if last_neg:
  print "1 %d %d" % (last_neg, last_pos)


import sys
n = int(raw_input())
inp = map(int, raw_input().split())
z = []
neg = []
pos = []
min_neg_index = None
for i in range(n):
  if inp[i] == 0:
    z.append(i)
  elif inp[i] < 0:
    neg.append(i)
    if not min_neg_index or abs(neg[-1]) < abs(inp[min_neg_index]):
      min_neg_index = i
  else:
    pos.append(i)

if len(neg) % 2 == 1:
  # odd neg, delete the min one
  neg.remove(min_neg_index)
  z.append(min_neg_index)

m = len(z)
for i in range(m-1):
  print "1 %d %d" % (z[i] + 1, z[i+1] + 1)
if m == n:
  sys.exit(0)
if z:
  print "2 %d" % (z[-1] + 1)

last_neg = None
last_pos = None
if neg:
  m = len(neg)
  z = neg
  for i in range(m-1):
    print "1 %d %d" % (z[i] + 1, z[i+1] + 1)
  last_neg = z[-1] + 1

if pos:
  m = len(pos)
  z = pos
  for i in range(m-1):
    print "1 %d %d" % (z[i] + 1, z[i+1] + 1)
  last_pos = z[-1] + 1

if last_neg and last_pos:
  print "1 %d %d" % (last_neg, last_pos)


import sys
n = int(raw_input())
inp = map(int, raw_input().split())
z = []
neg = []
pos = []
min_neg_index = None
for i in range(n):
  if inp[i] == 0:
    z.append(i)
  elif inp[i] < 0:
    neg.append(i)
    if not min_neg_index or abs(inp[i]) < abs(inp[min_neg_index]):
      min_neg_index = i
  else:
    pos.append(i)

if len(neg) % 2 == 1:
  # odd neg, delete the min one
  neg.remove(min_neg_index)
  z.append(min_neg_index)
z.sort()

m = len(z)
for i in range(m-1):
  print "1 %d %d" % (z[i] + 1, z[i+1] + 1)
if m == n:
  sys.exit(0)
if z:
  print "2 %d" % (z[-1] + 1)

last_neg = None
last_pos = None
if neg:
  m = len(neg)
  z = neg
  for i in range(m-1):
    print "1 %d %d" % (z[i] + 1, z[i+1] + 1)
  last_neg = z[-1] + 1

if pos:
  m = len(pos)
  z = pos
  for i in range(m-1):
    print "1 %d %d" % (z[i] + 1, z[i+1] + 1)
  last_pos = z[-1] + 1

if last_neg and last_pos:
  print "1 %d %d" % (last_neg, last_pos)


import sys
n = int(raw_input())
inp = map(int, raw_input().split())
z = []
neg = []
pos = []
min_neg_index = None
for i in range(n):
  if inp[i] == 0:
    z.append(i)
  elif inp[i] < 0:
    neg.append(i)
    if not min_neg_index or abs(neg[-1]) < abs(inp[min_neg_index]):
      min_neg_index = i
  else:
    pos.append(i)

if len(neg) % 2 == 1:
  # odd neg, delete the min one
  neg.remove(min_neg_index)
  z.append(min_neg_index)

m = len(z)
for i in range(m-1):
  print "1 %d %d" % (z[i] + 1, z[i+1] + 1)
if m == n:
  sys.exit(0)
if z:
  print "2 %d" % (z[-1] + 1)

last_neg = None
if neg:
  m = len(neg)
  z = neg
  for i in range(m-1):
    print "1 %d %d" % (z[i] + 1, z[i+1] + 1)
  last_neg = z[-1] + 1

m = len(pos)
z = pos
for i in range(m-1):
  print "1 %d %d" % (z[i] + 1, z[i+1] + 1)
last_pos = z[-1] + 1

if last_neg:
  print "1 %d %d" % (last_neg, last_pos)


import sys
n = input()
a = map(int, raw_input().split())

negCnt = 0
for x in a:
    if x < 0:
        negCnt+=1

if negCnt %2:
    ind = max(filter(lambda x: a[x] < 0, range(n)), key=lambda x: a[x])
    a[ind] = 0

zeros = filter(lambda x: a[x]==0, range(n))

if len(zeros):
    mxi = zeros[-1]
    for z in zeros[:-1]:
        print 1, z+1, mxi+1
    if len(zeros) < n:
        print 2, mxi+1

nz = filter(lambda x: a[x]!=0, range(n))
if len(nz):
    mxi = nz[-1]
    for z in nz[:-1]:
        print 1, z+1, mxi+1


n = int(raw_input())
a = map(int, raw_input().split())
mn = min(a)
mx = max(a)

if mn == mx and a[0] == 0:
  for i in range(n - 1):
    print "1", i + 1, n
  exit(0)

if mn < 0 and mx == 0:
  cnt = 0
  for it in a:
    if it < 0:
      cnt += 1
      if cnt > 1:
        break
  if cnt == 1:
    pz = 0 if a[0] == 0 else 1
    for i in range(n):
      if i != pz:
        print "1", i + 1, pz + 1
    exit(0)

last = n - 1
while a[last] == 0:
  last -= 1

lastZero = -1
for i in range(n):
  if a[i] == 0:
    lastZero = i

cnt = 0
for i in range(last + 1):
  if a[i] < 0:
    cnt += 1

if cnt % 2 == 0:
  for i in range(n):
    if i == lastZero:
      continue
    if a[i] == 0:
      print "1", i + 1, lastZero + 1
    elif i != last:
      print "1", i + 1, last + 1
  if lastZero != -1:
    print "2", lastZero + 1
  exit(0)

mn = -1
for i in range(last + 1):
  if a[i] >= 0:
    continue
  if mn == -1 or abs(a[mn]) > abs(a[i]):
    mn = i

if mn == last:
  last -= 1
  while a[last] == 0:
    last -= 1

for i in range(last):
  if i == mn:
    continue
  if a[i] == 0:
    print "1", i + 1, mn + 1
  else:
    print "1", i + 1, last + 1

for i in range(last + 1, n):
  if i != mn:
    print "1", i + 1, mn + 1

print "2", mn + 1


n = int(raw_input())
a = map(int, raw_input().split())
mn = min(a)
mx = max(a)

if mn == mx and a[0] == 0:
  for i in range(n - 1):
    print "1", i + 1, n
  exit(0)

if mn < 0 and mx == 0:
  cnt = 0
  for it in a:
    if it < 0:
      cnt += 1
      if cnt > 1:
        break
  if cnt == 1:
    pz = 0 if a[0] == 0 else 1
    for i in range(n):
      if i != pz:
        print "1", i + 1, pz + 1
    exit(0)

last = n - 1
while a[last] == 0:
  last -= 1

lastZero = -1
for i in range(n):
  if a[i] == 0:
    lastZero = i

cnt = 0
for i in range(last + 1):
  if a[i] < 0:
    cnt += 1

if cnt % 2 == 0:
  for i in range(n):
    if i == lastZero:
      continue
    if a[i] == 0:
      print "1", i + 1, lastZero + 1
    elif i != last:
      print "1", i + 1, last + 1
  if lastZero != -1:
    print "2", lastZero + 1
  exit(0)

mn = -1
for i in range(last + 1):
  if a[i] >= 0:
    continue
  if mn == -1 or abs(a[mn]) > abs(a[i]):
    mn = i

if mn == last:
  last -= 1
  while a[last] == 0:
    last -= 1

for i in range(last):
  if a[i] == 0:
    print "1", i + 1, mn + 1
  else:
    print "1", i + 1, last + 1

for i in range(last + 1, n):
  if i != mn:
    print "1", i + 1, mn + 1

print "2", mn + 1


n = int(raw_input())
x = raw_input()
num = map(int,x.split(' '))

neg = 0
smallNegativeIndex = -1
smallNegative = -10000000000
trashIndex = -1
for i in range(len(num)):
    o = num[i]
    if o < 0:
        neg += 1
        if o > smallNegative:
            smallNegative = o
            smallNegativeIndex = i
    if o == 0:
        trashIndex = i

if smallNegativeIndex != -1 and neg % 2 == 1:
    trashIndex = smallNegativeIndex

lastFeasible = -1
writt = 0
for i in range(len(num)):
    if i == trashIndex:
        continue
    o = num[i]
    if o == 0:
        print "1 {0} {1}".format(i+1,trashIndex+1)
        writt += 1
        continue
    if lastFeasible == -1:
        lastFeasible=i
        continue
    print "1 {0} {1}".format(lastFeasible+1,i+1)
    writt += 1
    lastFeasible = i
if trashIndex != -1 and writt < n-1:
    print "2 {0}".format(trashIndex+1)


n = int(raw_input())
nums = list(map(int,raw_input().split()))
z = []
cnt = 0
cur = 0
ind = 0
for i in range(n):
    if nums[i]==0:
        z.append(i)
    elif nums[i]<0:
        if nums[i]<cur:
            cur = nums[i]
            ind = i
        cnt += 1
ans = []
if cnt%2:
    if z:
        ans.append([1,ind,z[0]])
    else:
        ans.append([2,ind])
for i in range(len(z)-1):
    ans.append([1,z[i],z[i+1]])
if z:
    ans.append([2,z[-1]])
li = []
for i in range(n):
    if nums[i]:
        if nums[i]>0:
            li.append(i)
            continue
        if cnt%2 and i==ind:
            continue
        li.append(i)
for i in range(len(li)-1):
    ans.append([1,li[i],li[i+1]])
for i in ans:
    if i[0]==1:
        i[1] += 1
        i[2] += 1
        print i[0],i[1],i[2]
    else:
        i[1] += 1
        print i[0],i[1]


n = int(raw_input())
nums = list(map(int,raw_input().split()))
z = []
cnt = 0
cur = -pow(10,10)
ind = 0
for i in range(n):
    if nums[i]==0:
        z.append(i)
    elif nums[i]<0:
        if nums[i]>cur:
            cur = nums[i]
            ind = i
        cnt += 1
ans = []
if cnt%2:
    if z:
        ans.append([1,ind,z[0]])
    else:
        ans.append([2,ind])
for i in range(len(z)-1):
    ans.append([1,z[i],z[i+1]])
if z and len(ans)<n-1:
    ans.append([2,z[-1]])
li = []
for i in range(n):
    if nums[i]:
        if nums[i]>0:
            li.append(i)
            continue
        if cnt%2 and i==ind:
            continue
        li.append(i)
for i in range(len(li)-1):
    ans.append([1,li[i],li[i+1]])
for i in ans:
    if i[0]==1:
        i[1] += 1
        i[2] += 1
        print i[0],i[1],i[2]
    else:
        i[1] += 1
        print i[0],i[1]


n = int(raw_input())
nums = list(map(int,raw_input().split()))
z = []
cnt = 0
cur = 0
ind = 0
for i in range(n):
    if nums[i]==0:
        z.append(i)
    elif nums[i]<0:
        if nums[i]<cur:
            cur = nums[i]
            ind = i
        cnt += 1
ans = []
if cnt%2:
    if z:
        ans.append([1,ind,z[0]])
    else:
        ans.append([2,ind])
for i in range(len(z)-1):
    ans.append([1,z[i],z[i+1]])
if z and len(ans)<n-1:
    ans.append([2,z[-1]])
li = []
for i in range(n):
    if nums[i]:
        if nums[i]>0:
            li.append(i)
            continue
        if cnt%2 and i==ind:
            continue
        li.append(i)
for i in range(len(li)-1):
    ans.append([1,li[i],li[i+1]])
for i in ans:
    if i[0]==1:
        i[1] += 1
        i[2] += 1
        print i[0],i[1],i[2]
    else:
        i[1] += 1
        print i[0],i[1]


n = int(raw_input())
nums = list(map(int,raw_input().split()))
z = []
cnt = 0
cur = 0
ind = 0
for i in range(n):
    if nums[i]==0:
        z.append(i)
    elif nums[i]<0:
        if nums[i]<cur:
            cur = nums[i]
            ind = i
        cnt += 1
ans = []
if cnt%2:
    if z:
        ans.append([1,ind,z[0]])
for i in range(len(z)-1):
    ans.append([1,z[i],z[i+1]])
if z:
    ans.append([2,z[-1]])
li = []
for i in range(n):
    if nums[i]:
        if nums[i]>0:
            li.append(i)
            continue
        if cnt%2 and i==ind:
            continue
        li.append(i)
for i in range(len(li)-1):
    ans.append([1,li[i],li[i+1]])
for i in ans:
    if i[0]==1:
        i[1] += 1
        i[2] += 1
        print i[0],i[1],i[2]
    else:
        i[1] += 1
        print i[0],i[1]


n = int(raw_input())
nums = list(map(int,raw_input().split()))
z = []
cnt = 0
cur = 0
ind = 0
for i in range(n):
    if nums[i]==0:
        z.append(i)
    elif nums[i]<0:
        if nums[i]<cur:
            cur = nums[i]
            ind = i
        cnt += 1
ans = []
for i in range(len(z)-1):
    ans.append([1,z[i],z[i+1]])
if cnt%2:
    if z:
        ans.append([1,z[-1],ind])
    ans.append([2,ind])
else:
    if z:
        ans.append([2,z[-1]])
li = []
for i in range(n):
    if nums[i]:
        if nums[i]>0:
            li.append(i)
            continue
        if cnt%2 and i==ind:
            continue
        li.append(i)
for i in range(len(li)-1):
    ans.append([1,li[i],li[i+1]])
for i in ans:
    if i[0]==1:
        i[1] += 1
        i[2] += 1
        print i[0],i[1],i[2]
    else:
        i[1] += 1
        print i[0],i[1]


from sys import stdin,stdout
ne = int(stdin.readline())
a  = map(int,stdin.readline().split())
p = []
n = []
z = []
for i in range(ne):
    if(a[i] > 0):
        p.append((a[i],i+1))
    elif(a[i] < 0):
        n.append((a[i],i+1))
    else:
        z.append((a[i],i+1))

steps = []
lastp = 0
if(len(p)):
    prev = p[0][1]
    lastp = prev
    for i in range(1,len(p)):
        steps.append("1 "+str(prev) + " " + str(p[i][1]))
        prev = p[i][1]
        lastp = prev

lastz = 0
if(len(z)):
    prev = z[0][1]
    lastz = prev
    for i in range(1,len(z)):
        steps.append("1 "+str(prev)+ " " + str(z[i][1]))
        prev = z[i][1]
        lastz = prev

n.sort()

if(len(n)%2 == 0):
    if(len(n)):
        prev = n[0][1]
        for i in range(1,len(n)):
            steps.append("1 "+str(prev)+ " " +  str(n[i][1]))
            prev = n[i][1]
        if(len(p)):
            steps.append("1 " + str(prev) + " " + str(lastp))
            if(len(z)):
                 steps.append("2 " + str(lastz))
        else:
            if(len(z)):
                 steps.append("2 " + str(lastz))

else:
    if(len(n)):
        prev = n[0][1]
        for i in range(1,len(n)-1):
            steps.append("1 "+str(prev)+ " " + str(n[i][1]))
            prev = n[i][1]
        if(len(p) and len(n)!=1):
            steps.append("1 " + str(prev) + " " + str(lastp))
        if(len(z)):
            steps.append("1 " + str(n[-1][1]) + " " + str(lastz))
            if(len(p)):
                steps.append("2 " + str(lastz))
            elif(len(n)!=1):
                steps.append("2 " + str(lastz))
        else:
            steps.append("2 " + str(n[-1][1]))

stdout.write("\n".join(steps))


from sys import stdin,stdout
ne = int(stdin.readline())
a  = map(int,stdin.readline().split())
p = []
n = []
z = []
for i in range(ne):
    if(a[i] > 0):
        p.append((a[i],i+1))
    elif(a[i] < 0):
        n.append((a[i],i+1))
    else:
        z.append((a[i],i+1))

steps = []
lastp = 0
if(len(p)):
    prev = p[0][1]
    lastp = prev
    for i in range(1,len(p)):
        steps.append("1 "+str(prev) + " " + str(p[i][1]))
        prev = p[i][1]
        lastp = prev

lastz = 0
if(len(z)):
    prev = z[0][1]
    lastz = prev
    for i in range(1,len(z)):
        steps.append("1 "+str(prev)+ " " + str(z[i][1]))
        prev = z[i][1]
        lastz = prev

n.sort()

if(len(n)%2 == 0):
    if(len(n)):
        prev = n[0][1]
        for i in range(1,len(n)):
            steps.append("1 "+str(prev)+ " " +  str(n[i][1]))
            prev = n[i][1]
        if(len(p)):
            steps.append("1 " + str(prev) + " " + str(lastp))

else:
    if(len(n)):
        prev = n[0][1]
        for i in range(1,len(n)-1):
            steps.append("1 "+str(prev)+ " " + str(n[i][1]))
            prev = n[i][1]
        if(len(p) and len(n)!=1):
            steps.append("1 " + str(prev) + " " + str(lastp))
        if(len(z)):
            steps.append("1 " + str(n[-1][1]) + " " + str(lastz))
        else:
            steps.append("2 " + str(n[-1][1]))

if(len(z) and len(p)>=1):
    steps.append("2 " + str(lastz))
elif(len(z) and len(n)%2==0 and len(n)!= 0):
    steps.append("2 " + str(lastz))
stdout.write("\n".join(steps))


from sys import stdin,stdout
ne = int(stdin.readline())
a  = map(int,stdin.readline().split())
p = []
n = []
z = []
for i in range(ne):
    if(a[i] > 0):
        p.append((a[i],i+1))
    elif(a[i] < 0):
        n.append((a[i],i+1))
    else:
        z.append((a[i],i+1))

steps = []
lastp = 0
if(len(p)):
    prev = p[0][1]
    lastp = prev
    for i in range(1,len(p)):
        steps.append("1 "+str(prev) + " " + str(p[i][1]))
        prev = p[i][1]
        lastp = prev

lastz = 0
if(len(z)):
    prev = z[0][1]
    lastz = prev
    for i in range(1,len(z)):
        steps.append("1 "+str(prev)+ " " + str(z[i][1]))
        prev = z[i][1]
        lastz = prev

n.sort()

if(len(n)%2 == 0):
    if(len(n)):
        prev = n[0][1]
        for i in range(1,len(n)):
            steps.append("1 "+str(prev)+ " " +  str(n[i][1]))
            prev = n[i][1]
        if(len(p)):
            steps.append("1 " + str(prev) + " " + str(lastp))
            if(len(z)):
                steps.append("2 " + str(lastz))
        else:
            if(len(z)):
                steps.append("2 " + str(lastz))
    else:
        if(len(z)):
            steps.append("2 " + str(lastz))

else:
    if(len(n)):
        prev = n[0][1]
        for i in range(1,len(n)-1):
            steps.append("1 "+str(prev)+ " " + str(n[i][1]))
            prev = n[i][1]
        if(len(p) and len(n)!=1):
            steps.append("1 " + str(prev) + " " + str(lastp))
        if(len(z)):
            steps.append("1 " + str(n[-1][1]) + " " + str(lastz))
            if(len(p)):
                steps.append("2 " + str(lastz))
            elif(len(n)!=1):
                steps.append("2 " + str(lastz))
        else:
            steps.append("2 " + str(n[-1][1]))

stdout.write("\n".join(steps))


from sys import stdin,stdout
ne = int(stdin.readline())
a  = map(int,stdin.readline().split())
p = []
n = []
z = []
for i in range(ne):
    if(a[i] > 0):
        p.append((a[i],i+1))
    elif(a[i] < 0):
        n.append((a[i],i+1))
    else:
        z.append((a[i],i+1))

steps = []
lastp = 0
if(len(p)):
    prev = p[0][1]
    lastp = prev
    for i in range(1,len(p)):
        steps.append("1 "+str(prev) + " " + str(p[i][1]))
        prev = p[i][1]
        lastp = prev

lastz = 0
if(len(z)):
    prev = z[0][1]
    lastz = prev
    for i in range(1,len(z)):
        steps.append("1 "+str(prev)+ " " + str(z[i][1]))
        prev = z[i][1]
        lastz = prev

n.sort()

if(len(n)%2 == 0):
    if(len(n)):
        prev = n[0][1]
        for i in range(1,len(n)):
            steps.append("1 "+str(prev)+ " " +  str(n[i][1]))
            prev = n[i][1]
        if(len(p)):
            steps.append("1 " + str(prev) + " " + str(lastp))

else:
    if(len(n)):
        prev = n[0][1]
        for i in range(1,len(n)-1):
            steps.append("1 "+str(prev)+ " " + str(n[i][1]))
            prev = n[i][1]
        if(len(p) and len(n)!=1):
            steps.append("1 " + str(prev) + " " + str(lastp))
        if(len(z)):
            steps.append("1 " + str(n[-1][1]) + " " + str(lastz))
        else:
            steps.append("2 " + str(n[-1][1]))

if(len(z) and len(p)>=1):
    steps.append("2 " + str(lastz))
elif(len(z) and len(n)%2==0):
    steps.append("2 " + str(lastz))
stdout.write("\n".join(steps))


from sys import stdin,stdout
ne = int(stdin.readline())
a  = map(int,stdin.readline().split())
p = []
n = []
z = []
for i in range(ne):
    if(a[i] > 0):
        p.append((a[i],i+1))
    elif(a[i] < 0):
        n.append((a[i],i+1))
    else:
        z.append((a[i],i+1))

steps = []
lastp = 0
if(len(p)):
    prev = p[0][1]
    lastp = prev
    for i in range(1,len(p)):
        steps.append("1 "+str(prev) + " " + str(p[i][1]))
        prev = p[i][1]
        lastp = prev

lastz = 0
if(len(z)):
    prev = z[0][1]
    lastz = prev
    for i in range(1,len(z)):
        steps.append("1 "+str(prev)+ " " + str(z[i][1]))
        prev = z[i][1]
        lastz = prev

n.sort()

if(len(n)%2 == 0):
    if(len(n)):
        prev = n[0][1]
        for i in range(1,len(n)):
            steps.append("1 "+str(prev)+ " " +  str(n[i][1]))
            prev = n[i][1]
        if(len(p)):
            steps.append("1 " + str(prev) + " " + str(lastp))
            if(len(z)):
                steps.append("2 " + str(lastz))
        else:
            if(len(z)):
                steps.append("2 " + str(lastz))
    else:
        if(len(p) and len(z)):
            steps.append("2 " + str(lastz))

else:
    if(len(n)):
        prev = n[0][1]
        for i in range(1,len(n)-1):
            steps.append("1 "+str(prev)+ " " + str(n[i][1]))
            prev = n[i][1]
        if(len(p) and len(n)!=1):
            steps.append("1 " + str(prev) + " " + str(lastp))
        if(len(z)):
            steps.append("1 " + str(n[-1][1]) + " " + str(lastz))
            if(len(p)):
                steps.append("2 " + str(lastz))
            elif(len(n)!=1):
                steps.append("2 " + str(lastz))
        else:
            steps.append("2 " + str(n[-1][1]))

stdout.write("\n".join(steps))


from sys import stdin,stdout
ne = int(stdin.readline())
a  = map(int,stdin.readline().split())
p = []
n = []
z = []
for i in range(ne):
    if(a[i] > 0):
        p.append((a[i],i+1))
    elif(a[i] < 0):
        n.append((a[i],i+1))
    else:
        z.append((a[i],i+1))

steps = []
lastp = 0
if(len(p)):
    prev = p[0][1]
    lastp = prev
    for i in range(1,len(p)):
        steps.append("1 "+str(prev) + " " + str(p[i][1]))
        prev = p[i][1]
        lastp = prev

lastz = 0
if(len(z)):
    prev = z[0][1]
    lastz = prev
    for i in range(1,len(z)):
        steps.append("1 "+str(prev)+ " " + str(z[i][1]))
        prev = z[i][1]
        lastz = prev

n.sort()

if(len(n)%2 == 0):
    if(len(n)):
        prev = n[0][1]
        for i in range(1,len(n)):
            steps.append("1 "+str(prev)+ " " +  str(n[i][1]))
            prev = n[i][1]
        if(len(p)):
            steps.append("1 " + str(prev) + " " + str(lastp))

else:
    if(len(n)):
        prev = n[0][1]
        for i in range(1,len(n)-1):
            steps.append("1 "+str(prev)+ " " + str(n[i][1]))
            prev = n[i][1]
        if(len(p) and len(n)!=1):
            steps.append("1 " + str(prev) + " " + str(lastp))
        if(len(z)):
            steps.append("1 " + str(n[-1][1]) + " " + str(lastz))
        else:
            steps.append("2 " + str(n[-1][1]))

if(len(z) and len(p)>=1):
    steps.append("2 " + str(lastz))

stdout.write("\n".join(steps))


from sys import stdin,stdout
ne = int(stdin.readline())
a  = map(int,stdin.readline().split())
p = []
n = []
z = []
for i in range(ne):
    if(a[i] > 0):
        p.append((a[i],i+1))
    elif(a[i] < 0):
        n.append((a[i],i+1))
    else:
        z.append((a[i],i+1))

steps = []
lastp = 0
if(len(p)):
    prev = p[0][1]
    lastp = prev
    for i in range(1,len(p)):
        steps.append("1 "+str(prev) + " " + str(p[i][1]))
        prev = p[i][1]
        lastp = prev

lastz = 0
if(len(z)):
    prev = z[0][1]
    lastz = prev
    for i in range(1,len(z)):
        steps.append("1 "+str(prev)+ " " + str(z[i][1]))
        prev = z[i][1]
        lastz = prev

n.sort()

if(len(n)%2 == 0):
    if(len(n)):
        prev = n[0][1]
        for i in range(1,len(n)):
            steps.append("1 "+str(prev)+ " " +  str(n[i][1]))
            prev = n[i][1]
        if(len(p)):
            steps.append("1 " + str(prev) + " " + str(lastp))

else:
    if(len(n)):
        prev = n[0][1]
        for i in range(1,len(n)-1):
            steps.append("1 "+str(prev)+ " " + str(n[i][1]))
            prev = n[i][1]
        if(len(p) and len(n)!=1):
            steps.append("1 " + str(prev) + " " + str(lastp))
        if(len(z)):
            steps.append("1 " + str(n[-1][1]) + " " + str(lastz))
        else:
            steps.append("2 " + str(n[-1][1]))

if(len(z) and len(p)>=1):
    steps.append("2" + str(lastz))

stdout.write("\n".join(steps))


/*
* create by Van Linh
*/

#include <stdio.h>
#include <stdint.h>

uint32_t n;
int32_t a[200000];

int main(void) {
	int32_t i, j, min = 0, pmin = -1, nneg = 0, pos, all;
	// read
	scanf("%d", &n);
	for(i = 0; i < n; i++) {
		scanf("%d", a+i);
		if(a[i] < 0) {
			nneg++;
			if(min == 0 || a[i] > min) {
				min = a[i];
				pmin = i;
			}
		}
	}
	// process
	pos = 0; all = 0;
	// delete max am
	if(nneg % 2 != 0) {
		j = pmin;
		// bo tu dau
		for(i = 0; i < n; i++) {
			if(i != j && a[i] != 0)
				break;
		}
		if(i < n-1) {
			pos = i;
			for(i++; i < n; i++) {
				if(a[i] == 0) {
					if(i < j)
						printf("1 %d %d\n", i+1, j+1);
					else {
						printf("1 %d %d\n", j+1, i+1);
						j = i;
					}
				}
			}
			printf("2 %d\n", j+1);
		} else
			all = 1;
	} else {
		j = -1;
		// bo tu dau
		for(i = 0; i < n; i++) {
			if(a[i] == 0) {
				if(j < 0)
					j = i;
			} else if(j > 0) {
				pos = i;
				break;
			}
		}
		if(j >= 0 && i < n-1) {
			for(i=j+1; i < n; i++) {
				if(a[i] == 0) {
					if(i < j)
						printf("1 %d %d\n", i+1, j+1);
					else {
						printf("1 %d %d\n", j+1, i+1);
						j = i;
					}
				}
			}
			printf("2 %d\n", j+1);
		} else
			all = 1;
	}
	for(i = pos+1; i < n; i++) {
		if(all || a[i] != 0 && (nneg % 2 == 0 || i != pmin)) {
			printf("1 %d %d\n", pos+1, i+1);
			pos = i;
		}
	}
	return 0;
}


/*
* create by Van Linh
*/

#include <stdio.h>
#include <stdint.h>

uint32_t n;
int32_t a[200000];

int main(void) {
	int32_t i, j, min = 0, pmin = -1, nneg = 0, pos, numb;
	// read
	scanf("%d", &n);
	for(i = 0; i < n; i++) {
		scanf("%d", a+i);
		if(a[i] < 0) {
			nneg++;
			if(min == 0 || a[i] > min) {
				min = a[i];
				pmin = i;
			}
		}
	}
	// process
	pos = -1; numb = 0;
	// delete max am
	if(nneg % 2 != 0) {
		j = pmin;
		for(i = 0; i < n; i++) {
			if(i != j) {
				if(a[i] == 0) {
					if(i < j)
						printf("1 %d %d\n", i+1, j+1);
					else {
						printf("1 %d %d\n", j+1, i+1);
						j = i;
					}
					numb++;
				} else if(pos < 0)
					pos = i;
				}
			}
		}
		if(numb < n-1)
			printf("2 %d\n", j+1);
	} else {
		j = -1;
		// bo tu dau
		for(i = 0; i < n; i++) {
			if(a[i] == 0) {
				j = i;
				break;
			} else if(pos < 0)
				pos = i;
		}
		if(j >= 0) {
			for(i=i+1; i < n; i++) {
				if(a[i] == 0) {
					numb++;
					if(i < j)
						printf("1 %d %d\n", i+1, j+1);
					else {
						printf("1 %d %d\n", j+1, i+1);
						j = i;
					}
				} else if(pos < 0)
					pos = i;
			}
			if(numb < n-1)
				printf("2 %d\n", j+1);
		}
	}
	if(numb < n -1) {
		for(i = pos+1; i < n; i++) {
			if(a[i] != 0 && (nneg % 2 == 0 || i != pmin)) {
				printf("1 %d %d\n", pos+1, i+1);
				if(++numb == n-1)
					break;
				pos = i;
			}
		}
	}
	return 0;
}


import sys
t=int(input())

for _ in range(t):
    n=int(input())
    for bit in range(9):
        a=[]
        b=[]
        max_dist=0
        for i in range(n):
            if (i>>bit)%2:
                a.append(i)
            else:
                b.append(i)
        #l=[len(a),len(b)]+a+b
        #out=" ".join(map(str,l))
        #print(out+"\n")
        print(len(a), len(b), *(a+b))
        sys.stdout.flush()
        d=int(input())
        if d==-1:
            exit()
        if d>max_dist:
            max_dist=d
    print(-1, max_dist)


t=int(input())
n=int(input())

a=list(range(1,n+1))

for _ in range(1):
    l=[]
    p=n//2
    q=n-p
    l.append(p)
    l.append(q)
    print(l)
    l+=a[:p+1]
    l+=a[q:]
    print(" ".join(map(str,l)))
    print(input())


import sys

t=int(input())

max_dist=99*100+1  # exceeds max allowed 100

for _ in range(t):
    n=int(input())
    for bit in range(9):
        a=[]
        b=[]
        for i in range(n):
            if (i>>bit)%2:
                a.append(i)
            else:
                b.append(i)
        l=[len(a),len(b)]+a+b
        out=" ".join(map(str,l))
        print(out)
        sys.stdout.flush()
        d=int(input())
        id d==-1:
            exit()
        if d>max_dist:
            max_dist=d

    print(-1, max_dist)


import sys
t=int(input())

for _ in range(t):
    n=int(input())
    max_dist=0
    for bit in range(7):
        a=[]
        b=[]
        for i in range(1,n+1):
            if (i>>bit)&1:
                a.append(i)
            else:
                b.append(i)
        #l=[len(a),len(b)]+a+b
        #out=" ".join(map(str,l))
        #print(out+"\n")
        print(len(a), len(b), *(a+b))
        sys.stdout.flush()
        d=int(input())
        if d>max_dist:
            max_dist=d
    print(-1, max_dist)


import sys
t=int(input())

for _ in range(t):
    n=int(input())
    max_dist=0
    for bit in range(9):
        a=[]
        b=[]
        for i in range(1,n+1):
            if (i>>bit)&1:
                a.append(i)
            else:
                b.append(i)

        if len(a)==0 or len(b)==0:
            continue

        l=[len(a),len(b)]+a+b
        out=" ".join(map(str,l))
        print(out+"\n")

        #print(len(a), len(b), *(a+b))
        sys.stdout.flush()
        d=int(input())
        if d>max_dist:
            max_dist=d
    print("-1 "str(max_dist))


import sys

t=int(input())

a=list(range(1,n+1))
max_dist=101  # exceeds max allowed 100

for _ in range(t):
    n=int(input())
    for bit in range(9):
        a=[]
        b=[]
        for i in range(n):
            if (i>>bit)%2:
                a.append(i)
            else:
                b.append(i)
        l=[len(a),len(b)]+a+b
        out=" ".join(map(str,l))
        print(out+"\n")
        sys.stdout.flush()
        d=int(input())
        if d>max_dist:
            max_dist=d

    print("-1 "+str(max_dist))


import sys
t=int(input())

for _ in range(t):
    n=int(input())
    max_dist=0
    for bit in range(7):
        a=[]
        b=[]
        for i in range(1,n+1):
            if (i>>bit)%2:
                a.append(i)
            else:
                b.append(i)

        if len(a)==0 or len(b)==0:
            continue

        l=[len(a),len(b)]+a+b
        out=" ".join(map(str,l))
        print(out+"\n")

        #print(len(a), len(b), *(a+b))
        sys.stdout.flush()
        d=int(input())
        if d>max_dist:
            max_dist=d
    print("-1 "+str(max_dist))


import sys
t=int(input())

for _ in range(t):
    n=int(input())
    max_dist=0
    for bit in range(9):
        a=[]
        b=[]
        for i in range(1,n+1):
            if (i>>bit)%2:
                a.append(i)
            else:
                b.append(i)

        if len(a)==0 or len(b)==0:
            continue

        l=[len(a),len(b)]+a+b
        out=" ".join(map(str,l))
        print(out+"\n")

        #print(len(a), len(b), *(a+b))
        sys.stdout.flush()
        d=int(input())
        if d>max_dist:
            max_dist=d
    print("-1 "+str(max_dist))


import sys
t=int(input())

for _ in range(t):
    n=int(input())
    for bit in range(9):
        a=[]
        b=[]
        max_dist=0
        for i in range(n):
            if (i>>bit)%2:
                a.append(i)
            else:
                b.append(i)
        l=[len(a),len(b)]+a+b
        out=" ".join(map(str,l))
        print(out+"\n")
        sys.stdout.flush()
        d=int(input())
        if d==-1:
            exit()
        if d>max_dist:
            max_dist=d

    print(-1, max_dist)


import sys
t=int(input())

for _ in range(t):
    n=int(input())
    max_dist=0
    for bit in range(9):
        a=[]
        b=[]
        for i in range(n):
            if (i>>bit)&1:
                a.append(i)
            else:
                b.append(i)
        #l=[len(a),len(b)]+a+b
        #out=" ".join(map(str,l))
        #print(out+"\n")
        print(len(a), len(b), *(a+b))
        sys.stdout.flush()
        d=int(input())
        if d==-1:
            exit()
        if d>max_dist:
            max_dist=d
    print(-1, max_dist)


import sys
t = int(input())
for _ in range(t):
  n = int(input())
  k = 1
  m = 0
  while k < n:
    a = [i+1 for i in range(n) if i & k]
    b = [i+1 for i in range(n) if not i & k]
    print(len(a), len(b), *(a+b))
    sys.stdout.flush()
    r = int(input())
    if r == -1:
      exit()
    m = max(r, m)
    k <<= 1
  print(-1, m)


import sys

t=int(input())
n=int(input())

a=list(range(1,n+1))
max_dist=101  # exceeds max allowed 100

def query(A,B):
    l=[]
    n=B-A+1
    k1=n//2
    k2=n-k1
    p=(A+B)//2
    l.append(k1)
    l.append(k2)
    l+=a[A:p+1]
    l+=a[p+1:B+1]
    print(" ".join(map(str,l)))
    sys.stdout.flush()
    return int(input())

A,B=1,100
max_dist=query(A,B)
for _ in range(1):
    B1=(A+B)//2
    max_dist1=query(A,B1)
    A2=B1+1
    max_dist2=query(A2,B)
    if max_dist2>max_dist1:
        if max_dist2>max_dist:
            max_dist=max_dist2
            A=A2
        else:
            break
    else:
        if max_dist1>max_dist:
            max_dist=max_dist1
            B=B1
        else:
            break

print("-1 "+str(max_dist))
sys.stdout.flush()


import sys

t=int(input())

max_dist=0  # exceeds max allowed 100

for _ in range(t):
    n=int(input())
    for bit in range(9):
        a=[]
        b=[]
        for i in range(n):
            if (i>>bit)%2:
                a.append(i)
            else:
                b.append(i)
        l=[len(a),len(b)]+a+b
        out=" ".join(map(str,l))
        print(out)
        sys.stdout.flush()
        d=int(input())
        if d==-1:
            exit()
        if d>max_dist:
            max_dist=d

    print(-1, max_dist)


import sys
t=int(input())

for _ in range(t):
    n=int(input())
    max_dist=0
    for bit in range(9):
        a=[]
        b=[]
        for i in range(1,n+1):
            if (i>>bit)&1:
                a.append(i)
            else:
                b.append(i)
        #l=[len(a),len(b)]+a+b
        #out=" ".join(map(str,l))
        #print(out+"\n")
        if len(a)==0 or len(b)==0:
            continue

        print(len(a), len(b), *(a+b))
        sys.stdout.flush()
        d=int(input())
        if d>max_dist:
            max_dist=d
    print(-1, max_dist)


import sys

t=int(input())

max_dist=101  # exceeds max allowed 100

for _ in range(t):
    n=int(input())
    for bit in range(9):
        a=[]
        b=[]
        for i in range(n):
            if (i>>bit)%2:
                a.append(i)
            else:
                b.append(i)
        l=[len(a),len(b)]+a+b
        out=" ".join(map(str,l))
        print(out)
        sys.stdout.flush()
        d=int(input())
        if d>max_dist:
            max_dist=d

    print("-1 "+str(max_dist))


import sys

t=int(input())
n=int(input())

a=list(range(1,n+1))
max_dist=101  # exceeds max allowed 100

for bit in range(9):
    a=[]
    b=[]
    for i in range(n):
        if (i>>bit)%2:
            a.append(i)
        else:
            b.append(i)
    l=[len(a),len(b)]+a+b
    out=" ".join(map(str,l))
    print(out+"\n")
    sys.stdout.flush()
    d=int(input())
    if d>max_dist:
        max_dist=d

print("-1 "+str(max_dist))


import sys

t=int(input())

a=list(range(1,n+1))
max_dist=101  # exceeds max allowed 100

for _ in range(t):
    n=int(input())
    for bit in range(9):
        a=[]
        b=[]
        for i in range(n):
            if (i>>bit)%2:
                a.append(i)
            else:
                b.append(i)
        l=[len(a),len(b)]+a+b
        out=" ".join(map(str,l))
        print(out)
        sys.stdout.flush()
        d=int(input())
        if d>max_dist:
            max_dist=d

    print("-1 "+str(max_dist))


import sys

t=int(input())

max_dist=99*100+1  # exceeds max allowed 100

for _ in range(t):
    n=int(input())
    for bit in range(9):
        a=[]
        b=[]
        for i in range(n):
            if (i>>bit)%2:
                a.append(i)
            else:
                b.append(i)
        l=[len(a),len(b)]+a+b
        out=" ".join(map(str,l))
        print(out)
        sys.stdout.flush()
        d=int(input())
        if d==-1:
            exit()
        if d>max_dist:
            max_dist=d

    print(-1, max_dist)


import sys
t=int(input())

for _ in range(t):
    n=int(input())
    for bit in range(9):
        a=[]
        b=[]
        max_dist=0
        for i in range(n):
            if (i>>bit)&1:
                a.append(i)
            else:
                b.append(i)
        #l=[len(a),len(b)]+a+b
        #out=" ".join(map(str,l))
        #print(out+"\n")
        print(len(a), len(b), *(a+b))
        sys.stdout.flush()
        d=int(input())
        if d==-1:
            exit()
        if d>max_dist:
            max_dist=d
    print(-1, max_dist)


import sys

t=int(input())

max_dist=0  # exceeds max allowed 100

for _ in range(t):
    n=int(input())
    for bit in range(9):
        a=[]
        b=[]
        for i in range(n):
            if (i>>bit)%2:
                a.append(i)
            else:
                b.append(i)
        l=[len(a),len(b)]+a+b
        out=" ".join(map(str,l))
        print(out+"\n")
        sys.stdout.flush()
        d=int(input())
        if d==-1:
            exit()
        if d>max_dist:
            max_dist=d

    print(-1, max_dist)


from sys import stdout
for i in range(int(input())):
    n = int(input())
    stdout.flush()
    l = 1
    r = n
    ans = 0
    while l < r:
        print((r - l + 1) // 2, (r - l + 2) // 2, *[i for i in range(l, r + 1)])
        stdout.flush()
        a = int(input())
        stdout.flush()
        b = int(input())
        stdout.flush()
        if a < b:
            l = (r + l - 1) // 2
        else:
            r = (r + l + 1) // 2
        ans = max(ans, a, b)
    print(-1, ans)
    stdout.flush()


from sys import stdout
from math import log2, floor
for i in range(int(input())):
    n = int(input())
    stdout.flush()
    ans = 0
    q = floor(log2(n))
    while q:
        k = 2 ** q
        q1 = []
        q2 = []
        for i in range(n):
            if ((i + 1) // k) % 2:
                q1.append(i + 1)
            else:
                q2.append(i + 1)
        print(len(q1), len(q2), *q1, *q2)
        stdout.flush()
        a = int(input())
        stdout.flush()
        ans = max(ans, a)
        q -= 1
    print(-1, ans)
    stdout.flush()


from sys import stdout
from math import log2
for i in range(int(input())):
    n = int(input())
    stdout.flush()
    ans = 0
    q = int(log2(n))
    while q != -1:
        k = 2 ** q
        q1 = []
        q2 = []
        for i in range(n):
            if ((i + 1) // k) % 2:
                q1.append(i + 1)
            else:
                q2.append(i + 1)
        print(len(q1), len(q2), *q1, *q2)
        stdout.flush()
        a = int(input())
        stdout.flush()
        ans = max(ans, a)
        q -= 1
    print(-1, ans)
    stdout.flush()


from sys import stdout
from math import log2, floor
for i in range(int(input())):
    n = int(input())
    stdout.flush()
    ans = 0
    k = floor(log2(n))
    while k:
        q1 = []
        q2 = []
        for i in range(n):
            if (i + 1) // k % 2:
                q1.append(i + 1)
            else:
                q2.append(i + 1)
        print(len(q1), len(q2), *q1, *q2)
        stdout.flush()
        a = int(input())
        stdout.flush()
        ans = max(ans, a)
        k -= 1
    print(-1, ans)
    stdout.flush()


from sys import stdout
from math import log2, floor
for i in range(int(input())):
    n = int(input())
    stdout.flush()
    ans = 0
    k = floor(log2(n))
    while k:
        q1 = []
        q2 = []
        for i in range(n):
            if ((i + 1) % k) % 2:
                q1.append(i + 1)
            else:
                q2.append(i + 1)
        print(len(q1), len(q2), *q1, *q2)
        stdout.flush()
        a = int(input())
        stdout.flush()
        ans = max(ans, a)
        k -= 1
    print(-1, ans)
    stdout.flush()


from sys import stdout
for i in range(int(input())):
    n = int(input())
    l = 1
    r = n
    ans = 0
    while l < r:
        print((r - l + 1) // 2, (r - l + 2) // 2, *[i for i in range(l, r + 1)])
        stdout.flush()
        a = int(input())
        b = int(input())
        stdout.flush()
        if a > b:
            l = (r + l) // 2
        else:
            r = (r + l) // 2
        ans = max(ans, a, b)
    print(-1, ans)
    stdout.flush()


from sys import stdout
from math import log2, floor
for i in range(int(input())):
    n = int(input())
    stdout.flush()
    ans = 0
    k = floor(log2(n))
    while k:
        q1 = []
        q2 = []
        for i in range(n):
            if (i + 1) // k % 2:
                q1.append(i + 1)
            else:
                q2.append(i + 1)
        print(len(q1), len(q2), *q1, *q2)
        stdout.flush()
        a = int(input())
        stdout.flush()
        ans = max(ans, a)
    print(-1, ans)
    stdout.flush()


#!/usr/bin/env python
from __future__ import division, print_function

import os
import sys
from io import BytesIO, IOBase

import _random

if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip
else:
    from builtins import str as __str__

    str = lambda x=b"": x if type(x) is bytes else __str__(x).encode()

BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._buffer = BytesIO()
        self._fd = file.fileno()
        self._writable = "x" in file.mode or "r" not in file.mode
        self.write = self._buffer.write if self._writable else None

    def read(self):
        if self._buffer.tell():
            return self._buffer.read()
        return os.read(self._fd, os.fstat(self._fd).st_size)

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self._buffer.tell()
            self._buffer.seek(0, 2), self._buffer.write(b), self._buffer.seek(ptr)
        self.newlines -= 1
        return self._buffer.readline()

    def flush(self):
        if self._writable:
            os.write(self._fd, self._buffer.getvalue())
            self._buffer.truncate(0), self._buffer.seek(0)

sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
input = lambda: sys.stdin.readline().rstrip(b"\r\n")

def print(*args, **kwargs):
    sep, file = kwargs.pop("sep", b" "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", b"\n"))
    if kwargs.pop("flush", False):
        file.flush()

class Random(_random.Random):
    def shuffle(self, x):
        for i in range(len(x) - 1, 0, -1):
            j = int(self.random() * (i + 1))
            x[i], x[j] = x[j], x[i]

    randrange = lambda self, a, b, step=1: a + step * int(
        self.random() * ((b - a + step + [1, -1][step < 0]) // step)
    )
    randint = lambda self, a, b: a + int(self.random() * (b - a + 1))
    choice = lambda self, seq: seq[int(self.random() * len(seq))]

random = Random()

def main():
    t = int(input())
    for _ in range(t):
        n = int(input())

        res = 0
        for _ in range(9):
            a = random.shuffle(list(range(1, n + 1)))
            b, c = a[: n // 2], a[n // 2 :]
            print(len(b), len(c), *b, *c, flush=True)
            res = max(res, int(input()))
        print(-1, res)

if __name__ == "__main__":
    main()


for _ in range(int(input())):
    n = int(input())
    print(n - 1, 1, *range(1, n + 1), flush=True)
    d = input()

    lo, hi = 1, n - 1
    while lo < hi:
        mi = lo + (hi - lo) // 2
        print(mi, 1, *range(1, mi + 1), n, flush=True)
        if input() == d:
            hi = mi
        else:
            lo = mi + 1

    print(1, n - 1, lo, *(set(range(1, n + 1)) - {lo}), flush=True)
    print(-1, input(), flush=True)


#!/usr/bin/env python
from __future__ import division, print_function

import os
import sys
from io import BytesIO, IOBase

import _random

if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip
else:
    from builtins import str as __str__

    str = lambda x=b"": x if type(x) is bytes else __str__(x).encode()

input = sys.stdin.readline

class Random(_random.Random):
    def shuffle(self, x):
        for i in range(len(x) - 1, 0, -1):
            j = int(self.random() * (i + 1))
            x[i], x[j] = x[j], x[i]

    randrange = lambda self, a, b, step=1: a + step * int(
        self.random() * ((b - a + step + [1, -1][step < 0]) // step)
    )
    randint = lambda self, a, b: a + int(self.random() * (b - a + 1))
    choice = lambda self, seq: seq[int(self.random() * len(seq))]

random = Random()

def main():
    t = int(input())
    for _ in range(t):
        n = int(input())
        a = list(range(1, n + 1))

        res = 0
        for _ in range(9):
            random.shuffle(a)
            b, c = a[: n // 2], a[n // 2 :]
            print(len(b), len(c), *b, *c, flush=True)
            res = max(res, int(input()))
        print(-1, res)

if __name__ == "__main__":
    main()


#!/usr/bin/env python
from __future__ import division, print_function

import os
import sys

import _random

if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip
else:
    from builtins import str as __str__

    str = lambda x=b"": x if type(x) is bytes else __str__(x).encode()

input = sys.stdin.readline

class Random(_random.Random):
    def shuffle(self, x):
        for i in range(len(x) - 1, 0, -1):
            j = int(self.random() * (i + 1))
            x[i], x[j] = x[j], x[i]

    randrange = lambda self, a, b, step=1: a + step * int(
        self.random() * ((b - a + step + [1, -1][step < 0]) // step)
    )
    randint = lambda self, a, b: a + int(self.random() * (b - a + 1))
    choice = lambda self, seq: seq[int(self.random() * len(seq))]

random = Random()

def main():
    t = int(input())
    for _ in range(t):
        n = int(input())
        a = list(range(1, n + 1))

        res = 0
        for _ in range(9):
            random.shuffle(a)
            b, c = a[: n // 2], a[n // 2 :]
            print(len(b), len(c), *b, *c, flush=True)
            res = max(res, int(input()))
        print(-1, res, flush=True)

if __name__ == "__main__":
    main()


#!/usr/bin/env python
from __future__ import division, print_function

import os
import sys
from io import BytesIO, IOBase

import _random

if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip
else:
    from builtins import str as __str__

    str = lambda x=b"": x if type(x) is bytes else __str__(x).encode()

input = lambda: sys.stdin.readline

class Random(_random.Random):
    def shuffle(self, x):
        for i in range(len(x) - 1, 0, -1):
            j = int(self.random() * (i + 1))
            x[i], x[j] = x[j], x[i]

    randrange = lambda self, a, b, step=1: a + step * int(
        self.random() * ((b - a + step + [1, -1][step < 0]) // step)
    )
    randint = lambda self, a, b: a + int(self.random() * (b - a + 1))
    choice = lambda self, seq: seq[int(self.random() * len(seq))]

random = Random()

def main():
    t = int(input())
    for _ in range(t):
        n = int(input())
        a = list(range(1, n + 1))

        res = 0
        for _ in range(9):
            random.shuffle(a)
            b, c = a[: n // 2], a[n // 2 :]
            print(len(b), len(c), *b, *c, flush=True)
            res = max(res, int(input()))
        print(-1, res)

if __name__ == "__main__":
    main()


def sol():
    n = int(input())
    arr = [i for i in range(1, n + 1)]
    print(1, n - 1, 1, *arr[1:])
    res = int(input())
    l, r = 1, n
    while r - l > 1:
        m = (r + l) // 2
        ar1 = []
        for i in range(l, m):
            ar1.append(arr[i])
        print(1, len(ar1), 1, *ar1)
        kek = int(input())
        if kek == res:
            r = m
        else:
            l = m
    q = []
    for i in range(1, n + 1):
        if i != r:
            q.append(i)
    print(1, len(q), r, *q)
    print(-1, int(input()))

for _ in range(int(input())):
    sol()


# AC
import sys

class Main:
    def __init__(self):
        self.buff = None
        self.index = 0

    def next(self):
        if self.buff is None or self.index == len(self.buff):
            self.buff = sys.stdin.readline().split()
            self.index = 0
        val = self.buff[self.index]
        self.index += 1
        return val

    def next_int(self):
        return int(self.next())

    def q(self, a, b, c):
        print(1, c - b + 1, a, ' '.join([str(x) for x in range(b, c + 1)]))
        sys.stdout.flush()
        return self.next_int()

    def a(self, a, n):
        print(1, n - 1, a, ' '.join([str(x) for x in filter(lambda x: x != a, range(1, n + 1))]))
        return self.next_int()

    def solve(self):
        for _ in range(0, self.next_int()):
            n = self.next_int()
            d1 = self.q(1, 2, n)
            low = 2
            high = n
            while high > low:
                mid = (low + high) // 2
                d2 = self.q(1, low, mid)
                if d2 == d1:
                    high = mid
                else:
                    low = mid + 1
            print(-1, self.a(low, n))
            sys.stdout.flush()

if __name__ == '__main__':
    Main().solve()


# AC
import sys

class Main:
    def __init__(self):
        self.buff = None
        self.index = 0

    def next(self):
        if self.buff is None or self.index == len(self.buff):
            self.buff = sys.stdin.readline().split()
            self.index = 0
        val = self.buff[self.index]
        self.index += 1
        return val

    def next_int(self):
        return int(self.next())

    def q(self, a, b, c):
        print(1, c - b + 1, a, ' '.join([str(x) for x in range(b, c + 1)]))
        sys.stdout.flush()
        return self.next_int()

    def a(self, a, n):
        print(1, n - 1, a, ' '.join([str(x) for x in filter(lambda x: x != a, range(1, n + 1))]))
        return self.next_int()

    def solve(self):
        for _ in range(0, self.next_int()):
            n = self.next_int()
            d1 = self.q(1, 2, n)
            low = 2
            high = n
            while high > low:
                mid = (low + high) // 2
                d2 = self.q(1, low, mid)
                if d2 == d1:
                    high = mid
                else:
                    low = mid + 1
            dd = self.a(low, n)
            print(-1, dd)
            sys.stdout.flush()

if __name__ == '__main__':
    Main().solve()


# AC
import sys

class Main:
    def __init__(self):
        self.buff = None
        self.index = 0

    def next(self):
        if self.buff is None or self.index == len(self.buff):
            self.buff = sys.stdin.readline().split()
            self.index = 0
        val = self.buff[self.index]
        self.index += 1
        return val

    def next_int(self):
        return int(self.next())

    def q(self, a, b, c):
        print(1, c - b + 1, a, ' '.join([str(x) for x in range(b, c + 1)]))
        sys.stdout.flush()
        return self.next_int()

    def a(self, a, n):
        print(1, n - 1, a, ' '.join([str(x) for x in filter(lambda x: x != a, range(1, n + 1))]))
        sys.stdout.flush()
        return self.next_int()

    def solve(self):
        for _ in range(0, self.next_int()):
            n = self.next_int()
            d1 = self.q(1, 2, n)
            low = 2
            high = n
            while high > low:
                mid = (low + high) // 2
                d2 = self.q(1, low, mid)
                if d2 == d1:
                    high = mid
                else:
                    low = mid + 1
            dd = self.a(low, n)
            print(-1, dd)
            sys.stdout.flush()

if __name__ == '__main__':
    Main().solve()


# AC
import sys

class Main:
    def __init__(self):
        self.buff = None
        self.index = 0

    def next(self):
        if self.buff is None or self.index == len(self.buff):
            self.buff = sys.stdin.readline().split()
            self.index = 0
        val = self.buff[self.index]
        self.index += 1
        return val

    def next_int(self):
        return int(self.next())

    def q(self, a, b, c):
        print(1, c - b + 1, a, ' '.join([str(x) for x in range(b, c + 1)]))
        sys.stdout.flush()
        return self.next_int()

    def a(self, a, n):
        print(1, n - 1, a, ' '.join([str(x) for x in filter(lambda x: x != a, range(1, n + 1))]))
        return self.next_int()

    def solve(self):
        for _ in range(0, self.next_int()):
            n = self.next_int()
            d1 = self.q(1, 2, n)
            low = 2
            high = n
            while high > low:
                mid = (low + high) // 2
                d2 = self.q(1, low, mid)
                if d2 == d1:
                    high = mid
                else:
                    low = mid + 1
            print(self.a(low, n))
            sys.stdout.flush()

if __name__ == '__main__':
    Main().solve()


from sys import stdout
from random import shuffle

def solve():
    n = int(input())
    best = -1
    for q in range(9):
        A = [0 for _ in range(n)]
        for i in range(len(A)):
            if i & pow(2, q):
                A[i] = 1
        x = A.count(0)
        y = A.count(1)
        out = [x, y]
        for i in range(len(A)):
            if A[i] == 0:
                out.append(i + 1)
        for i in range(len(A)):
            if A[i] == 1:
                out.append(i + 1)
        print(' '.join(map(str, out)))
        stdout.flush()
        dist = int(input())
        best = max(best, dist)
    print(-1, best)

t = int(input())
for _ in range(t):
    solve()


from sys import stdout
from random import shuffle

def solve():
    n = int(input())
    x = n // 2
    y = n - x
    best = -1
    for _ in range(9):
        A = [0 for i in range(x)] + [1 for i in range(y)]
        shuffle(A)
        out = [x, y]
        for i in range(len(A)):
            if A[i] == 0:
                out.append(i + 1)
        for i in range(len(A)):
            if A[i] == 1:
                out.append(i + 1)
        print(' '.join(map(str, out)))
        stdout.flush()
        dist = int(input())
        best = max(best, dist)
    print(-1, best)

t = int(input())
for _ in range(t):
    solve()


from sys import stdout
from random import shuffle

def solve():
    n = int(input())
    x = n // 2
    y = n - x
    best = -1
    for q in range(9):
        A = [0 for _ in range(n)]
        for i in range(len(A)):
            if i & pow(2, q):
                A[i] = 1
        out = [x, y]
        for i in range(len(A)):
            if A[i] == 0:
                out.append(i + 1)
        for i in range(len(A)):
            if A[i] == 1:
                out.append(i + 1)
        print(' '.join(map(str, out)))
        stdout.flush()
        dist = int(input())
        best = max(best, dist)
    print(-1, best)

t = int(input())
for _ in range(t):
    solve()


from sys import stdout
from random import shuffle

def solve():
    n = int(input())
    x = n // 2
    y = n - x
    best = 123123123123213
    for _ in range(9):
        A = [0 for i in range(x)] + [1 for i in range(y)]
        shuffle(A)
        out = [x, y]
        for i in range(len(A)):
            if A[i] == 0:
                out.append(i + 1)
        for i in range(len(A)):
            if A[i] == 1:
                out.append(i + 1)
        print(' '.join(map(str, out)))
        stdout.flush()
        dist = int(input())
        best = max(best, dist)
    print(-1, best)

t = int(input())
for _ in range(t):
    solve()


from sys import stdout
from random import shuffle

def solve():
    n = int(input())
    x = n // 2
    y = n - x
    best = -1
    for q in range(9):
        A = [0 for _ in range(n)]
        for i in range(len(A)):
            if i & pow(2, q):
                A[i] = 1
        print(A)
        out = [x, y]
        for i in range(len(A)):
            if A[i] == 0:
                out.append(i + 1)
        for i in range(len(A)):
            if A[i] == 1:
                out.append(i + 1)
        print(' '.join(map(str, out)))
        stdout.flush()
        dist = int(input())
        best = max(best, dist)
    print(-1, best)

t = int(input())
for _ in range(t):
    solve()


from sys import stdout
from random import shuffle

def solve():
    n = int(input())
    best = -1
    for q in range(9):
        A = [0 for _ in range(n)]
        for i in range(len(A)):
            if i & pow(2, q):
                A[i] = 1
        x = A.count(0)
        y = A.count(1)
        out = [x, y]
        if x == 0 or y == 0:
            break
        for i in range(len(A)):
            if A[i] == 0:
                out.append(i + 1)
        for i in range(len(A)):
            if A[i] == 1:
                out.append(i + 1)
        print(' '.join(map(str, out)))
        stdout.flush()
        dist = int(input())
        best = max(best, dist)
    print(-1, best)

t = int(input())
for _ in range(t):
    solve()


import sys

def tanya(a,b,m,n):
    print('%d %d %s %s' % (m,n,' '.join(a),' '.join(b)))
    sys.stdout.flush()
    s = int(input())
    if s == -1:
        return -1
        sys.exit()
    return s
t = int(input())
for _ in range(t):
    n = int(input())
    s = [str(i) for i in range(2,n+1)]
    d_1 = tanya(['1'],s,1,n-1)
    while len(s) > 1:
        k = len(s)//2
        s = s[:k] if tanya(['1'],s[:k],1,k) == d_1 else s[k:]
    ans = tanya([s[0]],[str(i) for i in range(1,n+1) if i != s[0]],1,n-1)
    print('-1 %d' % ans)

#int binser(int l, int r){
 #       int mid = (l+r)/2;
  #      if (tanya(l, mid)) return binser(l, mid);
   #     return binser(mid+1, r);
    #    }