Solve MiddleCode