#include using namespace std; typedef long long ll; typedef pair P; #define REP(i,n) for(ll i=0;i a(13); REP(i,13) cin >> a[i]; map m; REP(i,13){ m[a[i]]++; } ll x=0,y=0,z=0; vector v; for(auto e:m){ ll b=e.first,c=e.second; if(c==3) x++; if(c==2){ y++; v.push_back(b); } if(c==1){ z++; v.push_back(b); } } sort(v.begin(),v.end()); if(x==3 && y==2){ cout << 2 << endl; cout << v[0] << ' ' << v[1] << endl; } else if(x==4 && z==1){ cout << 1 << endl; cout << v[0] << endl; } else{ cout << 0 << endl; cout << ' ' << endl; } return 0; }