How do you get the other password to the warehouse in Pokemon?

I think you need to beat trainer tower or defeat all the trainers on every island.