#include #define REP(i, a, n) for(ll i = ((ll) a); i < ((ll) n); i++) using namespace std; typedef long long ll; string S; ll valid[10] = { 20104, 20063, 19892, 20011, 19874, 20199, 19898, 20163, 19956, 19841 }; int main(void) { cin >> S; ll cnt[256]; REP(i, 0, 256) cnt[i] = 0; REP(i, 0, S.size()) { if(S[i] == '.') continue; cnt[S[i]]++; } REP(i, 0, 10) if(cnt[i + '0'] > valid[i]) cout << i << " "; REP(i, 0, 10) if(cnt[i + '0'] < valid[i]) cout << i << endl; }