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