#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  long long int n, m;
  cin >> n >> m;
  long long int mx, mn, tem;
  tem = n - (2 * m);
  mn = max(0LL, tem);
  double t = sqrt(double((8 * m) + 1));
  t++;
  t /= 2;
  tem = (long long int)ceil(t);
  mx = n - tem;
  if (m == 0) mx = n;
  cout << mn << " " << mx << "\n";
  return 0;
}
