# Breadth First Search

Very easy

Execution time limit is 1 second

Runtime memory usage limit is 128 megabytes

Given an undirected graph. Find the shortest distance between two specified vertices.

## Input

The first line contains three positive integers $n,s$ and $f(1≤s,f≤n≤100)$. Here, $n$ is the number of vertices in the graph, $s$ and $f$ are the initial and final vertices. The next $n$ lines provide the adjacency matrix of the graph. If the value at the $j$-th element of the $i$-th row is $1$, there is an edge between vertex $i$ and vertex $j$.

## Output

Print the minimum distance from the initial vertex to the final vertex. If no path exists, print $0$.

## Examples

Input #1

Answer #1

Submissions 12K

Acceptance rate 43%