uses math;
var
A,s : array [-1..300,-1..300] of longint;
k,i,n,m,j,p,x : longint;
t : int64;
const
fi = 'ARR1HVS1.inp';
fo = 'ARR1HVS1.out';
procedure doc;
begin
assign(input,fi); reset(input);
assign(output,fo); rewrite(output);
readln(m,n,k);
for i := 1 to m do
for j := 1 to n do
begin
read(a[i,j]);
s[i,j] := s[i-1,j] + s[i,j-1] - s[i-1,j-1] + a[i,j];
end;
end;
begin
doc;
p := 0;
for x := 1 to min(m,n) do
for i := 1 to m-x+1 do
for j := 1 to n-x+1 do
begin
t := s[i+x-1,j+x-1] - s[i-1,j+x-1] - s[i+x-1,j-1] + s[i-1,j-1];
if t = k then
begin
writeln(i,#32,j,#32,x);
p := 1;
end;
end;
if p = 0 then write(-1);
close(input);
close(output);
end.