Fourth. Thinking of the recursion algorithm for scanning