program tppx;
const maxn=100;
var
map:array[1..maxn,1..maxn]of longint;
into:array[1..maxn]of longint;
n,i,j,k:longint;
procedure init;
var
i,j:longint;
begin
read(n);
for i:=1 to n do
for j:=1 to n do
read(map[i,j]);
inc(into[j]);
end;
begin
//assign('input.in');
//assign('output.out');
//reset(input);
//rewrite(output);
init;
for i:=1 to n do
begin
j:=1;
while(j<=n)and(into[j]<>0)do inc(j);
if j>n then halt;
write(j,' ');
into[j]:=255;
for k:=1 to n do
if map[j,k]=1 then dec(into[k]);
end;
//close(input);
//close(output);
end.
0 0 1 0 0 0 0 1
1 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 1 0 0 0 0 1
0 1 0 1 0 1 0 0
1 1 0 0 0 0 0 0
0 0 0 1 1 0 0 0
0 0 1 0 0 0 0 0