def generate_ordered_sequences(waypoint_lists):
	"""
	Given an ordered list of lists of possible choices, generate all possible
	ordered sequences.
	"""
	sequences = []
	if len(waypoint_lists) == 0:
		return []
	if len(waypoint_lists) > 1:
		for node in waypoint_lists[0]:
			for child in generate_ordered_sequences(waypoint_lists[1:]):
				if type(child) == list:
					sequences.append([node] + child)
				else:
					sequences.append([node] + [child])
	else:
		sequences = waypoint_lists[0]
	return sequences