You're given a complete directed graph $$$G$$$ with $$$n$$$ vertices. We call a vertex $$$u$$$ dominating if for every $$$v\neq u$$$, there either exists an edge $$$(u\rightarrow v)$$$ or there exists a vertex $$$w$$$ satisfying $$$(u\rightarrow w)$$$ and $$$(w\rightarrow v)$$$.
You now need to find $$$3$$$ distinct dominating vertices of the given graph. If there are less than $$$3$$$ dominating vertices, output $$$\texttt{NOT FOUND}$$$.
The first line of input contains one integer $$$n$$$ ($$$1\leq n\leq 5000$$$).
The next $$$n$$$ lines of input contain a binary string $$$s_i$$$ each. There exists edge $$$(u\rightarrow v)$$$ if the $$$v$$$-th character of $$$s_u$$$ is $$$1$$$; otherwise, there is no such edge. It is guaranteed that exactly one of $$$s_{i,j}=1$$$ and $$$s_{j,i}=1$$$ holds for every $$$1\leq i \lt j\leq n$$$ and $$$s_{i,i}=0$$$ for every $$$1\leq i\leq n$$$.
The first line of output contains three integers $$$a,b,c$$$, denoting the answer you've found, or $$$\texttt{NOT FOUND}$$$, if there are not enough dominating vertices.
6 011010 000101 010111 100001 010100 100010
3 1 4
3 011 001 000
NOT FOUND
3 010 001 100
1 3 2
| Name |
|---|


