#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
const int mod = 1e9 + 7;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, m;
  cin >> n >> m;
  if (m == 0) {
    cout << n << ' ' << n << endl;
    return 0;
  }
  long long mx, mn;
  long long tmp = (1 + sqrt(1 + (8 * m))) / 2;
  if (tmp * 2 != (1 + sqrt(1 + (8 * m)))) tmp++;
  mn = max(0LL, (n - (2 * m)));
  mx = (n - tmp);
  cout << mn << ' ' << mx << endl;
  return 0;
}
