#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m;
  cin >> n >> m;
  if (m == 0) {
    cout << n << " " << n << endl;
    return 0;
  }
  long long mini, maxi;
  mini = (2 * m >= n ? 0 : n - (2 * m));
  long long rem = m, cnt = 1, refr;
  while (rem > 0) {
    refr = min(rem, cnt);
    rem -= refr;
    cnt += 1;
  }
  maxi = n;
  if (cnt > 1) maxi = n - cnt;
  cout << mini << " " << maxi << endl;
  return 0;
}
