Solve problem 123 using Rust.