#include using namespace std; int c(int y) { return 365 + (true ? 0 : 1); } // wrong int main() { int Y, N, D; cin >> Y >> N >> D; if(D > 333) { D += c(Y - 12) - c(Y + 1); } cout << N - min(N, D) << " " << min(N, c(Y - 12) - D) << endl; } // WA 1