Solution to Missionaries and cannibals problem in Artificial Intelligence.