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