#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, m;
  cin >> n >> m;
  long long ans1 = max(0ll, n - m * 2);
  long long ans2 = 0;
  long long c = 0;
  long long z = 0;
  while (true) {
    if (m <= (z * (z - 1)) / 2) break;
    z++;
  }
  ans2 = max(0ll, n - z);
  cout << ans1 << " " << ans2;
  return 0;
}
