using System;
using System.Collections.Generic;
using System.Linq;
namespace _3Sum_323
{
class Program
{
static void Main(string[] args)
{
while (true)
{
string input = Console.ReadLine();
if (input.Equals("exit"))
{
return;
}
List<int> inArr = input.Split(' ').Select(n => Convert.ToInt32(n)).ToList();
var results = new List<List<int>>();
for (int i = 0; i < inArr.Count; i++)
{
// Creating duplicate list minus the outer number
var inArr2 = new List<int>(inArr);
inArr2.Remove(inArr[i]);
for (int j = 0; j < inArr2.Count; j++)
{
// Creating duplicate list minus the outer number
var inArr3 = new List<int>(inArr2);
inArr3.Remove(inArr2[j]);
for (int k = 0; k < inArr3.Count; k++)
{
// Checks if they all add up to zero
if ((inArr[i] + inArr2[j] + inArr3[k]) == 0)
{
// Checks if the cominantion already exists in the list as a separate permutation
bool alreadyUsed = false;
foreach (var set in results)
{
if (set.Contains(inArr[i]) && set.Contains(inArr2[j]) && set.Contains(inArr3[k]))
{
alreadyUsed = true;
}
}
if (!alreadyUsed)
{
results.Add(new List<int> { inArr[i], inArr2[j], inArr3[k] });
}
}
}
}
}
foreach (var trip in results)
{
Console.WriteLine(trip[0] + " " + trip[1] + " " + trip[2]);
}
Console.WriteLine("");
}
}
}
}