hdu 1195 Open the Lock(bfs)