#include<bits/stdc++.h>
using namespace std;
int main()
{
int a[5];
while(cin >> a[0] >> a[1] >> a[2] >> a[3] >> a[4] && a[0] != 0 && a[1] != 0 && a[2] != 0 && a[3] != 0 && a[4] != 0)
{
sort(a, a+5);
long int t = (a[1]-a[0]) * a[2] + (a[3]*a[4]);
if(t == 23)
{
cout << "Possible" << endl;
continue;
}
int f = 0;
while(next_permutation(a, a+5))
{
int t1 = max(a[0], a[1]);
int t2 = min(a[0], a[1]);
long int t = (t1-t2)*a[2]+(a[3]*a[4]);
if(t == 23)
{
f = 1;
cout << "Possible" << endl;
break;
}
}
if(f == 0)
{
cout << "Impossible" << endl;
}
}
return 0;
}
Comments
Post a Comment