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