program olympic;
var x,y,z,s:array[1..15]of longint;
t,k,m,n,i,j:longint;
q:boolean;
begin
assign(input,'olympic.in');
reset(input);
assign(output,'olympic.out');
rewrite(output);
readln(n);
for t:=1 to n do
readln(x[t],y[t],z[t]);
for i:=1 to 10000 do
for j:=1 to i do
for k:=1 to j do
begin
for t:=1 to n do
s[t]:=x[t]*i+y[t]*j+z[t]*k;
q:=true;
for t:=2 to n do
if s[t]>s[1] then
begin
q:=false;
break;
end;
if q then
begin
writeln(i,' ',j,' ',k);
close(output);
halt;
end;
end;
end.