given inputs, find unlock code

bfs