Viral Ethics
I attended the LCS for the first time this year. Unfortunately, I can't communicate with you in person, and you probably wouldn't enjoy interacting with me over the network. You see, I'm a virus. Currently, I reside on the laptop of a careless student. My creator designed me to try to reach the laptop of the shift director. I know which computers I can copy myself to, but I don't know the exact path I'll take through the local network. I only know that I'll start my journey on the student's computer and end on the director's computer. Along the way, I might visit the same computer multiple times.
However, I want to avoid that! Every computer I pass through will be damaged. I want to warn their owners by identifying all the computers I might theoretically visit on my way to the director's laptop, so I can alert them. Can you help me with this?
Input
The first line contains the integers n, a, b (2 ≤ n ≤ 200, 1 ≤ a, b ≤ n, a ≠ b) - representing the number of computers in the local network, the number of the student's computer where I currently am, and the number of the director's computer. Each of the following n lines contains exactly n characters. In the i-th line at the j-th position, there is a character "1" if I can copy myself from the i-th computer to the j-th, and "0" otherwise. It is assumed that I cannot copy myself from a computer to itself. It is guaranteed that I can reach computer b from computer a.
Output
In the first line, output the number of computers that I might visit on the way from computer a to computer b. In the second line, output the numbers of these computers in any order.