Bi solution for beginners' reference.