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