How did they choose the 5 permanent nations for UN?

The five countries that helped during WW2. They were all on the allies side.