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++14 (GCC 5.4.1) (judge verdict: Runtime Error)

/*****Be Name Khoda*****/

#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>

#define F first
#define S second
#define Size(x) ((int)x.size())
#define All(x) x.begin() , x.end()
#define int long long

using namespace std;
using namespace __gnu_pbds;
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

const int N = 2e5 + 10;

int n , c[N] , sz[2];
vector<int> adj[N] , pass , path;

void dfs(int v , int par = -1)
{
	pass.push_back(v);
	if(v == n - 1)
		path = pass;
	for(auto u : adj[v])
		if(u != par)
			dfs(u , v);
	pass.pop_back();
}

void dfs2(int v , int par , bool check)
{
	sz[check]++;
	for(auto u : adj[v])
		if(u != par && (c[u] == check || c[u] == -1))
			dfs2(u , v , check);
}

int32_t main()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	cin >> n;
	for(int i = 0; i < n - 1; i++){
		int u , v;
		cin >> u >> v;
		adj[--u].push_back(--v) , adj[v].push_back(u);
	}
	fill_n(c , N , -1);
	dfs(0);
	int x = Size(path);
	for(int i = 0; i <= (x - 1) / 2; i++)
		c[i] = 0;
	for(int i = (x - 1) / 2 + 1; i < x; i++)
		c[i] = 1;
	dfs2((x - 1) / 2 , -1 , 0);
	dfs2((x - 1) / 2 + 1 , - 1 , 1);
	bool turn = x % 2;
	sz[0] -= (x - 1) / 2 + 1;
	x -= (x - 1) / 2 + 1;
	sz[1] -= x;
	while(true){
		if(sz[turn] <= 0){
			if(turn == 0)
				cout << "Snuke";
			else
				cout << "Fennec";
			break;
		}
		sz[turn]--;
		assert(sz[0] >= 0 && sz[1] >= 0);
		turn = !turn;		
	}
}