Use red, yellow, and blue to dye the sides of a pentagon whose side lengths are 3, 4, 5, 6, and 7 respectively. It is required that the adjacent sides must not be of the same color. How many different dyeing methods are there?
用红、黄、蓝三色给边长分别为3，4，5，6，7的五边形的各边染色，要求相邻两边不许同色，共有多少种不同的染法？
<gadget id="calculator">2 * 2</gadget>
<output>4</output>

<gadget id="calculator">2 * 3</gadget>
<output>6</output>

<gadget id="calculator">4 + 6</gadget>
<output>10</output>

<gadget id="calculator">10 * 3</gadget>
<output>30</output>

<result>30</result>