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