The directed graph is given. Find the shortest distance from the vertex to other vertices of the graph.
The first line contains two integers and x~(1 \le n \le 1000, 1 \le x \le n) — the number of vertices in a graph and the starting vertex. Each of the next lines contains numbers — the adjacency matrix of the graph: the -th line and -th column contains "", if the vertices and are connected with the edge, and "", if there is no edge between them. The main diagonal contains zeroes.
Print the numbers d_1, d_2, \ldots, d_n, where d_i is if there is no path from to , or the minimal distance from to otherwise.

Example 1