var a:array[1..200,1..200]of integer;
b:array[1..200]of boolean;
n,i,j,k,l,o,p:longint;
ss,ss2:set of 0..200;
z1,z2:boolean;
procedure try(x,y:integer);
var j,k:integer;
begin
if x=y then
begin
if z2=true then
begin
ss2:=ss;
z2:=false;
end
else ss2:=ss*ss2;
end
else
for j:=1 to n do
if (a[x,j]=1) and (b[j]) then
begin
b[j]:=false;
ss:=ss+[j];
try(j,y);
ss:=ss-[j];
b[j]:=true;
end;
end;
begin
assign(input,'1.in');
reset(input);
readln(n,p);
for i:=1 to n do
for j:=1 to n do
read(a[i,j]);
for i:=1 to n do
if i<>p then
begin
fillchar(b,sizeof(b),true);
ss:=[];
ss2:=[];
z1:=true;z2:=true;
b[p]:=false;
try(p,i);
ss2:=ss2-[i];
for j:=1 to n do
if j in ss2 then
begin
write(j,' ');
z1:=false;
end;
if z1=true then write('No');
writeln;
end;
end.
rt、、、、