Mammoth's Genome Decoding

CodeForces - 747B