format bfs.cpp