#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0), cout.tie();
  long long int n, m;
  cin >> n >> m;
  if (m == 0) return !(cout << n << ' ' << n << '\n');
  if (n & 1ll) {
    long long int tmp = (n + 1) / 2;
    if (tmp <= m)
      cout << 0;
    else
      cout << n - m * 2;
  } else
    cout << n - min(n / 2, m) * 2;
  long long int sum = 0;
  int i;
  for (i = 1; i <= n && sum < m; ++i) {
    sum += i - 1ll;
    if (sum >= m) break;
  }
  cout << ' ' << n - min(1ll * i, n) << '\n';
  return 0;
}
