uva482 - backtracking.