#include <iostream>
#include <algorithm>
#include <math.h>
using namespace std;

int main(){
    int c, s;
    cin >> c >> s;
    cout << ( ( c + 4 ) + sqrt ( c*c - 8*c + 16 - 16*s))/4 << " ";
    cout << ( ( c + 4 ) - sqrt ( c*c - 8*c + 16 - 16*s))/4;
    return 0;
}
