uva/10189 and uva/10035
less lines :P