#include using namespace std; int c(int y) { return 365 + (y % 4 != 0 || (y % 100 == 0 && y % 400 != 0) ? 0 : 1); } int main() { int Y, N, D; cin >> Y >> N >> D; int a = c(Y - 12); int b = c(Y + 1); if(D > 333) { D += a - b; } cout << N - D << " " << min(N, a - D) << endl; // wrong } // WA 14