$n = gets.to_i $w = gets.split.map(&:to_i) $nerai = $w.inject(:+)/2.0 $flag = "impossible" def dfs(depth, total) if depth >= $n - 1 return $w[depth] end a = dfs(depth+1, total+$w[depth]) b = dfs(depth+1, total) return a if $nerai - a == 0 return b if $nerai - b == 0 return -1 end puts dfs(-1, 0) > 0 ? "possible" : "impossible"