An equilateral triangle and a square have the same perimeter. Each side of the square measures 6 cm. What is the length of each side of the triangle?