#include<iostream>using namespace std;
int main(){
int i;
for(int i=95860;i<100000;i++){
int a,b,c,d,e,f;
a=i/10000;
b=i%10;
c=i%100;
d=i/1000;
e=(c-b)/10;
f=d-(a*10);
if(a==b&&e==f){
cout<<i<<endl;
int g;
g=(i-95859)/2;
cout<<" "<<g<<endl;
}
}
return 0;
}