#include #define rep(i,n) for(long long i=0;i<(n);++i) using namespace std; typedef long long ll; int main() { ios::sync_with_stdio(false); cin.tie(0); int a, b, c; cin >> a >> b >> c; assert(0 <= a and a <= 20); assert(0 <= b and b <= 20); assert(0 <= c and c <= 100); for (int price = 1; price <= a + b * 10; price++) { for (int i = 0; i <= a; ++i) { for (int j = 0; j <= b; ++j) { const int pay = i + 10 * j; if (pay < price)continue; const int back = pay - price; const int pa = back % 10; const int pb = back / 10; const int coin = (a - i + pa) + (b - j + pb); if (coin == c) { cout << price << endl; return 0; } } } } cout << "Impossible" << endl; return 0; }