Solved 003 by ruby