#include using namespace std; int main(){ int y,n,d; cin >> y >> n >> d; cout << max(0,n - d) << " "; cout << min(n,366 - d) << endl; //else cout << min(n,366 - d) << endl; }