
A regular hexagon lies on a flat table. Each of the sides of the hexagon is coloured a different colour. We can move the hexagon around the table by flipping it over different edges, as shown in the diagram.

How many different ways are there of performing a sequence of $n$ moves such that after completing the moves the hexagon is back in the original position with each of the coloured edges in the same position as before, and where $n\leq 7$?