Question to check if strings form a chain