{"trustable":false,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"ptx\" lang\u003d\"en-US\"\u003eBeads of red, blue or green colors are connected together into a circular necklace of n beads ( n \u003c 24 ). If the repetitions that are produced by rotation around the center of the circular necklace or reflection to the axis of symmetry are all neglected, how many different forms of the necklace are there? \r\n\u003cbr\u003e\u003ccenter\u003e\u003cimg src\u003dhttp://poj.org/images/1286_1.jpg\u003e\u003c/center\u003e\r\n\u003cbr\u003e\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cdiv class\u003d\"ptx\" lang\u003d\"en-US\"\u003eThe input has several lines, and each line contains the input data n.\r\n\u003cbr\u003e-1 denotes the end of the input file. \r\n\u003cbr\u003e\u003c/div\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cdiv class\u003d\"ptx\" lang\u003d\"en-US\"\u003eThe output should contain the output data: Number of different forms, in each line correspondent to the input data.\u003c/div\u003e"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre class\u003d\"sio\"\u003e4\r\n5\r\n-1\r\n\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre class\u003d\"sio\"\u003e21\r\n39\r\n\u003c/pre\u003e"}}]}