Note that the sum of the natural numbers between 1 and 8 is 36, which means that, if we have 8 houses, the number of people in each house is just the numbers from 1 to 8. Each house contains a unique number of people.
The question doesn’t ask for the specific arrangement of the houses into lines.