#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long n, m;
  cin >> n >> m;
  if (m == 0) {
    cout << n << " " << n << endl;
  } else {
    long long ans = 0;
    for (long long i = 1; i <= n; ++i) {
      if (i * (i - 1) / 2 >= m) {
        ans = n - i;
        break;
      }
    }
    cout << max(n - 2 * m, (long long)0) << " " << ans << endl;
  }
}
