#include <bits/stdc++.h>
using namespace std;
int n;
double ans, maxx, minn;
int main() {
  long long a, b;
  cin >> a >> b;
  if (b == 0)
    cout << a << " " << a << endl;
  else {
    long long c = 0, d = 0;
    c = a - b * 2;
    if (c < 0) c = 0;
    double x;
    x = (1 + sqrt(1 + 4 * 2 * b)) / 2;
    if (int(x) == x)
      d = a - x;
    else
      d = a - (int)x - 1;
    cout << c << " " << d << endl;
  }
  return 0;
}
