//https://ncode.syosetu.com/n4830bu/313/ #include using namespace std; int main() { string S; cin >> S; int cnt[10] = {}; for (auto&& c : S) { if (isdigit(c)) cnt[c - '0']++; } int pi[10] = {20104, 20063, 19892, 20011, 19874, 20199, 19898, 20163, 19956, 19841}; for (int i = 0; i < 10; i++) { if (cnt[i] > pi[i]) cout << i << " "; } for (int i = 0; i < 10; i++) { if (cnt[i] < pi[i]) cout << i << endl; } }