var z:array[1..10000] of int64;
n,i,j,k:integer;
mn,tot:int64;

procedure qs(start,stop:integer);
var temp,pivot:longint;left,right:integer;
begin
if start>=stop then
else
begin
pivot:=z[start];
left:=start+1;
right:=stop;
while(left<=right) do
begin
        while(left<=stop) and (z[left]<pivot) do inc(left);
        while(right>start) and (z[right]>=pivot)do dec(right);
        if left<right then
        begin
                temp:=z[left];
                z[left]:=z[right];
                z[right]:=temp;
        end;
end;
temp:=z[start];
z[start]:=z[right];
z[right]:=temp;
qs(start,right-1);
qs(right+1,stop);
end;
end;


begin
read(n);
for i:=1 to n do
begin
        read(z[i]);
end;
qs(1,n);
for i:=1 to n-2 do
begin
        for j:=i+1 to n-1 do
        begin
                mn:=z[i]+z[j];
                for k:=j+1 to n do
                begin
                        if z[k]<mn then writeln(z[i],' ',z[j],' ',z[k]);
                end;
        end;
end;
end.