# frozen_string_literal: true def solve if W.sum.even? && W.balancable? 'possible' else 'impossible' end end class Array def balancable? (1..size / 2).any? do |left| combination(left).any? { 2 * _1.sum == sum } end end end N = gets.to_i W = gets.split.map(&:to_i) puts solve