In others, such as the horse, a tendency to trot or pace is inherited, but many animals can be trained to do either or both.
(many animals; can be trained; to do either or both) (many animals; to do; either or both)
many animals many animals
can be trained to do
to do either or both
either or both