#include using namespace std; using ll = long long; template istream& operator >> (istream& is, vector& vec) { for(T& x : vec) is >> x; return is; } template ostream& operator << (ostream& os, const vector& vec) { if(vec.empty()) return os; os << vec[0]; for(auto it = vec.begin(); ++it != vec.end(); ) os << ' ' << *it; return os; } int main(){ ios::sync_with_stdio(false); cin.tie(0); array cnt{}, ary; fill(ary.begin(), ary.end(), 0); ary[2] = 2; ary[3] = 4; vector b(13); for(auto &&v : b) cin >> v; sort(b.begin(), b.end()); for(int i = 0; i < 13; ){ int p = i; while(i < 13 && b[i] == b[p]) i++; cnt[i - p]++; } vector ans; for(int i = 1; i <= 9; i++){ cnt[i]++; if(cnt == ary) ans.push_back(i); cnt[i]--; } cout << ans.size() << '\n'; cout << ans << '\n'; }