from collections import * N = int(input()) A = list(map(int, input().split())) A.sort() D = deque(A) ans = [] cnt = 0 while len(D) >= 2: if abs(D[0]) <= abs(D[-1]): D.pop() else: if D[0] + D[-1] >= 0: break D.popleft() D.pop() cnt += 1 ans.append(cnt) D = deque(A) cnt = 0 while len(D) >= 2: if abs(D[0]) >= abs(D[-1]): D.popleft() else: if D[0] + D[-1] <= 0: break D.popleft() D.pop() cnt += 1 ans.append(cnt) D = deque(A) cnt = 0 while len(D) >= 2: if abs(D[0]) < abs(D[-1]): D.pop() elif abs(D[0]) > abs(D[-1]): D.popleft() else: if D[0] + D[-1] != 0: break D.popleft() D.pop() cnt += 1 ans.append(cnt) print(*ans)