keys = [] 3.times { keys << gets.chomp } puts keys.inject(Hash.new(0)) {|hash, k| hash[k] += 1;hash}.sort_by { |a| a[1] }[1][0]