LearnPy Hub
← Arena
AdvancedRating 1500

Three That Cancel

Print every distinct triple of values (a ≤ b ≤ c) from the array with a + b + c = 0, in increasing order, one per line, or -1.

Input

n, then n integers.

Output

Lines.

Sample 1

Input
6
-1 0 1 2 -1 -4
Output
-1 -1 2
-1 0 1

Sample 2

Input
3
0 1 1
Output
-1
solution.py
Output appears here
Three That Cancel · Python Arena problem · LearnPy Hub