import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class Main { public static void main(String[] args) { new Main().execute(); } private void execute() { int[] weights = loadInputValue(); outputResult(canDevideInHalf(weights)); } boolean canDevideInHalf(int[] weights) { int totalWeight = total(weights); if (totalWeight % 2 != 0) { return false; } int halfTotalWeight = totalWeight /2 ; return canMakeWeight(convertToList(weights), halfTotalWeight); } private boolean canMakeWeight(List weights, int goalWeight) { List copyList = new ArrayList<>(weights); for (Integer weight : weights) { if (weight == goalWeight) { return true; } copyList.remove(weight); if (weight > goalWeight) { continue; } if (canMakeWeight(copyList, goalWeight - weight)) { return true; } } return false; } private List convertToList(int[] array) { List ret = new ArrayList<>(); for (int i : array) { ret.add(i); } return ret ; } private int total(int[] values) { int totalValue = 0; for (int value : values) { totalValue += value; } return totalValue; } @SuppressWarnings("resource") private int[] loadInputValue() { Scanner sc = new Scanner(System.in); int[] ret = new int[sc.nextInt()]; for (int i = 0; i < ret.length; i++) { ret[i] = sc.nextInt(); } return ret; } private void outputResult(boolean canDevideInHalf) { if (canDevideInHalf) { System.out.println("possible"); } else { System.out.println("impossible"); } } }