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