#include using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); int N = 13; vector A(N); for(auto &a : A) cin >> a; vector answer; for(int i=1; i<10; i++){ A.push_back(i); map M; for(auto a : A) M[a]++; int two = 0,three = 0; for(auto [k,v] : M) two += v==2,three += v==3; if(two == 1 && three == 4) answer.push_back(i); A.pop_back(); } cout << answer.size() << "\n"; for(auto a : answer) cout << a << " "; cout << "\n"; }