#include <cstdio> int month[13][2] = {{0, 0}, {31, 31}, {28, 29}, {31, 31}, {30, 30}, {31, 31}, {30, 30}, {31, 31}, {31, 31}, {30, 30}, {31, 31}, {30, 30}, {31, 31}}; bool isLeap(int year) { return year % 400 == 0 || (year % 4 == 0 && year % 100 != 0); } int main() { int y, m, d; int count; scanf("%d-%d-%d", &y, &m, &d); scanf("%d", &count); while (count) { d++; if (d > month[m][isLeap(y)]) { d = 1; m++; } if (m > 12) { m = 1; y++; } count--; } printf("%d-%d-%d", y, m, d); return 0; }