#include #include #include #include #include #include #include #include #include #include #include #include #include #define repd(i,a,b) for (int i=(a);i<(b);i++) #define rep(i,n) repd(i,0,n) #define var auto #define mod 1000000007 #define inf 2147483647 #define nil -1 typedef long long ll; using namespace std; // end of template int main() { cin.tie(0); // source code string s; cin >> s; int bin_true = 682; int sum_true = 17; int bin = 0; int sum = 0; rep(i, 200002){ if (i != 1) { bin ^= 1 << (s[i] - '0'), sum += (s[i] - '0'), sum %= 100; } } sum -= sum_true, bin ^= bin_true; vector ans; rep(i, 10){ if (bin & 1) { ans.push_back(i); } bin >>= 1; } while (abs(sum) != abs(ans[0] - ans[1])) { } if (sum) cout << ans[0] << " " << ans[1] << endl; else cout << ans[1] << " " << ans[0] << endl; return 0; }