#d2810. 最短路计数

最短路计数

Shortest Path Counting

Problem Description

You are given an undirected, unweighted graph with NN vertices and MM edges.

For each vertex other than vertex 11, count how many different shortest paths lead from vertex 11 to it.

Input Format

The first line contains two positive integers N,MN, M.

Each of the next MM lines contains two positive integers x,yx, y, meaning there is an edge from vertex xx to vertex yy (multiple edges and self-loops may exist).

Output Format

Output NN lines, each containing a non-negative integer. The ii-th line is the number of different shortest paths from vertex 11 to vertex ii.

Since the answer may be large, output the result modulo 100003100003.

If vertex 11 cannot reach vertex ii, output 00.

Sample Input

5 7
1 2
1 3
2 4
3 4
2 3
4 5
4 5

Sample Output

1
1
1
2
4

Constraints

1≤N≤1061 \le N \le 10^6, 1≤M≤2×1061 \le M \le 2 \times 10^6.

Hint

Because the amount of data is large, please use fast input/output methods.