#include #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; int main() { int y, n, d; cin >> y >> n >> d; int mn = n - min(d, n); int mx = min(365 - d, n); cout << mn << " " << mx << endl; return 0; }