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