Solved 002 by ruby