bfs, two queues, remove the visited word from set