An example from my textbook says the following:

Five persons entered the lift cabin on the ground floor of an 8 floor house. Suppose each of them can leave the cabin independently at any floor beginning with the first. Find the total number of ways in which each of the five persons can leave the cabin at any one of the 7 floors.

It provides the solution as:

$$7\*7\*7\*7\*7 = 7^5$$

I would assume that since there's 5 people and 7 floors.. it would be the same as 7 questions with 5 choices which is:

$$5\*5\*5\*5\*5\*5\*5 = 5^7$$

Am I wrong? Can someone explain?

Thank you!