# Black box algorithm to find standard generators of Fi23

	set F 0             # Have we found element 1?
	set G 0             # Have we found element 2?
	set V 0             # Timeout counter for "semi-standard" part
	set Y 0	            # Timeout counter for conjugating part

lbl SEMISTD
	rand 1
	ord 1 A
	incr V
	if V gt 1000 then timeout
	if A notin 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 20 21 22 &
			23 24 26 27 28 30 35 36 39 42 60 then fail
	if F eq 0 then
		if A in 20 28 60 then
			div A 2 B
			pwr B 1 2
			set F 1
		endif
	endif
	if G eq 0 then
		if A in 3 6 9 12 18 then
			div A 3 C
			pwr C 1 3
			set G 1
			# This is an element of order 3, but it
			# might not be in the right class. We may have
			# to revisit this step later.
		endif
	endif

	if F eq 0 then jmp SEMISTD
	if G eq 0 then jmp SEMISTD
	
	set X 0       # Number of times we have tried to prove element is in 3D
	set Z 0       # Are we definitely in class 3D?

lbl CONJUGATE
	incr Y
	if Y gt 1000 then timeout
	rand 4
	cjr 3 4
	mu 2 3 5
	ord 5 D

	if D eq 28 then jmp FINISH

	if D notin 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 20 21 22  &
			23 24 26 27 28 30 35 36 39 42 60 then
		# This is not Fi23!
		fail
	endif

	if D in 13 16 17 18 20 21 22 23 24 26 27 28 30 35 36 39 42 60 then
		# The second element is definitely in class 3D.
		set Z 1
	endif

	if Z eq 0 then
		if D notin 3 6 8 9 10 11 12 13 14 15 16 17 18 20 21 22 23 &
			24 26 27 28 30 35 36 39 42 60 then
			# The second element is definitely not in class 3D.
			# Try again.
			set G 0
			jmp SEMISTD
		endif

		incr X	
		if X gt 1 then
			# We have haven't been able to prove quickly
			# that the second element is in class 3D.
			# We guess that it probably isn't, and start looking
			# again.
			set G 0
			jmp SEMISTD
		endif
	endif

	jmp CONJUGATE

lbl FINISH
	oup 2 2 3
