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