uva 1509, dfs