# Find triples in the DNA below

trip_count = Hash.new

while line = DATA.gets
	trips = line.scan(/(...)/)
	trips.each { |trip|
		if ! trip_count.member? trip then
			trip_count[trip] = 0
		end
		trip_count[trip] += 1
	}
end

# (Sort in decreasing order)
trip_count \
	.sort { |a,b| b[1] <=> a[1] } \
	.each { |k,v|
	puts "#{k} : #{v}"
}

__END__
gcggcattcagcacccgtatactgttaagcaatccagatttttgtgtataacataccggc
catactgaagcattcattgaggctagcgctgataacagtagcgctaacaatgggggaatg
tggcaatacggtgcgattactaagagccgggaccacacaccccgtaaggatggagcgtgg
taacataataatccgttcaagcagtgggcgaaggtggagatgttccagtaagaatagtgg
gggcctactacccatggtacataattaagagatcgtcaatcttgagacggtcaatggtac
cgagactatatcactcaactccggacgtatgcgcttactggtcacctcgttactgacgga
