### Description

In modern society, each person has his own friends. Since all the people are very busy, they communicate with each other only by phone. You can assume that people A can keep in touch with people B, only if

1. A knows B's phone number
2. A knows people C's phone number and C can keep in touch with B.
It's assured that if people A knows people B's number, B will also know A's number.

Sometimes, someone may meet something bad which makes him lose touch with all the others. For example, he may lose his phone number book and change his phone number at the same time.

In this problem, you will know the relations between every two among N people. To make it easy, we number these N people by 1,2,...,N. Given two special people with the number S and T, when some people meet bad things, S may lose touch with T. Your job is to compute the minimal number of people that can make this situation happen. It is supposed that bad thing will never happen on S or T.

### Input

The first line of the input contains three integers N , S and T .Each of the following N lines contains N integers. If i knows j's number, then the j-th number in the (i+1)-th line will be 1, otherwise the number will be 0.

You can assume that the number of 1s will not exceed 5000 in the input.

### Output

If there is no way to make A lose touch with B, print "NO ANSWER!" in a single line. Otherwise, the first line contains a single number t, which is the minimal number you have got, and if t is not zero, the second line is needed, which contains t integers in ascending order that indicate the number of people who meet bad things. The integers are separated by a single space.

If there is more than one solution, we give every solution a score, and output the solution with the minimal score. We can compute the score of a solution in the following way: assume a solution is A1, A2, ..., At $(1 \le A1 < A2 <...< At \le N )$, the score will be $(A_1-1)N^t+(A_2-1)N^(t-1)+...+(A_t-1)*N$. The input will assure that there won't be two solutions with the minimal score.

3 1 3
1 1 0
1 1 1
0 1 1

1
2

### Hint

$2 \le N \le 200$
$1 \le S, T \le N$ and S is not equal to T

POJ Monthly

### Code

#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<queue>
#define maxn 510
#define maxe 50010
#define INF 0x3f3f3f3f
using namespace std;
int N,S,T;
int mp[maxn][maxn];
int map1[maxn],map2[maxn],res[maxn];

struct edge
{
int to,next,val;
}e[maxe];

{
char ch;
do
ch=getchar();
while((ch<'0'||ch>'9')&&ch!='-');
if(ch=='-') sign=-1,ch=getchar();
while(ch>='0'&&ch<='9')
{
ch=getchar();
}
}

inline void ins(int u,int v,int w)
{
num_e++;
e[num_e].to=v;
e[num_e].val=w;
}

inline void insert(int u,int v,int w)
{ ins(u,v,w);ins(v,u,0); }

void init()
{
memset(mp,0,sizeof(mp));
for(int i=1;i<=N;++i)
for(int j=1;j<=N;++j)
}

void build_graph()
{
num_e=1;
memset(e,0,sizeof(e));
for(int i=1;i<=N;++i)
insert(i,i+N,1);
for(int i=1;i<=N;++i)
for(int j=1;j<=N;++j)
if(i!=j && mp[i][j]==1)
insert(i+N,j,INF);
}

bool bfs()
{
memset(dis,-1,sizeof(dis));
queue<int> q;
q.push(S+N);
dis[S+N]=0;
while(!q.empty())
{
int u=q.front();q.pop();
while(i)
{
if(e[i].val && dis[e[i].to]<0)
{
dis[e[i].to]=dis[u]+1;
q.push(e[i].to);
}
i=e[i].next;
}
}
if(dis[T]==-1) return 0;
return 1;
}

int dfs(int x,int flow)
{
if(x==T) return flow;
while(i)
{
if(e[i].val && dis[e[i].to]==dis[x]+1)
{
w=flow-used;
w=dfs(e[i].to,min(w,e[i].val));
e[i].val-=w;
e[i^1].val+=w;
used+=w;
if(used==flow) return flow;
}
i=e[i].next;
}
if(!used) dis[x]=-1;
return used;
}

int dinic()
{
int ans=0;
while(bfs()) ans+=dfs(S+N,INF);
return ans;
}

void print_nodes()
{
int ans=dinic();
cout<<ans<<endl;
int cnt=0,max_flow=ans;
for(int i=1;i<=N;++i)
{
if(i==S||i==T) continue;
for(int j=1;j<=N;++j)
{
map1[j]=mp[i][j];
map2[j]=mp[j][i];
mp[i][j]=mp[j][i]=0;
}
build_graph();
int k=dinic();
if(max_flow>k)
{
res[++cnt]=i;
max_flow--;
}
else
{
for(int j=1;j<=N;++j)
{
mp[i][j]=map1[j];
mp[j][i]=map2[j];
}
}
if(max_flow==0) break;
}
for(int i=1;i<=cnt;++i) cout<<res[i]<<" ";
cout<<endl;
}

int main()
{
while(scanf("%d%d%d",&N,&S,&T)==3)
{
init();
if(mp[S][T]!=0)
{