#include <iostream> using namespace std; int main() { int i,n,x,y,z,scx,scy; cin>>n; cin>>x; scx=0; while(x>0) {scx=scx+x%10; x=x/10;} for(i=1;i<n;i++) { cin>>y; scy=0; z=y; while(y>0) {scy=scy+y%10; y=y/10;} if(scx==scy) cout<<z<<" "; } return 0; }