#include <bits/stdc++.h>
using namespace std;
const long long N = 3e6;
const long long INF = 1e9 + 1;
const long long mod = 1e9 + 7;
long long n, m;
string s;
int main() {
  cin >> n >> m;
  cout << max(0ll, n - m - m) << " ";
  for (long long i = 0; i <= n; i++)
    if (i * (i - 1) / 2 >= m) return cout << n - i, 0;
}
