djikstra idea: find shortest path, then second shortest, then next shortest---guaranteed to work https://qoj.ac/problem/13170