#include <bits/stdc++.h>
using namespace std;
int solve() {
  long long n, m;
  cin >> n >> m;
  if (m == 0 || n == 1) {
    cout << n << " " << n;
    return 0;
  }
  long long maxi;
  for (long long int i = 2; i < n + 1; i++) {
    long long val = (i * (i - 1)) / 2;
    if (val >= m) {
      maxi = n - i;
      break;
    }
  }
  long long mini = max(n - 2 * m, (long long)0);
  cout << mini << " " << maxi;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  while (t--) solve();
}
