spoj; solve "Frequent Values"