#include <iostream> #include <iomanip> using namespace std; int IsLeapY(int y){ if(y%400==0 || (y%4==0 && y%100!=0)) return 1; else return 0; } int day[2][13]={{0,31,28,31,30,31,30,31,31,30,31,30,31},{0,31,29,31,30,31,30,31,31,30,31,30,31}}; int main() { int y,d; while(cin>>y>>d){ int i=1; int f=IsLeapY(y); while(d>day[f][i]){ d-=day[f][i]; i++; } cout<<y<<'-'<<setw(2)<<setfill('0')<<i<<'-'<<setw(2)<<setfill('0') <<d<<endl; } }