Edge Case

Time Limit: 2 Seconds    Memory Limit: 32768 KB

In graph theory, a matching or independent edge set in a graph G = (V, E) is a set of edges M ⊆ E such that no two edges in the matching M share a common vertex.

Recently you saw in the news that “The Sveriges Riksbank Prize in Economic Sciences in Memory of Alfred Nobel” (informally, the Nobel Prize in Economics) for 2012 was awarded to Alvin E. Roth and Lloyd S. Shapley for, amongst other things, their algorithm for finding a matching satisfying certain criteria in a bipartite graph. Since you have also heard that matchings in cycle graphs have applications in chemistry your thoughts centre around a plan for a beautiful future where your Christmas shopping is more luxurious than ever! The cycle graph, Cn , n ≥ 3, is a simple undirected graph, on vertex set {1, . . . , n}, with edge set E(Cn ) = {{a, b} | |a − b| ≡ 1 mod n}. It is 2-regular, and contains n edges. The graphs C3 , C4 , C5 , and C6 are depicted in Figure 1.

Your first step towards Nobel Prize fame is to be able to compute the number of matchings in the cycle graph Cn . In Figure 2 the seven matchings of the graph C4 are depicted.


Figure 2: The matchings of C4 . The edges that are part of the respective matching are coloured green, while the edges left out of the matching are dashed. M1 = ∅, M2 = {{2, 1}}, M3 = {{3, 2}}, M4 = {{4, 3}}, M5 = {{1, 4}}, M6 = {{2, 1}, {4, 3}}, and M7 = {{3, 2}, {1, 4}}.


For each test case, you get a single line containing one positive integer: n, with 3 ≤ n ≤ 10000.



For each test case, a row containing the number of matchings in Cn .


Sample Input


Sample Output


Source: NWERC 2012