#include using namespace std; bool isUruu(int y) { if (y == 2000 || y == 2400 || y == 2800) return true; if (y % 100 == 0) return false; return (y % 4 == 0); } int min12old(int n, int d) { return max(n - d, 0); } int max12old(int y, int n, int d) { int dpy = 365; if (isUruu(y-12)) ++dpy; return min(n, dpy - d); } int main() { int y, n, d; cin >> y >> n >> d; cout << min12old(n, d) << " " << max12old(y, n, d) << "\n"; return 0; }