solution for uva 3921