#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m;
  cin >> n >> m;
  if (n > 2 * m)
    cout << n - 2 * m << " ";
  else
    cout << 0 << " ";
  if (m == 0) {
    cout << n << endl;
    return 0;
  }
  int x = ceil((1 + ceil(sqrt(1 + 4 * 2 * m))) / 2);
  if (n > x)
    cout << n - x << endl;
  else
    cout << 0 << endl;
}
