we define span tree graph BFS tree root vertex s node t short distance s t graph equal short distance s t span tree give graph define fxy number span tree graph BFS tree root vertex x y timeYou give undirected connect graph n vertex m edge Calculate fij j modulo 998244353