#include int solve(); int main() { int ans{solve()}; if (ans < 0) puts("Impossible"); else printf("%d\n", ans); return 0; } int solve() { int A, B, C; scanf("%d%d%d", &A, &B, &C); for (int cost{1}; cost <= A + 10 * B; cost++) { for (int a_i{}; a_i <= A; a_i++) { for (int b_i{}; b_i <= B; b_i++) { if (a_i + 10 * b_i < cost) continue; int change{a_i + 10 * b_i - cost}; if (A - a_i + B - b_i + change / 10 + change % 10 == C) return cost; } } } return -1; }