uglynumbers, ugly solution