#include<iostream> using namespace std; int main() { int a,b,c; scanf("%4d-%2d-%2d",&a,&b,&c); int m[13]={0,31,28,31,30,31,30,31,31,30,31,30,31}; if(a%4==0&&a%100!=0||a%400==0)m[2]++; if(c>=3)c-=2; else if(b!=1) { b--; c=m[b]+c-2; } else { a--; b=12; c=31+c-2; }printf("%4d-%02d-%02d",a,b,c); }