Gapplet

The elements of the dihedral group Dn can all be written in the form ciaj. You can try this out by inputting the number n and a word in a and c.

Input a natural number n, e.g., 
  5.
</COMMENT>
 
Input a word in "a" and "c", e.g., 
"acacaacccaaaccc" 
</COMMENT>
 
Rewrite this word as an element of Dn.
</COMMENT>
 
</COMMENT>