Metoda+backtracking