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