Problem:
Score : 100 points

Problem Statement

Snuke is giving cookies to his three goats.

He has two cookie tins. One contains A cookies, and the other contains B cookies. He can thus give A cookies, B cookies or A+B cookies to his goats (he cannot open the tins).

Your task is to determine whether Snuke can give cookies to his three goats so that each of them can have the same number of cookies.

Constraints

1 \leq A,B \leq 100

Both A and B are integers.

Input

Input is given from Standard Input in the following format:

A B

Output

If it is possible to give cookies so that each of the three goats can have the same number of cookies, print Possible; otherwise, print Impossible.

Sample Input 1

4 5

Sample Output 1

Possible

If Snuke gives nine cookies, each of the three goats can have three cookies.

Sample Input 2

1 1

Sample Output 2

Impossible

Since there are only two cookies, the three goats cannot have the same number of cookies no matter what Snuke gives to them.

Solution in C# (Mono 4.6.2.0) (judge verdict: Runtime Error)

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AtheleteProgramming3
{
    class Program
    {
        static void Main(string[] args)
        {
            long N = long.Parse(Console.ReadLine());
            long[] cardPool = Console.ReadLine().Split(' ').Select(long.Parse).ToArray();
            long min = long.MaxValue;
            long[] aArray1 = new long[N - 1];
            long[] bArray2 = new long[N - 1];
            aArray1[0] = cardPool[0];
            bArray2[N - 1-1] = cardPool[N-1];
            if (N != 2)
            {
                for(long i = 1; i < N - 1; i++)
                {
                    aArray1[i] = aArray1[i - 1] + cardPool[i];
                }
                for(long i = N - 3; i >= 0; i--)
                {
                    bArray2[i] = bArray2[i + 1] + cardPool[i + 1];
                }
                for(long i = 0; i < N - 1; i++)
                {
                    long tmp = Math.Abs(aArray1[i] - bArray2[i]);
                    if (tmp < min)
                    {
                        min = tmp;
                    }
                }
            }else
            {
                min = Math.Abs(cardPool[0] - cardPool[1]);
            }

            Console.WriteLine(min);
        }
    }
}