#include using namespace std; using ll = long long; constexpr char newl = '\n'; array pi = {20104,20063,19892,20011,19874,20199,19898,20163,19956,19841}; array getCounter(const string& s) { array res{}; for (char c : s) { if (c == '.') continue; res[c - '0']++; } return res; } int main() { cin.tie(nullptr); ios::sync_with_stdio(false); string s; cin >> s; array cnt = getCounter(s); for (int i = 0; i < 10; i++) { if (cnt[i] > pi[i]) { cout << i; } } cout << " "; for (int i = 0; i < 10; i++) { if (cnt[i] < pi[i]) { cout << i; } } cout << newl; return 0; }