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