#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  vector<long long int> req(100009);
  long long int n, m, mi, ma;
  cin >> n >> m;
  if (m == 0) {
    cout << n << " " << n << endl;
    return 0;
  }
  if (m == 1) {
    cout << n - 2 << " " << n - 2 << endl;
    return 0;
  }
  req[0] = -1;
  req[1] = 0;
  for (long long int i = 2; i <= 100001; i++) {
    req[i] = (i * (i - 1)) / 2;
  }
  mi = n - 2 * m;
  if (mi < 0) mi = 0;
  ma = 0;
  long long int req1 = upper_bound(req.begin(), req.end(), m) - req.begin();
  req1--;
  ma += req1;
  if (m != req[req1]) ma++;
  ma = n - ma;
  if (ma < 0) ma = 0;
  cout << mi << " " << ma << endl;
  return 0;
}
