#include <stdio.h>
#include <stdlib.h>
int fan(int zhi); //找回文日期
int fan2(int zhi); //找ABABBABA回文日期
int main(int argc, char *argv[])
{
long num,hui1,hui2;
scanf("%ld",&num);
hui1=hui2=num+1;
while(hui1<90011010){
if(fan(hui1)){
break;
}
hui1++;
}
while(hui2<90900910){
if(fan2(hui2)){
break;
}
hui2++;
}
printf("%ld\n",hui1);
printf("%ld",hui2);
return 0;
}
int fan(int zhi){
int x,y,a,b,c,d;
x=zhi/10000;
y=zhi%10000;
a=x/100;
b=x%100;
c=y/100;
d=y%100;
if((a/10==d%10)&&(a%10==d/10)){
if((b/10==c%10)&&(b%10==c/10))
{
if(c<13&&d<32&&c>0)
return 1;
}
}
return 0;
}
int fan2(int zhi){
int x,y,a,b,c,d;
x=zhi/10000;
y=zhi%10000;
a=x/100;
b=x%100;
c=y/100;
d=y%100;
if((a/10==b/10)&&(b/10==c%10)&&(c%10==d%10)&&(a%10==b%10)&&(b%10==c/10)&&(c/10==d/10)){
if(c<13&&d<32&&c>0)
return 1;
}
return 0;
}
04-10
3487
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
11-10