
 /* :- seqex(next/2). */

color(R1,R2,R3,R4,R5,R6) :- 
	next(R1,R2), next(R1,R3), next(R1,R5), next(R1,R6), 
	next(R2,R3), next(R2,R4), next(R2,R5), next(R2,R6), 
	next(R3,R4), next(R3,R6),
	next(R5,R6).


next(blue,red). next(blue,green). next(blue,yellow).
	 	next(red,green).  next(red,yellow). 	next(red,blue).
next(green,red). 		  next(green,yellow).	next(green,blue).
next(yellow,red). next(yellow,green).			next(yellow,blue).

?- color(blue,R2,R3,R4,R5,R6).