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