#include <bits/stdc++.h>
using namespace std;
int main(void) {
  long long n, m, ans1, ans2;
  cin >> n >> m;
  if (m * 2 >= n)
    ans1 = 0;
  else
    ans1 = n - 2 * m;
  for (long long i = 1; i <= n; i++) {
    if ((long long)((1 + i) * i) >= m * 2) {
      ans2 = n - i - 1;
      break;
    }
  }
  if (m == 0) ans2 = n;
  cout << ans1 << " " << ans2 << endl;
  return 0;
}
