#include int main() { int A, B, C; scanf("%d%d%d", &A, &B, &C); for(int price=1; price <= A + 10*B; price++) for(int a=0; a <= A; a++) for(int b=0; b <= B; b++) { const int pay = a + b*10; const int back = A + 10*B - pay; const int pa = back % 10; const int pb = back / 10; const int coin = (A - a + pa) + (B - b + pb); if(C == coin) { printf("%d", pay); return 0; } } printf("Impossible"); }