Could someone explain how to do the secret recipe from june cookoff?

https://www.codechef.com/COOK107B/problems/SECRECP