Solution for Qualification B