#ifdef _DEBUG #include "MyLib.h" #else #define main_A main #include "bits/stdc++.h" #include #define _USE_MATH_DEFINES #include #define FOR(i,s,e) for (int i = int(s); i < int(e); ++i) #define REP(i,e) FOR(i,0,e) #define INF (INT_MAX/2) #define EPS (1.0e-8) #define LINF (LONG_MAX/2) const int MGN = 8; const int ARY_SZ_MAX = 10000000; using namespace std; using ll = long long; using ull = unsigned long long; using vi = vector; using vvi = vector; using vvvi = vector; using vb = vector; using vvb = vector; using vvvb = vector; using vl = vector; using vvl = vector; using vd = vector; using vs = vector; using pii = pair; using pll = pair; // functions #endif int main_A() { cin.tie(0); ios::sync_with_stdio(false); int A, B, C; cin >> A >> B >> C; int ans = -1; int M = 10 * B + A; bool found = false; FOR(p, 1, M+1) { REP(i, B+1) { REP(j, A+1) { if (10 * i + j < p) continue; int change = (10 * i + j) - p; int cnt = 0; if (change > 0) cnt = change / 10 + change % 10; int n = B - i + A - j + cnt; if (n == C) { ans = p; found = true; break; } } if (found) break; } if (found) break; } if (ans < 0) cout << "Impossible" << endl; else cout << ans << endl; return 0; }