#include <iostream>
#include <fstream>
using namespace std;
ifstream f("rotund.in");
ofstream g("rotund.out");
int rotund(unsigned int x){
int nr=x, p=1, p2, k=0, c;
while(nr){k++; p*=10; nr/=10;}
k--; nr=x; p/=10;
while(k){
k--;
nr=p*(nr%10)+nr/10;
if(nr==x) return 1;
}
return 0;
}
int main()
{
unsigned int n, x, rotunde=0, v[50];
f>>n;
for(int i=1;i<=n;i++){
f>>x;
if(rotund(x)){
rotunde++;
v[rotunde]=x;
}
}
if(rotunde){
g<<rotunde<<'\n';
for(int i=1;i<=rotunde;i++)
g<<v[i]<<' ';
}
else g<<0;
f.close();
g.clsoe();
return 0;
}