#include<stdio.h>
int main(void)
{
int y,m,d;
scanf("%02d-%02d-%d",&m,&d,&y);
printf("%d-%02d-%02d",y,m,d);
return 0;
}
#include <stdio.h>
int main()
{
int a,b,c;
scanf("%d-%d-%d",&a,&b,&c);
if(a>1000)
printf("%04d-%02d-%02d",a,b,c);
else if(b>1000)
printf("%04d-%02d-%02d",b,a,c);
else
printf("%04d-%02d-%02d",c,a,b);
return 0;
}