Which of rhe following shapes must have a square base

According to the definition, the base of a pyramid is a polygon, the base is not necessarily a square as shown below:
On the other hand, a cube has 6 square faces, then a cube must have a square base. Then, the scond option is the correct answer