Consider a simple cycle with N vertices numbered from 1 to N. Each vertex and Each edge has an integer value. We use v[k] to represent the kth vertex's value, and e[k] to represent the kth edge's value. The kth edge is the edge of the kth and the (k+1)th vertex (the (N+m)th vertex is the mth vertex). Now we will use C different colors to color the graph. Every vertice will be colored by one of the C colors. If there exists some integer number k which satisfies v[i]=v[i+k] and e[i]=e[i+k] for each i from 1 to N(v[N+t]=v[t] and e[N+t]=e[t]), we call the graph is the same under k rotation.
If two ways of coloring the cycle can be the same with some rotation and under that rotation the color of the corresponding vertices are also the same, we consider the two ways are the same ways. Given the simple cycle and the number of colors we will use, how many different ways to color the cycle?