N,*F=*$< p F.map{|s|s.count('^')}.group_by{|c|c}.then{|h|h.keys.max_by{|k|[h[k].size,k]}}