Create input file of BFS