#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 7;
int main() {
  long long n, m;
  cin >> n >> m;
  if (!m) return cout << n << ' ' << n, 0;
  long long mn = max(n - m * 2, (long long)0);
  cout << mn << ' ';
  int pos = n;
  for (long long i = int(1); i < int(n + 1); ++i)
    if (i * (i - 1) / 2 >= m) {
      pos = i;
      break;
    }
  cout << n - pos;
  return 0;
}
