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