A right square pyramid has a base with edges each measuring 3 cm and a height twice the perimeter of its base. What is the volume of the pyramid?

Let's think step by step and output the final answer within \boxed{}.
user