Hungarian Rings

This puzzle consists of two intersecting rings made up of a number of coloured balls. The rings of balls intersect at two places, so they share two of the balls. Each ring of balls can be rotated, so the balls can be mixed. The aim is to mix up the balls, and then place the balls back together so each colour form a continuous sequence.
The applet below was written by Jaap Scherphuis © ( Jaap's Puzzle Page).
The basic legal moves of the Hungarian Rings puzzle are

The permutation corresponding to each of the legal moves
The Hungarian Rings puzzle group
SageMath
xxxxxxxxxx
S38=SymmetricGroup(38)
L=S38("(1,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2)")
R=S38("(1,38,37,36,35,6,34,33,32,31,30,29,28,27,26,25,24,23,22,21)")
HR=S38.subgroup([L,R])
# now we can multiply puzzle moves
print(L*R*L^(-1)*R^(-1))
# order of the hungarian rings group is 38!
print(HR.order() == factorial(38))