#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const long long N = 3e5 + 10;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long n, m;
  cin >> n >> m;
  if (m == 0) {
    cout << n << " " << n << "\n";
    return 0;
  }
  long long mn;
  if (m >= (n + 1) / 2) {
    mn = 0;
  } else {
    mn = n - m * 2;
  }
  long long ans = 0;
  for (long long i = 1; i <= n; i++) {
    long long k = i * (i - 1) / 2;
    if (k >= m) {
      ans = n - i;
      break;
    }
  }
  cout << mn << " " << ans << "\n";
}
