Two algorithms for snake lemma.