#define _CRT_SECURE_NO_WARNINGS #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define MAX_MOD 1000000007 #define REP(i,n) for(long long i = 0;i < n;++i) #define LONG_INF 100000000000000 int main() { iostream::sync_with_stdio(false); string hoge; cin >> hoge; int nya[10] = { 372,436,415,376,409,432,416,385,414,438 }; nya[hoge[0] - '0']--; for (int i = 2;i < hoge.length();++i) { nya[hoge[i] - '0']--; } for (int i = 0;i < 10;++i) { if (nya[i] == -1) cout << i << " "; } for (int i = 0;i < 10;++i) { if (nya[i] == 1) cout << i << endl; } return 0; }