#include<bits/stdc++.h>
using namespace std;
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
typedef long long ll;
typedef double dd;
#define pb push_back
#define mp make_pair
#define endl "\n"
ll const M = 1000000007;
dd const pi = acos(-1);
ll const inf = 2e18;
ll const N = 200001;
vector<ll> a(5);
vector<char> op = {'+','-','*'};
string s;
bool ok;
ll calculate()
{
ll i,ans = 0;
if(s[0] == '+')
ans = a[0] + a[1];
else if(s[1] == '-')
ans = a[0] - a[1];
else
ans = a[0]*a[1];
for(i = 1; i < 4; i++)
{
if(s[i] == '+')
ans = ans + a[i + 1];
else if(s[i] == '-')
ans = ans - a[i + 1];
else
ans = ans*a[i + 1];
}
return ans;
}
void solve(ll i)
{
if(i == 4)
{
if(calculate() == 23)
ok = true;
return;
}
for(ll j = 0; j < 3; j++)
{
s.pb(op[j]);
solve(i + 1);
s.pop_back();
}
}
int main()
{
fast;
ll i,j,t;
while(1)
{
for(i = 0; i < 5; i++)
cin >> a[i];
for(i = 0; i < 5; i++)
if(a[i] != 0)
break;
if(i == 5)
break;
s.clear();
sort(a.begin(),a.end());
ok = false;
do {
solve(0);
if(ok)
break;
} while (next_permutation(a.begin(),a.end()));
if(ok)
cout<<"Possible"<<endl;
else
cout<<"Impossible"<<endl;
}
return 0;
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKI2RlZmluZSBmYXN0IGlvc19iYXNlOjpzeW5jX3dpdGhfc3RkaW8oZmFsc2UpO2Npbi50aWUoTlVMTCk7Y291dC50aWUoTlVMTCkKdHlwZWRlZiBsb25nIGxvbmcgbGw7CnR5cGVkZWYgZG91YmxlIGRkOwojZGVmaW5lIHBiIHB1c2hfYmFjawojZGVmaW5lIG1wIG1ha2VfcGFpcgojZGVmaW5lIGVuZGwgIlxuIgpsbCBjb25zdCBNID0gMTAwMDAwMDAwNzsKZGQgY29uc3QgcGkgPSBhY29zKC0xKTsKbGwgY29uc3Qg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iAgCQlkbyB7IAogICAgICAgIAlzb2x2ZSgwKTsKICAgICAgICAJaWYob2spCiAgICAgICAgCQlicmVhazsKICAgICAgICB9IHdoaWxlIChuZXh0X3Blcm11dGF0aW9uKGEuYmVnaW4oKSxhLmVuZCgpKSk7IAogIAkJaWYob2spCiAgCQkJY291dDw8IlBvc3NpYmxlIjw8ZW5kbDsKICAJCWVsc2UKICAJCQljb3V0PDwiSW1wb3NzaWJsZSI8PGVuZGw7CiAgCQkKICAJfQogICAgcmV0dXJuIDA7Cn0gICAg
Main.java:1: error: illegal character: '#'
#include<bits/stdc++.h>
^
Main.java:1: error: class, interface, or enum expected
#include<bits/stdc++.h>
^
Main.java:3: error: illegal character: '#'
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
^
Main.java:3: error: class, interface, or enum expected
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
^
Main.java:3: error: class, interface, or enum expected
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
^
Main.java:3: error: class, interface, or enum expected
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
^
Main.java:5: error: class, interface, or enum expected
typedef double dd;
^
Main.java:6: error: illegal character: '#'
#define pb push_back
^
Main.java:6: error: class, interface, or enum expected
#define pb push_back
^
Main.java:7: error: illegal character: '#'
#define mp make_pair
^
Main.java:8: error: illegal character: '#'
#define endl "\n"
^
Main.java:10: error: class, interface, or enum expected
dd const pi = acos(-1);
^
Main.java:11: error: class, interface, or enum expected
ll const inf = 2e18;
^
Main.java:12: error: class, interface, or enum expected
ll const N = 200001;
^
Main.java:13: error: class, interface, or enum expected
vector<ll> a(5);
^
Main.java:14: error: class, interface, or enum expected
vector<char> op = {'+','-','*'};
^
Main.java:15: error: class, interface, or enum expected
string s;
^
Main.java:16: error: class, interface, or enum expected
bool ok;
^
Main.java:17: error: class, interface, or enum expected
ll calculate()
^
Main.java:20: error: class, interface, or enum expected
if(s[0] == '+')
^
Main.java:22: error: class, interface, or enum expected
else if(s[1] == '-')
^
Main.java:24: error: class, interface, or enum expected
else
^
Main.java:26: error: class, interface, or enum expected
for(i = 1; i < 4; i++)
^
Main.java:26: error: class, interface, or enum expected
for(i = 1; i < 4; i++)
^
Main.java:26: error: class, interface, or enum expected
for(i = 1; i < 4; i++)
^
Main.java:30: error: class, interface, or enum expected
else if(s[i] == '-')
^
Main.java:32: error: class, interface, or enum expected
else
^
Main.java:34: error: class, interface, or enum expected
}
^
Main.java:36: error: class, interface, or enum expected
}
^
Main.java:43: error: class, interface, or enum expected
return;
^
Main.java:44: error: class, interface, or enum expected
}
^
Main.java:45: error: class, interface, or enum expected
for(ll j = 0; j < 3; j++)
^
Main.java:45: error: class, interface, or enum expected
for(ll j = 0; j < 3; j++)
^
Main.java:48: error: class, interface, or enum expected
solve(i + 1);
^
Main.java:49: error: class, interface, or enum expected
s.pop_back();
^
Main.java:50: error: class, interface, or enum expected
}
^
Main.java:55: error: class, interface, or enum expected
ll i,j,t;
^
Main.java:56: error: class, interface, or enum expected
while(1)
^
Main.java:58: error: class, interface, or enum expected
for(i = 0; i < 5; i++)
^
Main.java:58: error: class, interface, or enum expected
for(i = 0; i < 5; i++)
^
Main.java:60: error: class, interface, or enum expected
for(i = 0; i < 5; i++)
^
Main.java:60: error: class, interface, or enum expected
for(i = 0; i < 5; i++)
^
Main.java:60: error: class, interface, or enum expected
for(i = 0; i < 5; i++)
^
Main.java:63: error: class, interface, or enum expected
if(i == 5)
^
Main.java:65: error: class, interface, or enum expected
s.clear();
^
Main.java:66: error: class, interface, or enum expected
sort(a.begin(),a.end());
^
Main.java:67: error: class, interface, or enum expected
ok = false;
^
Main.java:68: error: class, interface, or enum expected
do {
^
Main.java:70: error: class, interface, or enum expected
if(ok)
^
Main.java:72: error: class, interface, or enum expected
} while (next_permutation(a.begin(),a.end()));
^
Main.java:73: error: class, interface, or enum expected
if(ok)
^
Main.java:75: error: class, interface, or enum expected
else
^
Main.java:78: error: class, interface, or enum expected
}
^
Main.java:80: error: class, interface, or enum expected
}
^
54 errors