#include using namespace std; typedef unsigned long long ul; typedef signed long long ll; ul over = 1000000007; vector< int > pi_dist = { 20104, 20063, 19892, 20011, 19874, 20199, 19898, 20163, 19956, 19841 }; int main(void) { cin.tie(0); ios::sync_with_stdio(false); cout << fixed; string s; cin >> s; vector< int > input_dist(10); for (int i = 0; i < 10; ++i) input_dist[i] = 0; for (auto c : s) { if (c=='.') continue; input_dist[c-'0']++; } int plus, minus; for (int i = 0; i < 10; ++i) { if (input_dist[i] > pi_dist[i]) plus = i; if (input_dist[i] < pi_dist[i]) minus = i; } cout << plus << " " << minus << endl; return 0; }