#include using namespace std; #ifdef LOCAL #include "settings/debug.cpp" #else #define Debug(...) void(0) #endif #define rep(i, n) for (int i = 0; i < (n); ++i) using ll = long long; using ull = unsigned long long; inline int returned(int a, int b, int c) { int rem = a + 10 * b - c; if (rem < 0) return -1e9; return rem / 10 + rem % 10; } int main() { int a, b, c; cin >> a >> b >> c; rep(cost, 300) { if (cost == 0) continue; rep(a_used, a + 1) rep(b_used, b + 1) { int num = 0; num += a - a_used; num += b - b_used; num += returned(a_used, b_used, cost); if (num == c) { cout << cost << endl; return 0; } } } cout << "Impossible" << endl; return 0; }