public int solution(int[] a) {
        BigInteger generalSummm = BigInteger.ZERO;
        BigInteger summBefore = BigInteger.ZERO;
        BigInteger summAfter;

        for (int i : a)
            generalSummm = generalSummm.add(BigInteger.valueOf(i));

        for (int i = 0; i < a.length; i++) {
            if (i > 0)
                summBefore = summBefore.add(BigInteger.valueOf(a[i-1]));
            summAfter = generalSummm.subtract(summBefore).subtract(BigInteger.valueOf(a[i]));

            if (summAfter.compareTo(summBefore) == 0)
                return i;
        }

        return -1;
    }