# frozen_string_literal: true _ = gets a = gets.chomp.split.map(&:to_i) (0..50).each do |y| r = Rational(a.sum, (2 * (a.size - 1))) next unless r.denominator == 1 x = 2 * a.size - r.numerator if [2 - y, 0].max <= x && x <= 50 - y puts [x, a.size - x].join(' ') exit end end