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